Re: choosing the name to save a file as in a script
| From: | Erik J. Barzeski | Date: | Wed, 27 Dec 2000 17:10:24 +0000 |
| Subject: | Re: 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-31975@lists.php.net to get a copy of this message | ||
Hi,
Nope - that doesn't work very well because:
1. Posted variables aren't always reset (if you do anything with a form
and not just passing in variables with the URL)
and
2. Some FTP servers don't accept connections that stem from an HTTP
connection. I'm not sure of the actual technical terminology here... But
basically a connection can be refused if it's an FTP request that comes from
an HTTP stream or socket or something...
So... Those are two reasons. That's all... It was the best solution for
me on two of my sites... So maybe it is here as well.
jeremy brand <jeremy@nirvani.net> said something like this:
>> 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
>
>
--
Kindest regards,
Erik J. Barzeski
Life is what happens to you while
you're making other plans - John Lennon
************************************************
Email: erik@barzeski.com
Web: http://www.barzeski.com/
http://www.soundsetcentral.com/
http://www.applescriptcentral.com/
AIM: iacas ICQ: 8186546
************************************************