Uploading and resizing an image - tutorial

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
s4salman
Forum Newbie
Posts: 7
Joined: Wed Nov 07, 2007 9:03 am

Uploading and resizing an image - tutorial

Post by s4salman »

i read tutorial
viewtopic.php?t=41743

can we add something to this script, so that original file name and its resize file name stores into mysql database.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

To save the path to the image filename, if you're saving it to the hard drive, use the second parameter of one of the image functions.. e.g. imagejpeg($im, '/path/to/file.jpg);

To have the image be named on the fly if you're not saving the image (such as someone right clicks on it and saves), you'll have to send the filename in the header().
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Rovas
Forum Contributor
Posts: 272
Joined: Mon Aug 21, 2006 7:09 am
Location: Romania

Post by Rovas »

Of course, just replace thumbail.jpg with an variable that represents the name you what to give, and then add a different function that insert in the table of the database the image: is a simple script that is similar to a certain point with the script that you use when wanting to display some data from a database instead of SELECT command you use INSERT.
If you don' t know how to do this search this forum, net.
s4salman
Forum Newbie
Posts: 7
Joined: Wed Nov 07, 2007 9:03 am

Post by s4salman »

[s]u[/s] you mean i can store the values of

$filename

$thumb

to mysql database.am i right ?
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:11. Please use proper, complete spelling when posting in the forums. AOL Speak, leet speak and other abbreviated wording can confuse those that are trying to help you (or those that you are trying to help). Please keep in mind that there are many people from many countries that use our forums to read, post and learn. They do not always speak English as well as some of us, nor do they know these aberrant abbreviations. Therefore, use as few abbreviations as possible, especially when using such simple words.

Some examples of what not to do are ne1, any1 (anyone); u (you); ur (your or you're); 2 (to too); prolly (probably); afaik (as far as I know); etc.
Post Reply