Jump to content

$upload_path = ',,/images/$file_name/'; // HELP!


jtracey0380

Recommended Posts

$upload_path = ',,/images/$file_name/'; // this is not working

 

OK - there is a name stored in $file_name - i know this for a fact - i've tested it all over the place.

 

I need the value of $file_name to show up in the code and it is not. for some strange reason. this is a file upload script and it works perfect when i simply add the stored value by hand.

 

here is what i've tried so far

 

$file_name

"file_name"

<php echo $file_name; ?>

'.$file_name.'

 

if you have any suggestions please let me know.

 

thank you!!!

 

John

Link to comment
https://forums.phpfreaks.com/topic/195131-upload_path-imagesfile_name-help/
Share on other sites

Hi John

 

You have an error in the code it should be $upload_path = '../images/$file_name/'; and not $upload_path = ',,/images/$file_name/';

 

Does this only occur here and not in your page code?

 

Can we see the rest of the query so its possible to see where $file_name gets its value from.

$upload_path = '../images/$file_name/'; will return something like:

 

../images/my-image.jpg/ why have you got the extra slash on the end?

 

$file_name="my-image.jpg";

$upload_path ="../images/$file_name";

echo $upload_path

 

returns: ../images/my-image.jpg

 

You do not need the curly braces??

 

Hope this helps

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.