19, July 2008

Upload image then show image with success message. - webmaster forum

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Easy PHP Upload (Moderator: Olaf)
Topic: Upload image then show image with success message.
« previous next »
Pages: [1] 2 Print

Author Topic: Upload image then show image with success message.  (Read 2734 times)
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« on: Nov 14, 2006, 09:51:32 PM »

Hi there,  i'm very new to PHP and have now used the great easy upload script and files.  Everything works great and i was wondering if it was possible to upload an image and if successful goto another web page and show the image on the new web page.  This is currently working on http://www.canvasinc.co.uk/your_photos.php Visit through proxy and i'm looking for the same functionality.  If this is not possible with easy upload then please let me know.  Thank you in advance.

-William-
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6277
38488 credits
Members referred : 374


It's time to use PHP5!


« Reply #1 on: Nov 14, 2006, 10:33:57 PM »

check the example for this row:

Code:
<?php
if (
$my_upload->upload($new_name)) { // new name is an additional filename information, use this to rename the uploaded file
         // and add this row
         
header("Location: the_page_with_image.php");


check also the PHP manual for the "header" function (your problem is not really upload related)


Last blog : 4th of July Lottery from TemplateMonster.com
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #2 on: Nov 15, 2006, 12:10:21 AM »

Wow, thanks for the quick response.  I have added the code and looked at the PHP manual for header info but i'm lost as what to do. The page now redirects to another but i need a code to be able to pull the uploaded image to be show on the new page.  You can look at example http://www.canvasinc.co.uk/your_photos.php Visit through proxy to see what i mean. Upload an image and the site redirects you to another page and shows the image that was uploaded.
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6277
38488 credits
Members referred : 374


It's time to use PHP5!


« Reply #3 on: Nov 15, 2006, 12:14:59 AM »

I'm confused...

on this redirected page it should be possible to show the image with an image tag

if you need the image name on the next page, then place him in the query string of the redirection url:

header("Location: yourpage.php?img=yourimage.jpg");


Last blog : 4th of July Lottery from TemplateMonster.com
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #4 on: Nov 15, 2006, 12:22:56 AM »

when a customer uploads an image, i wouldn't know what the image name would be or what extension it is, so i would have thought using header("Location: yourpage.php?img=yourimage.jpg"); would be wrong.
When you upload an image using easy upload, whan uploaded successfuly, the name of the image is shown on the page.  All i would need is that code worked into    header("Location: yourpage.php?img=yourimage.jpg");.  Would this be possible?
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6277
38488 credits
Members referred : 374


It's time to use PHP5!


« Reply #5 on: Nov 15, 2006, 12:42:06 AM »

yes on the next page you can use the var

$_GET['img'] in place of the image name.


of course your redirection variable need the var from the upload object:

?img=".$my_upload->file_copy;


Last blog : 4th of July Lottery from TemplateMonster.com
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #6 on: Nov 15, 2006, 10:41:10 AM »

Again....thank you.  I now have the image name being carried over to the next page in the browser address bar " .co.uk/upload2.php?img=1163579461.jpg" .
I am now struggling to get the code that pulls the name "1163579461.jpg" and adds it to www.webaddress.co.uk/uploads/ Visit through proxy........
How do i do this?  Once i crack this part i'll be over the moon!!!!.
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6277
38488 credits
Members referred : 374


It's time to use PHP5!


« Reply #7 on: Nov 15, 2006, 01:05:23 PM »

Again....thank you.  I now have the image name being carried over to the next page in the browser address bar " .co.uk/upload2.php?img=1163579461.jpg" .
I am now struggling to get the code that pulls the name "1163579461.jpg" and adds it to www.webaddress.co.uk/uploads/ Visit through proxy........
How do i do this?  Once i crack this part i'll be over the moon!!!!.
do you want to show the image or a page with the image?


Last blog : 4th of July Lottery from TemplateMonster.com
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #8 on: Nov 15, 2006, 01:21:33 PM »

I'm looking to show a page with the image.  Just as a though, is "<?php echo '<IMG SRC="/uploads/', $_GET['img'],'" WIDTH="500" HEIGHT="" BORDER="1" ALT="" />'; ?>" correct?
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #9 on: Nov 15, 2006, 01:34:58 PM »

Thank you so much for your help.  I have it all working.
I cannot thank you enough.
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6277
38488 credits
Members referred : 374


It's time to use PHP5!


« Reply #10 on: Nov 15, 2006, 01:46:21 PM »


hehe, good that it's working now...

Thank you so much for your help.  I have it all working.
I cannot thank you enough.
Donations are welcome Wink


Last blog : 4th of July Lottery from TemplateMonster.com
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #11 on: Nov 15, 2006, 02:02:16 PM »

Yey, no problem. I did look on the site for a paypal or something similar.  Let me know how and i'll be more than happy to.
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6277
38488 credits
Members referred : 374


It's time to use PHP5!


« Reply #12 on: Nov 15, 2006, 04:12:42 PM »

Yey, no problem. I did look on the site for a paypal or something similar.  Let me know how and i'll be more than happy to.
webdigity is not my website...
check the project page (left colomn)
http://www.finalwebsites.com/snippets.php?id=7 Visit through proxy


Last blog : 4th of July Lottery from TemplateMonster.com
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #13 on: Nov 15, 2006, 04:20:16 PM »

Can you advise of a progress meter for easyupload or a program that would be simple to merge.  As friends will be uploading images onto my server and will be 10mb each, i'll need a progress meter to let them know the upload in working.
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6277
38488 credits
Members referred : 374


It's time to use PHP5!


« Reply #14 on: Nov 15, 2006, 10:33:36 PM »

hmm, never used a loading bar, but try this: http://wiki.xajaxproject.org/Tutorials:Creating_a_Loading_Message Visit through proxy

or I remember that mind_nl has used one for his 43ads website (or not?)


Last blog : 4th of July Lottery from TemplateMonster.com
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #15 on: Nov 16, 2006, 12:28:42 AM »

No sorry, I don't have a progress bar. But I did find one that may be usefull: MegaUpload Visit through proxy


Last blog : Are You Stumbling Yet?
Global Moderator
Internet Junkie
*****
Gender: Male
Posts: 1807
9006 credits
Members referred : 6



« Reply #16 on: Nov 16, 2006, 12:34:12 AM »

Here is another one: progress bar Visit through proxy but it's ASP based. The process doesn't sound too difficult: when submitting the upload form you will be able to read the file size in $_FILES['userfile']['size'] a process running in a new window or iframe can read the filesize of the temp file and with the two values you can figure out a 'percentage done' and display that on screen.

A quick fix could be to display an animated gif, stating the upload is currently processing...
« Last Edit: Nov 16, 2006, 12:36:12 AM by Mind_nl »


Last blog : Are You Stumbling Yet?
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6277
38488 credits
Members referred : 374


It's time to use PHP5!


« Reply #17 on: Nov 16, 2006, 09:21:30 AM »

I think we need to do something here, megaupload is to complex with requirements, I think some simple JS code should be enough.

I will try to create one at the weekend. (sounds fun) Wink


Last blog : 4th of July Lottery from TemplateMonster.com
Chicken-run Manager
*
Posts: 9
58 credits
Members referred : 0


« Reply #18 on: Nov 20, 2006, 12:17:33 AM »

Hi Olaf,
I'm still unable to paypal your account, where can i find the info to do so?  Please let me know as i do appreciate your contribution to the above.
-William-
Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6277
38488 credits
Members referred : 374


It's time to use PHP5!


« Reply #19 on: Nov 20, 2006, 10:55:41 AM »

Hi Olaf,
I'm still unable to paypal your account, where can i find the info to do so?  Please let me know as i do appreciate your contribution to the above.
-William-

please check the donate button on this page: http://www.finalwebsites.com/snippets.php?id=7 Visit through proxy

(right col. below the other sozialize buttons)


Last blog : 4th of July Lottery from TemplateMonster.com
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=4795
Tags : php asp browsers Bookmark this thread : Digg Del.icio.us Dzone more....

Topic sponsors:
Get a permanent link here for $1.99!


Pages: [1] 2 Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP  >  PHP classes @finalwebsites.com  >  Easy PHP Upload (Moderator: Olaf)
Topic: Upload image then show image with success message.
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
Jul 19, 2008, 06:39:53 AM





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!


Forum Statistics
Total Posts: 35.662
Total Topics: 7.373
Total Members: 3.693
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: talelmouaada

21 Guests, 2 Users online :

12 users online today:



Readers

Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2008 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.