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 Link to comment https://forums.phpfreaks.com/topic/224752-best-way-to-pass-a-file-name-in-_get/ 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); Link to comment https://forums.phpfreaks.com/topic/224752-best-way-to-pass-a-file-name-in-_get/#findComment-1160920 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! Link to comment https://forums.phpfreaks.com/topic/224752-best-way-to-pass-a-file-name-in-_get/#findComment-1160928 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.