Re: Redirect

From: Date: Mon, 08 Jan 2001 19:35:03 +0000
Subject: Re: Redirect
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-33287@lists.php.net to get a copy of this message
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

« previous php.general (#33287) next »