0

Can you help how to solve this im new in Php codeigniter. this code that get error

A PHP Error was encountered

Severity: Notice

Message: Array to string conversion

Filename: controllers/employers.php

Line Number: 44

A PHP Error was encountered

Severity: Warning

Message: Cannot modify header information - headers already sent by (output started at /home/tedyaya/public_html/system/core/Exceptions.php:186)

Filename: helpers/url_helper.php

Line Number: 543

claudios
  • 6,588
  • 8
  • 47
  • 90
  • 1
    Can you pls show us your controller? employers.php. It states that there's an error in line 44 – claudios May 14 '16 at 06:22
  • $config['upload_path'] = $path; $config['file_name'] = url_title(strtolower($this->input->post('Username'))) . $this->upload->data('file_ext'); $config['allowed_types'] = 'gif|jpg|png|'; $config['max_size'] = ''; $config['max_width'] = ''; $config['max_height'] = ''; $this->upload->initialize($config); $err = 'failed_reg'; $ok = true; – Richfield T Flores May 14 '16 at 06:34
  • $config['upload_path'] = $path; $config['file_name'] = url_title(strtolower($this->input->post('Username'))) . $this->upload->data('file_ext'); $config['allowed_types'] = 'gif|jpg|png|'; $config['max_size'] = ''; $config['max_width'] = ''; $config['max_height'] = ''; $this->upload->initialize($config); $err = 'failed_reg'; $ok = true; – Richfield T Flores May 14 '16 at 06:35
  • 1
    Edit your question – Pardeep Poria May 14 '16 at 06:35
  • $config['upload_path'] = $path; $config['file_name'] = url_title(strtolower($this->input->post('Username'))) . $this->upload->data('file_ext'); $config['allowed_types'] = 'gif|jpg|png|'; $config['max_size'] = ''; $config['max_width'] = ''; $config['max_height'] = ''; $this->upload->initialize($config); $err = 'failed_reg'; $ok = true; – Richfield T Flores May 14 '16 at 07:14
  • That is the code that got error inline 44 – Richfield T Flores May 14 '16 at 07:19
  • @RichfieldTFlores It is a bit hard to see all that code in your comments I would recommend you to edit your question by clicking on the edit button below tags. –  May 14 '16 at 07:51
  • NO edit button in the comment – Richfield T Flores May 14 '16 at 08:03

2 Answers2

0

Use print_r/var_dump in your controllers/employers.php line 44.

Deb K. Das
  • 27
  • 6
  • How sir im new in php codeigniter? – Richfield T Flores May 14 '16 at 06:39
  • $config['upload_path'] = $path; $config['file_name'] = url_title(strtolower($this->input->post('Username'))) . $this->upload->data('file_ext'); $config['allowed_types'] = 'gif|jpg|png|'; $config['max_size'] = ''; $config['max_width'] = ''; $config['max_height'] = ''; $this->upload->initialize($config); $err = 'failed_reg'; $ok = true; – Richfield T Flores May 14 '16 at 06:40
  • my files is ruuning in my localhost? when i transfer in the server this errror appear in my submit button of my site – Richfield T Flores May 14 '16 at 07:30
  • '$config['upload_path'] = $path; $config['file_name'] = url_title(strtolower($this->input->post('Username'))) . $this->upload->data('file_ext'); $config['allowed_types'] = 'gif|jpg|png|'; $config['max_size'] = ''; $config['max_width'] = ''; $config['max_height'] = ''; $this->upload->initialize($config); $err = 'failed_reg'; $ok = true;' – Richfield T Flores May 14 '16 at 07:33
  • `code`$config['upload_path'] = $path; $config['file_name'] = url_title(strtolower($this->input->post('Username'))) . $this->upload->data('file_ext'); $config['allowed_types'] = 'gif|jpg|png|'; $config['max_size'] = ''; $config['max_width'] = ''; $config['max_height'] = ''; $this->upload->initialize($config); $err = 'failed_reg'; $ok = true; – Richfield T Flores May 14 '16 at 07:34
  • `code`$config['upload_path'] = $path; $config['file_name'] = url_title(strtolower($this->input->post('Username'))) . $this->upload->data('file_ext'); $config['allowed_types'] = 'gif|jpg|png|'; $config['max_size'] = ''; $config['max_width'] = ''; $config['max_height'] = ''; $this->upload->initialize($config); $err = 'failed_reg'; $ok = true; – Richfield T Flores May 14 '16 at 07:34
  • `code`$config['upload_path'] = $path; $config['file_name'] = url_title(strtolower($this->input->post('Username'))) . $this->upload->data('file_ext'); $config['allowed_types'] = 'gif|jpg|png|'; $config['max_size'] = ''; $config['max_width'] = ''; $config['max_height'] = ''; $this->upload->initialize($config); $err = 'failed_reg'; $ok = true;`code` – Richfield T Flores May 14 '16 at 07:35
  • `code $config['upload_path'] = $path; $config['file_name'] = url_title(strtolower($this->input->post('Username'))) . $this->upload->data('file_ext'); $config['allowed_types'] = 'gif|jpg|png|'; $config['max_size'] = ''; $config['max_width'] = ''; $config['max_height'] = ''; $this->upload->initialize($config); $err = 'failed_reg'; $ok = true;` – Richfield T Flores May 14 '16 at 07:37
0

This error telling you that you are trying an array to convert in string..

For example

<?php
$a = array("Apple","Bnana");
echo $a;//Will give you same error 
?>

But

<?php
$a = array("Apple","Bnana");
print_r($a);//Will not give you any error
?>
Praveen Kumar
  • 2,408
  • 1
  • 12
  • 20
  • $config['upload_path'] = $path; $config['file_name'] = url_title(strtolower($this->input->post('Username'))) . $this->upload->data('file_ext'); $config['allowed_types'] = 'gif|jpg|png|'; $config['max_size'] = ''; $config['max_width'] = ''; $config['max_height'] = ''; $this->upload->initialize($config); $err = 'failed_reg'; $ok = true; – Richfield T Flores May 14 '16 at 06:37