Ok, I have a form on my Mambo site that has name, size etc and uploads a pic. I get all the text stuff fine. I also get the pic fine. The pic is uploaded to path/to/file on server. But when I try my DisplayDB.php I can't get the pic to show. I know I need to save the path to the DB and then use it later to show the pic... But the path isn't showing up...
My form runs something like this:
<input type=FILE name="photo" size=20>
<input type="HIDDEN" name="
uploadfile" VALUE="uploadfile">
My form handler is something like this:
$uploaddir = '/path/to/file/';
$uploadfile = $uploaddir . basename($_FILES['photo']['name']);
if (move_uploaded_file($_FILES['photo']['tmp_name'],
$uploadfile)) {
echo "File was successfully uploaded.\n";
} else {
echo "Picture upload failed.\n";
}
//...
$Link = mysql_connect ($Host, $User, $Password);
$Query = "INSERT into $TableName values ('0', '$name', '
$uploadfile', '$weight', '$area', '$lure_bait', '$date', '$time_of_day', '$weather', '$type_of_fishing', '$comments')";
// This bit is not working...
My DisplayDB.php runs like this:
while ($Row = mysql_fetch_array ($Result)) {
echo ("<TR ALIGN=CENTER VALIGN=TOP>\n");
echo ("<TD ALIGN=LEFT VALIGN=TOP bgcolor=\"#FFFFFF\">$Row[name]</TD>\n");
echo ("<TD ALIGN=LEFT VALIGN=TOP bgcolor=\"#FFFFFF\"><img src=\"
$Row[uploadfile]\" width=\"100\" height=\"120\"></TD>\n");
I don't know what's wrong... Since I'm a bit of a noob I barely know what's
right! I know this isn't really a Mambo question... but I do have a Mambo site, it's still very new,
http://bigfloridafish.com. Here is the actual form:
http://bigfloridafish.com/_TESTING/S...bmit_form.html
Thanks in advance...