alconebay Posted April 10, 2008 Share Posted April 10, 2008 How would I put a variable in the URL of $upload_path? I want this: $myvariable = thumbnail $upload_path = "../pics/$myvariable-image/" To send the image being uploaded to: ../pics/thumbnail-image/ But its not working with the variable (it works if I put "thumbnail" in place of the variable, so the script is fine). Should I format the variable differently? I tried quotation marks around it, parenthesis.... No go. Quote Link to comment Share on other sites More sharing options...
GingerRobot Posted April 10, 2008 Share Posted April 10, 2008 You need to enclose thumbnail in quotes, and add a semi-colon: $myvariable = 'thumbnail'; $upload_path = "../pics/$myvariable-image/"; Quote Link to comment Share on other sites More sharing options...
papaface Posted April 10, 2008 Share Posted April 10, 2008 You need to enclose thumbnail in quotes, and add a semi-colon: $myvariable = 'thumbnail'; $upload_path = "../pics/$myvariable-image/"; Either that or:$myvariable = 'thumbnail'; $upload_path = "../pics/".$myvariable."-image/"; Quote Link to comment Share on other sites More sharing options...
alconebay Posted April 10, 2008 Author Share Posted April 10, 2008 Works! Thanks. I had the " ; "s but not the " ' "s around the variable. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.