Jump to content

[SOLVED] Cant name a text file


Leadwing

Recommended Posts

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

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.