Leadwing Posted April 15, 2008 Share Posted April 15, 2008 Hi there, I have a page with an image upload and a textarea field. The image upload works fine, but I also want to create a text file which is called the $_SESSION['name'] (which is given earlier on) and contains what they put in the field. I have: $imgname = $_SESSION['name'] $file = $imgname; $fh = fopen($file, 'w') or die("can't open file"); $imgnote = $_POST['imgnote']; fwrite($fh, $imgnote); fclose($fh); I dont understand why it wont work, I can get it to be named anything else. It comes up with "Parse error: syntax error, unexpected T_VARIABLE in #####.co.uk/user/htdocs/ss/ss4.php on line 28" And i do have a working session and everything! Thanks Link to comment https://forums.phpfreaks.com/topic/101197-solved-cant-name-a-text-file/ Share on other sites More sharing options...
craygo Posted April 15, 2008 Share Posted April 15, 2008 you forgot your semicolon $imgname = $_SESSION['name']; // need semi colon Ray Link to comment https://forums.phpfreaks.com/topic/101197-solved-cant-name-a-text-file/#findComment-517641 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.