Jump to content

Best way to pass a file name in $_GET


guyfromfl

Recommended Posts

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

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.