PHP: changing filename to variable using fopen?

  • Thread starter Thread starter friedeggs
  • Start date Start date
F

friedeggs

Guest
I have 2 things being uploaded simultaneously: an image, and text placed into a form which is converted into a jpg.text.

How would I make sure that the txt file has the same name as the image? eg. blah.jpg corresponds to blah.jpg.txt.

Last line for image:
@move_uploaded_file($_FILES[$fieldname]['tmp_name'], $uploadFilename)

What I'm doing with the txt right now:

$fp = fopen("./gallery/uploaded_files/blah.jpg.txt", "w");
fwrite($fp, $formresults);
fclose($fp);

However, I need "blah" to be the same as $uploadFilename.

Help, please?
 
Back
Top