Portal Home > Knowledgebase > Articles Database > What am I not seeing?


What am I not seeing?




Posted by ringnebula, 08-23-2007, 01:15 PM
I'm sure there is something simple here that I am overlooking... Too many hours staring at the computer probably, but I'm getting a PHP Parse error: syntax error, unexpected T_STRING in inst.php on line 11. The code below is lines 9, 10, and 11. Thanks in advance for your not-so-tired eyes' help.

Posted by Steve_Arm, 08-23-2007, 01:23 PM
Are you sure it's from these lines? The error you get means - most of the times - that you have forgotten the $ before the variable's name.

Posted by ringnebula, 08-23-2007, 01:29 PM
Here is the whole block of code:

Posted by Steve_Arm, 08-23-2007, 01:35 PM
I don't see anything wrong, have you tried this kind of syntax: Example:

Posted by stuffradio, 08-23-2007, 02:05 PM
I'm also hard pressed to see what's wrong here... it all looks fine to me, here is a good debugging test. Comment out each line one by one and try running it. That way you know which line is the problem

Posted by Jatinder, 08-23-2007, 02:12 PM
Nothing is wrong with this code. Are you sure this is the file which is named in the error. Maybe the error is in one of your include files.

Posted by sasha, 08-23-2007, 02:41 PM
There are no syntax errors in the code you posted though none of it will work the way you expect it. This could help: $string = "This is string {$_POST['var']}"; or $string = "This is string ". $_POST['var'] ; Additionally, when using user submitted data in the database queries you need to clean it up a bit. At least do something like mysql_real_escape_string($_POST['var']) .

Posted by ringnebula, 08-23-2007, 04:18 PM
Ok I fixed my stupid mistake - the mysql_connect() line I sanatized above. In reality I have the host/user/pass values actually typed into the function and didn't have the values enclosed in quotes.... Arg

Posted by ringnebula, 08-23-2007, 05:36 PM
Nevermind... Last edited by ringnebula; 08-23-2007 at 05:46 PM.



Was this answer helpful?

Add to Favourites Add to Favourites    Print this Article Print this Article

Also Read
how stop cgi-telnet (Views: 730)


Language: