ok both of these files work independantly
and fyi it still adds to the database and even adds the filename
but i cant get the upload to work in this script
the upload does work independantly in a seperate file
can anybody tell me whats going wrong
it will not upload when its setup like this
Code:
<?if(isset( $Submit ))
{
//If the Submitbutton was pressed do:
copy ($FILES['imagefile']['tmp_name'], "files/".$FILES['imagefile']['name'])
or die ("Could not copy");
echo "";
echo "Name: ".$FILES['imagefile']['name']."";
echo "Size: ".$FILES['imagefile']['size']."";
echo "Type: ".$_FILES['imagefile']['type']."";
echo "Copy Done....";
echo"<br>$imagefile_name";
echo "<img src='/files/$imagefile_name'> ";
}
else {
echo "";
echo "Could Not Copy, Wrong Filetype (".$_FILES['imagefile']['name'].")";
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Add art</TITLE>
</HEAD>
<BODY bgcolor="#333333" text="#000000" link="#00FF33" vlink="#006633" alink="#003300">
<h1>Adding ART</h1>
<?
$path=$imagefile_name;
$date=date(Ymd);
$connection = mysql_connect("localhost","evoltesting","removed")
or die ("Couldn't connect to server.");
$db = mysql_select_db("evoltesting", $connection)
or die("Couldn't select database.");
$sql = "INSERT INTO hcob_art (poster,path,date)
VALUES ('$poster','$imagefile_name','$date')";
$sql_result = mysql_query($sql,$connection)
or die("Couldn't add record.");
if (!$sql_result) {
echo "<P>Couldn't add record!";
} else {
echo "
<P>Record added!</p>
<table cellspacing=5 cellpadding=5>
<tr>
<td valign=top><strong>Artist:</strong></td>
<td valign=top>$poster</td>
</tr>
<tr>
<td valign=top><strong>image:</strong></td>
<td valign=top><img src='/files/$path'></td>
</tr>
<tr>
<td valign=top><strong>Date:</strong></td>
<td valign=top>$date</td>
</tr>
</table>
";
}
?>
</BODY>
</HTML>
ive tried everything i can think of