We are new to this, so forgive our newbiness.
We are developing a small database where the client selection generates an information page complete with picture.
We are now trying to upload the picture on the result page. It is not working, and we see the file information but not the picture.
The Add, Edit, and Delete section work for the information side, but no picture!
We appreciate any help you can provide, as we are html based, and have little programming experience.
Below is the script I have been using:
<form enctype="multipart/form-data" method="post" action="<?php echo
$PHP_SELF ?>">
Picture<br>
<input type="File" name="picture" size="25">
<br><br>
<input type="submit" name="submit" value="Upload">
</form>
<?php
if ($submit) {
$db = mysql_connect("$*****","$*****","$*****");
mysql_select_db("$alexander",$db);
$sql = "INSERT INTO boom_lifts (picture_name)".
"VALUES ('$picture_name')";
exec("cp $picture /httpd/realapplications/html/images/$picture_name");
echo "temp file: $picture<br>\n";
echo "file name: $picture_name<br>\n";
echo "file size: $picture_size<br>\n";
echo "file type: $picture_type<br>\n";
echo "<br>\n";
echo "<img src=images/$picture_name><br>\n";
}
?>
Thanks a million! We are pulling our hair out.