guyfromfl Posted January 17, 2011 Share Posted January 17, 2011 I am trying to send a file name to another php file, but am having trouble coming up with the best way to deal with the period between filename and extension. I have done a little reading on google and came up with 2 1/2 solutions... #1 - Pass the file name only and assume the extension later. This is good but limits what I can do in the future. #2 - Pass the file name and extension as different vars (ie phpfile.php?filename=foo&ext=bar) #3 - Write a function that changes the periods to an acceptable character and then convert it back in phpfile.php. I don't think this is such a great idea since you can have a file name like joe_vs_the_volcano.1988.txt or whatever. I was just wondering if anybody had any ideas and thoughts I am missing... Thanks Quote Link to comment Share on other sites More sharing options...
AbraCadaver Posted January 17, 2011 Share Posted January 17, 2011 #3, except you don't have to write the function $newname = urlencode($filename); Quote Link to comment Share on other sites More sharing options...
guyfromfl Posted January 17, 2011 Author Share Posted January 17, 2011 Ha, thats awsome. Idk why I didn't see one mention of that function, and why I wasn't even thinking about it. Thanks! 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.