Welcome Guest, Not a member yet? Register   Sign In
illegal string message
#1

Hello all 

I am getting this message

A PHP Error was encountered
Severity: Warning
Message: Illegal string offset '$_GET['companyName']'
Filename: libraries/Profiler.php
Line Number: 276


this is the line code

$output['$_GET['. $key .']'] = htmlspecialchars(stripslashes($val));

Can anybody help?

Cannot seem to figure out what is wrong
Reply
#2

There is something wrong with companyName or it is not in the GET array.
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#3

You got too many ' in your code.
Code:
$output[$_GET[$key]] = htmlspecialchars(stripslashes($val));
Reply
#4

also out of curiosity, what is the value of $_GET['companyName'] ?
Reply
#5

(05-05-2018, 06:38 AM)jreklund Wrote: You got too many ' in your code.
Code:
$output[$_GET[$key]] = htmlspecialchars(stripslashes($val));
the code is executing a search for the 'name' value
Reply
#6

(05-09-2018, 11:13 PM)elliotash Wrote:
(05-05-2018, 06:38 AM)jreklund Wrote: You got too many ' in your code.
Code:
$output[$_GET[$key]] = htmlspecialchars(stripslashes($val));
the code is executing a search for the 'name' value

could you also clarify your statement  too many ' in my code
Reply
#7

Append to previous answers:
1. Did you edit CI system files? I highly recommend you to create MY_... files (in the application folder) instead.
2. It's good practice to use $this->input->get() instead of $_GET.
3. In your code used '$_GET['companyName']' as an $output index, not the value of $_GET['companyName'].
Reply




Theme © iAndrew 2016 - Forum software by © MyBB