R: [PHP] Redirect

From: Date: Mon, 08 Jan 2001 19:49:47 +0000
Subject: R: [PHP] Redirect
Groups: php.general 
Request: Send a blank email to php-general+get-33294@lists.php.net to get a copy of this message
You can try this: Create an index.php page to put into /home/ftp/ redirect all requests to that file, grabbing the requested file as argument of index.php Then, analyse the REFERER, if it begins with your domain, than redirect to the requested file, otherwise return false. maybe a loop can happen though Regards Nicola. -----Messaggio originale----- Da: Joe Stump <joe@earth.care2.com> A: David Smith <webmaster@indywebdesign.com> Cc: php-general@lists.php.net <php-general@lists.php.net> Data: lunedì 8 gennaio 2001 20.23 Oggetto: Re: [PHP] Redirect >I don't believe what you are wanting to do is possible. > >--Joe > >On Mon, Jan 08, 2001 at 01:58:06PM -0500, David Smith wrote: >> Is there a way to redirect to a physical path and not a virtual one? My goal >> is to make all our files for download not accessible from a direct URL. This >> would help prevent other sites from linking directly to files stored on my >> server... >> >> Example: >> >> /home/ftp/file.zip >> >> instead of >> >> http://www.combatfs.com/ftp/file.zip >> >> Below is an example of my code. It pulls info from the DB then adds +1 to >> count and redirects to the url for download. >> >> <?php >> >> $connection = mysql_connect ("localhost", "****", "*****"); >> if ($connection == false){ >> echo mysql_errno().": ".mysql_error()."<BR>"; >> exit; >> } >> >> $query = "select * from warbirds_db WHERE FileID ='$FileID'"; >> $result = mysql_db_query ("combatfs", $query); >> >> if ($result){ >> >> $numOfRows = mysql_num_rows ($result); >> for ($i = 0; $i < $numOfRows; $i++){ >> $FileID = mysql_result ($result, $i, "FileID"); >> $FileType = mysql_result ($result, $i, "FileType"); >> $FileURL = mysql_result ($result, $i, "FileURL"); >> $FileCount = mysql_result ($result, $i, "FileCount"); >> >> } >> >> $Count = ($FileCount + 1); >> >> $update_query = "UPDATE warbirds_db SET FileCount = '$Count' WHERE FileID = >> '$FileID'"; >> $update_result = mysql_db_query ("combatfs", $update_query); >> >> header("Location: >> http://www.combatfs.com/ftp/$FileType/$FileURL"); >> >> } >> else{ >> echo mysql_errno().": ".mysql_error()."<BR>"; >> } >> >> mysql_close (); >> >> ?> >> >> >> -- >> PHP General Mailing List (http://www.php.net/) >> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >> For additional commands, e-mail: php-general-help@lists.php.net >> To contact the list administrators, e-mail: php-list-admin@lists.php.net > >--- >Joe Stump >PHP Programmer >www.Care2.com > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net > >

« previous php.general (#33294) next »