Jump to content

Replace URL


web2000

Recommended Posts

You need to set up an alias for that folder on the webserver...which if the folders are dynamic this will not work....

 

If they are dynamic you could use the scandir() function to get a directory listing... then you would put the folder that the user wants to goto into a variable and when they go there you just send them there via header() function....

 

 

example:

directory: test

sub-dir: stest1

sub-dir: stest2

 


$dir = scandir('/usr/local/www/apache22/data/test');
$i_total=count($dir);

for ($i=0; $i<$i_total; $i++) {

echo "<a href=\"http://192.169.0.1/$dir[$i]/\">" . $dir[$i] . "</a><br>";

}

 

will give you an output of:

 

stest1

stest2

 

as links and then they will take you to that directory...

 

im not sure if this is what your looking for but you can also use the header() function to do something similar by populating the directory into a variable then use the header() function to send them to that folder.

 

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.