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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.