RE: [PHP] choosing the name to save a file as in a script
| From: | jeremy brand | Date: | Wed, 27 Dec 2000 15:58:31 +0000 |
| Subject: | RE: [PHP] choosing the name to save a file as in a script | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-31970@lists.php.net to get a copy of this message | ||
> include("DATABASE_CONNECTION.inc");
> $sql_query="select * from some_db where id='$id'";
> $result=mysql_query($sql_query);
> $the_row=mysql_fetch_array($result);
>
> echo "<meta HTTP-EQUIV=\"refresh\" CONTENT=\"0;
>
> URL=ftp://ftp.somesite.com/".$the_row['path_to_file']."\">";
Wouldn't the more appropriate way be to redirect the browser based on
HTTP headers, thus not giving the browser any choice as to what to do
-- well, more so than a client side redirect.
Instead of
> echo "<meta HTTP-EQUIV=\"refresh\" CONTENT=\"0;
>
> URL=ftp://ftp.somesite.com/".$the_row['path_to_file']."\">";
Simply do:
header("Location: ftp://ftp.somesite.com/".$the_row['path_to_file']);
Jeremy Brand
Jeremy Brand :: Sr. Software Engineer :: 408-245-9058 :: jeremy@nirvani.net
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more
Get your own Free, Private email at http://www.smackdown.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
"<body>" -- Quoted from Yahoo! homepage, http://www.yahoo.com