Page 1 of 1

PHP Image Upload

Posted: Thu Jan 29, 2004 8:58 pm
by maboroshi
Hi I am experimenting with a small script that I am writing basically I have a form with these values name email comments image the image value is for uploading images this is all going into a database the image value in the database I specified as varchar because I had read it is better to specify the path to an image instead of loading the image into the database now in my php script when I pass the values I am stuck because I don't know how to specify the path so the database can read it would i just specify my image variable like this

Code: Select all

$image = "/path/to/my/folder";
then when I insert the image into the database would I just use the variable $image

anyhelp is appreciated cheers

Andrew

Re: PHP Image Upload

Posted: Thu Jan 29, 2004 9:36 pm
by DuFF
maboroshi wrote:Hi I am experimenting with a small script that I am writing basically I have a form with these values name email comments image the image value is for uploading images this is all going into a database the image value in the database I specified as varchar because I had read it is better to specify the path to an image instead of loading the image into the database now in my php script when I pass the values I am stuck because I don't know how to specify the path so the database can read it would i just specify my image variable like this
See, there's this thing called punctuation . . . could you please try to use it? :wink:

Anyway, the best way to do this is just to give a URL right to the image. SO something like this:

Code: Select all

$image = "http://www.yoursite.com/upload/image/image.jpg";