Forum Moderators: coopster

Message Too Old, No Replies

images from url?

how to download image from folder.

         

ska_demon

4:33 pm on Feb 18, 2004 (gmt 0)

10+ Year Member



Ok total complete newbie.(mySQL/PHP anyway)
Getting bored of building pages so thought I'd take a look at PHP.
I have a db
I have a table.
I have a page called script.php that will allow me to add items to the table and view the result on an html page. (output.html)
I have a field in the table in which i want to input the url of the image ie grafix/image1.jpg

Any ideas how i would write the code on the script.php page to download the image from its folder into a table cell on output.html and then have that output.html saved as a new html file in a specified folder. The new saved files names would be taken from another field in the table.

I am so new I don't even know if you can do this.
Bear with me
Cheers
Ska

ergophobe

5:19 pm on Feb 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Not sure I understand. Why do you want to save it as a new html file? Why not just leave it as a dynamic page?

So you get the URL from the table, then use that in your <img> tag to display the image. The page as such would not exist, but would be created dynamically each time.

Am I misunderstanding?

Tom

ska_demon

9:01 pm on Feb 18, 2004 (gmt 0)

10+ Year Member



No, I don't believe you misunderstand. I just need to generate a html page for each "product" that I add to the database.
I've only been at this proper for 48hrs so forgive me.
Thanks
Ska

ergophobe

10:39 pm on Feb 18, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Okay....

First, don't put the image in the db table. Just store the URL there and keep the image stored in the regular filesystem.

Second, do you know to get the url out of the table and use it to show an image? If not, you may want to brush up on the Basics of extracting data from MySQL [webmasterworld.com]

Does that help?