Jump to content

[SOLVED] Function Name Must Be a String error


scottt

Recommended Posts

I'm trying to check whether a variable in my code is equal to a session variable I've stored, and set a radio button accordingly. The following code gives a "Function Name Must Be a String" error on the line with the $_SESSION variable. I'm not sure what I'm doing wrong since I'm fairly new to PHP still. In the debugger I'm using, $_SESSION('item_icon') is a string such as "car.jpg" or "boat.jpg". Thanks.

 

print "<td><img src=$file><br><input type=\"radio\" name=\"myradio\" id=\"myradio\" value=\"$file\"";

           

            if ($_SESSION('item_icon') == $file) {

                print "checked = \"true\"";

            } else {

                print "checked = \"false\"";

            }

            print "\"></td>";

     

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.