Jump to content

PHP URL Trouble


kool_samule

Recommended Posts

Hi Chaps,

 

I have a PHP FTP App, where users can log in using a unique code and a password.

 

Their unique code corresponds to an FTP folder, e.g.

\FTP_Root\Customer A & Co\

 

So when the user logs in, they can see their FTP directory and contents, in this case an Inbox and an Outbox.

This works as the FTP folder contains both an Inbox and an Outbox.

 

The problem I am having is when I try browsing within this directory (say the Inbox), ftp-chdir fails.

 

I have a hyperlink that sends a 'dir' parameter to the same ftp.php page, and if set, will attempt to change to the given directory.

 

So even though the URL Hyperlink reads:

....server.co.uk/ftp.php?dir=/FTP_Root/Customer A & Co/Inbox

 

When you click on this link, the page tries to load:

....server.co.uk/ftp.php?dir=/FTP_Root/Customer A

 

So my question is what do I need to change, the Hyperlink to read something like:

....server.co.uk/ftp.php?dir=/FTP_Root/Customer%20A%20&%20Co/Inbox

 

Do something to the ftp-chdir function, where I encode/decode/whatever to make sure it tries to change to the correct FTP directory?

 

Or exclude all ampersand entirely?

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.