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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.