bogu wrote:Where u have this echo :
echo "File is valid, and was successfully uploaded.\n";
Just make your UPDATE or INSERT into DB with your file name ($uploadfile) ...
Ok bogu, it worked quite fine.
Here's how it was solved, for anyone else who has same problem:
<?php
$uploaddir = './Images/';
$uploadfile = $uploaddir . basename($_FILES['uploadedFile']['name']);
echo '<pre>';
if (move_uploaded_file($_FILES['uploadedFile']['tmp_name'], $uploadfile)) {
echo "The pictue was successfully uploaded.\n";
$sql = "INSERT INTO Pictures (URL) VALUES ('$uploadfile')";
$result = mysql_query($sql);
} else {
echo "There was a problem uploading the file, please try again.\n";
}
print '<pre>';
?>
The $uploadfile POSTed into my DB is posted as following:
./Images/filename.ext
Now I need to change this into an URL before is posted, can anyone help?
I was thinking to add an hidden input field as text in the form and give it a default value; http://www.mysite.com/ and post it into the same db table as 'baseurl'.
Then combine the two fields 'baseurl and 'url' by using echo as the img src in the picture gallery page.
If anyone has any ideas, I'd be grateful.
Cheers!