Re: file downloads
| From: | I_UNION | Date: | Sat, 04 Aug 2001 17:36:08 +0000 |
| Subject: | Re: file downloads | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-61255@lists.php.net to get a copy of this message | ||
Hi
I'm very news in php
Anyone knows how can i submit sample HTML form by php and write into
database ???
I have anly one registration form username, password, First name last_name,
and phone
I need only small samples and all will be ok ..
thanks in advance
=========================================
----- Original Message -----
From: "Data Driven Design" <jeff@datadrivendesign.com>
To: "Rasmus Lerdorf" <rasmus@php.net>
Cc: <php-general@lists.php.net>
Sent: Saturday, August 04, 2001 10:27 PM
Subject: Re: [PHP] file downloads
> I usually put or die(mysql_error()) and make it work before I put in the
@,
> that's been done already. This will display the image
>
> $result = @mysql_query($query);
> $row = mysql_fetch_row($result);
> $path = $row[0];
> print "<img src=\"$path\">";
>
> What I want is to display a 'save as' box to download the image whose file
> path is stored in the variable $path. Am I doing something wrong in the
> header section? The print statement would be commented out if I used this.
>
> $file_path = basename($path);
> header("Content-Type: application/download\n");
> header("Content-Disposition: attachment; filename=$file_name");
> header("Content-Transfer-Encoding: binary");
> readfile($path);
>
> Data Driven Design
> 1506 Tuscaloosa Ave
> Holly Hill, Florida 32117
>
> http://www.datadrivendesign.com
> Phone: (386) 226-8979
>
> Websites That WORK For You
> ----- Original Message -----
> From: "Rasmus Lerdorf" <rasmus@php.net>
> To: "Data Driven Design" <jeff@datadrivendesign.com>
> Cc: <php-general@lists.php.net>
> Sent: Saturday, August 04, 2001 1:01 PM
> Subject: Re: [PHP] file downloads
>
>
> > > I made the changes you suggested and it's still a no go. I'm sure of
the
> > > query because
> > >
> > > print "<img src=\"$path\">";
> > >
> > > Will display the image I'm trying to download.
> >
> > How does that make the SQL query valid? You didn't implement the
> > mysql_query() error checking I suggested. That's likely what is causing
> > you problems.
> >
> > -Rasmus
> >
> >
>
>
> --
> 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
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com