...

View Full Version : Image saving



van21691
10-31-2006, 02:35 AM
I have a site that let other upload their image on my site. http://www.iwanto.getmypage.com/img/img/index.php
Now, I need help with saving the image so the registered member can retreive the image code
Any help
Thank you

homerUK
10-31-2006, 05:46 PM
if it's already being uploaded, just write the path to a database against the user who is uploading it?

so if userID = 100, just store the image path something like "uploads/images/filename.jpg" then the user could use that.

is that what you mean?

van21691
11-01-2006, 01:54 AM
http://www.iwanto.getmypage.com/img/img/reg/index.php
try to log-in,
username: admin
password: admin

then upload some pic please a small file. after uploading i want the uploaded pic to be shown on the homepage of the logged members

homerUK
11-01-2006, 07:29 AM
ok I uploaded an image and it gave me the url to the uploaded image. All you need to do is save the image name which you generate, then put that in an images table. A structure such as

imageID
userID
image_path
date_uploaded
size
etc. etc.

Then when the user logs in, just so a query to say

SELECT * FROM images WHERE userID = $userID

(where $userID is the user who is logged in)

then loop through the results displaying the image



while ($row = mysql_fetch_array($result)) {
echo "<img src='".$row['image_path']."' />";
}


something like that would work ok?

van21691
11-01-2006, 03:07 PM
All you need to do is save the image name which you generate, then put that in an images table. A structure such as

imageID
userID
image_path
date_uploaded
size
etc. etc.



Do I have to create an mysql table for imageID, userID, etc. etc.?

homerUK
11-01-2006, 03:20 PM
I assume you've already got a table with members' details in? (used for the login)

so yes I would create another mysql table for the images. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum