[PHP] Uploading file
Hi, I am new to this group. I am trying to figure out how to let people to upload image files to my website. My ISP is using PHP 3 (I believe). If someone can give me simple example, that will be great. Thanks. --Clemson How can I tell what version of PHP is running on the system (linux)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Uploading file
Thanks Juan, and other listers, I have this example, Figure 7-3 \n"); print("Name: $UploadedFile_name \n"); print("Size: $UploadedFile_size \n"); print("Type: $UploadedFile_type \n"); print("\n"); } ?> and the result is this after I uploaded a file Local File: /tmp/phpnYLV2J Name: 323lake.jpg Size: 48254 Type: image/pjpeg But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path. Do I normally do a copy after the upload? Can I just change the tmp path and filename when I upload? Thanks. --Clemson -Original Message- From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 7:58 AM To: Clemson Chan; [EMAIL PROTECTED] Subject: Re: [PHP] Uploading file Hi friend, http://www.php.net/manual/en/features.file-upload.php And take a look to the User Contributed Notes --jp At 13:03 03-09-2002 -0700, Clemson Chan wrote: >Hi, I am new to this group. >I am trying to figure out how to let people to upload image files to my >website. >My ISP is using PHP 3 (I believe). >If someone can give me simple example, that will be great. >Thanks. > >--Clemson > >How can I tell what version of PHP is running on the system (linux)? > > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, visit: http://www.php.net/unsub.php Juan Pablo Aqueveque <[EMAIL PROTECTED]> Ingeniero de Sistemas Departamento de Redes y Comunicaciones http://www.drc.uct.cl Universidad Católica de Temuco. Tel:(5645) 205 630 Fax:(5645) 205 628 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Uploading file
Thank you so much. I got the uploaded files now with full path ("/home/user/www/uploaded_files/") as the new path. can I use relative path such as "../uploaded_files/" ? Thanks --Clemson -Original Message- From: Rodrigo Dominguez [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 3:55 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Uploading file You are doing wrong... you are checking for the temp file and after that you are deleting the temp file, you should copy the files first This is your code if(isset($UploadedFile)) { unlink($UploadedFile); // Here you are deleting the temp file print("Local File: $UploadedFile \n"); print("Name: $UploadedFile_name \n"); print("Size: $UploadedFile_size \n"); print("Type: $UploadedFile_type \n"); print("\n"); } You should write something like this if(isset($UploadedFile)) { copy($UploadedFile, "/uploaded_files/" . $UploadedFile_name); // Here we first copy the temp file to a secure path, you should change the /uploaded_files/ // path print("Local File: $UploadedFile \n"); print("Name: $UploadedFile_name \n"); print("Size: $UploadedFile_size \n"); print("Type: $UploadedFile_type \n"); print("\n"); unlink($UploadedFile); // Now we can delete the temp file } "Clemson Chan" <[EMAIL PROTECTED]> escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Thanks Juan, and other listers, > > I have this example, > > > > Figure 7-3 > > > //check for file upload > if(isset($UploadedFile)) > { > unlink($UploadedFile); > print("Local File: $UploadedFile \n"); > print("Name: $UploadedFile_name \n"); > print("Size: $UploadedFile_size \n"); > print("Type: $UploadedFile_type \n"); > print("\n"); > } > ?> > ACTION="7-3.php" METHOD="post"> > > > > > > > > > and the result is this after I uploaded a file > > Local File: /tmp/phpnYLV2J > Name: 323lake.jpg > Size: 48254 > Type: image/pjpeg > > But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path. > Do I normally do a copy after the upload? > Can I just change the tmp path and filename when I upload? > Thanks. > > --Clemson > > > > -----Original Message- > From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 03, 2002 7:58 AM > To: Clemson Chan; [EMAIL PROTECTED] > Subject: Re: [PHP] Uploading file > > > Hi friend, > > http://www.php.net/manual/en/features.file-upload.php > And take a look to the User Contributed Notes > > --jp > > At 13:03 03-09-2002 -0700, Clemson Chan wrote: > >Hi, I am new to this group. > >I am trying to figure out how to let people to upload image files to my > >website. > >My ISP is using PHP 3 (I believe). > >If someone can give me simple example, that will be great. > >Thanks. > > > >--Clemson > > > >How can I tell what version of PHP is running on the system (linux)? > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > Juan Pablo Aqueveque <[EMAIL PROTECTED]> > Ingeniero de Sistemas > Departamento de Redes y Comunicaciones http://www.drc.uct.cl > Universidad Católica de Temuco. > Tel:(5645) 205 630 Fax:(5645) 205 628 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Uploading file
relative paths work too. Thank you so much. --Clemson -Original Message- From: Rodrigo Dominguez [mailto:[EMAIL PROTECTED]] Sent: Tuesday, September 03, 2002 3:55 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Uploading file You are doing wrong... you are checking for the temp file and after that you are deleting the temp file, you should copy the files first This is your code if(isset($UploadedFile)) { unlink($UploadedFile); // Here you are deleting the temp file print("Local File: $UploadedFile \n"); print("Name: $UploadedFile_name \n"); print("Size: $UploadedFile_size \n"); print("Type: $UploadedFile_type \n"); print("\n"); } You should write something like this if(isset($UploadedFile)) { copy($UploadedFile, "/uploaded_files/" . $UploadedFile_name); // Here we first copy the temp file to a secure path, you should change the /uploaded_files/ // path print("Local File: $UploadedFile \n"); print("Name: $UploadedFile_name \n"); print("Size: $UploadedFile_size \n"); print("Type: $UploadedFile_type \n"); print("\n"); unlink($UploadedFile); // Now we can delete the temp file } "Clemson Chan" <[EMAIL PROTECTED]> escribió en el mensaje [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... > Thanks Juan, and other listers, > > I have this example, > > > > Figure 7-3 > > > //check for file upload > if(isset($UploadedFile)) > { > unlink($UploadedFile); > print("Local File: $UploadedFile \n"); > print("Name: $UploadedFile_name \n"); > print("Size: $UploadedFile_size \n"); > print("Type: $UploadedFile_type \n"); > print("\n"); > } > ?> > ACTION="7-3.php" METHOD="post"> > > > > > > > > > and the result is this after I uploaded a file > > Local File: /tmp/phpnYLV2J > Name: 323lake.jpg > Size: 48254 > Type: image/pjpeg > > But I couldn't find the uploaded file, nor the /tmp/phpnYLV2J path. > Do I normally do a copy after the upload? > Can I just change the tmp path and filename when I upload? > Thanks. > > --Clemson > > > > -Original Message----- > From: Juan Pablo Aqueveque [mailto:[EMAIL PROTECTED]] > Sent: Tuesday, September 03, 2002 7:58 AM > To: Clemson Chan; [EMAIL PROTECTED] > Subject: Re: [PHP] Uploading file > > > Hi friend, > > http://www.php.net/manual/en/features.file-upload.php > And take a look to the User Contributed Notes > > --jp > > At 13:03 03-09-2002 -0700, Clemson Chan wrote: > >Hi, I am new to this group. > >I am trying to figure out how to let people to upload image files to my > >website. > >My ISP is using PHP 3 (I believe). > >If someone can give me simple example, that will be great. > >Thanks. > > > >--Clemson > > > >How can I tell what version of PHP is running on the system (linux)? > > > > > >-- > >PHP General Mailing List (http://www.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > Juan Pablo Aqueveque <[EMAIL PROTECTED]> > Ingeniero de Sistemas > Departamento de Redes y Comunicaciones http://www.drc.uct.cl > Universidad Católica de Temuco. > Tel:(5645) 205 630 Fax:(5645) 205 628 > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mysql_insert_id
Hi guys, I never can get mysql_insert_id? Is this broken with PHP4? Please let me know if you can get it to work. or work around. Thanks. --Clemson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] I don't want multiple form submitted
I have a message board written in PHP w/MySQL. So when a person submitting a post, it goes to a list_view. If this person refresh the list_view. The message he submitted will get submitted again. How can I avoid this problem? Please let me know if you know the answer. Thanks --Clemson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php