sharpmac Posted June 14, 2009 Share Posted June 14, 2009 Greetings, I have a flash upload script that I have been customizing for a few days, I almost have everything compleated and working great but I am having a heck of a time with line 59 http://pastie.org/511878 Regardless of what I do I can not get it to upload the files into the variable name, if I hardcode the variable $directory = "files/" it works just fine, but if you have read the remainder of the script you will see that I am creating gallery data with XML and php. I have the code make a new directory based off the event name, then make a xml file with the image name and descriptions, and all I want it to do is upload the images into the newly created directory that is known as $dir and its killing me Link to comment https://forums.phpfreaks.com/topic/162182-non-passing-of-variable/ Share on other sites More sharing options...
Philip Posted June 14, 2009 Share Posted June 14, 2009 Because variables in single quotes are not parsed like double quotes. // Will not work: echo '$var'; // Work work: echo "$var"; echo $var; Link to comment https://forums.phpfreaks.com/topic/162182-non-passing-of-variable/#findComment-855860 Share on other sites More sharing options...
sharpmac Posted June 14, 2009 Author Share Posted June 14, 2009 Thanks for the reply, but still no luck. The combinations I have done with no success are as follows. $directory = $dir/; $directory = '$dir/'; $directory = "$dir/"; All with no luck the trippy part is it does echo just fine, the variable is there, but for some reason it does not register as properly when called through the uploader. The only other time $directory is called into use is as follows. if ($allowed) { if ($maxFileSize == 0 || $maxFileSize >= $_FILES['Filedata']['size']) { move_uploaded_file($_FILES['Filedata']['tmp_name'], $directory.basename($_FILES['Filedata']['name'])); echo " "; } } Link to comment https://forums.phpfreaks.com/topic/162182-non-passing-of-variable/#findComment-855890 Share on other sites More sharing options...
sharpmac Posted June 18, 2009 Author Share Posted June 18, 2009 No other suggestions? I will be willing to post example files as needed. Link to comment https://forums.phpfreaks.com/topic/162182-non-passing-of-variable/#findComment-859209 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.