Click here to Skip to main content
15,892,839 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more: , +
I get this error:
syntax error, unexpected '$fh' (T_VARIABLE)
its on line 17 (
PHP
16: $myFile = "mems.txt";
17: $fh = fopen($myFile, 'a') or die("can't open file");
18: $stringData = <<<EOF
19: <tr>
20: <td></a href="{$_GET['uname']}.html>{$_GET['uname']}</a></td>
21: <td>Civilian</td>
22: <td>{$_GET['platform']}</td>
23: </tr> \n
24: EOF;


I don't see the issue, it has worked before. Can anyone help?
Posted
Comments
Mohibur Rashid 25-Jul-13 4:46am    
are you srue that you didn't put semi-colon before you post the problem? because if you miss the semicolon in line 16, you will get this error
G4mm4R4y 25-Jul-13 13:26pm    
All semi-colons are the same as they are in the source file.

1 solution

Why are you assigning the file open into a variable. Is it required?

Try to remove the $fh variable and simply write down the line 17 like
17. fopen($myFile, 'a') or die("can't open file");

I think this will solve your problem!
 
Share this answer
 
Comments
G4mm4R4y 25-Jul-13 13:17pm    
What would i put in the fclose statement?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900