Hi All,
After spending time searching to forum i still cannot figure this out so I am asking for some help on this one...
I have been successfull at getting the form to populate to the database with text but when i try to get it to upload a picture all i get in the database is text of the absolute path of the file i am trying to upload. I have created the folder and it is uploaded.
Here is the code.. I hoep someone can help me out here......
THANKS!!!!
<?php
include("Connections/curvesConn.php");
if(is_uploaded_file($_FILES[upload][tmp_name]))
{
$dt=date("YmdHis");
$file=$dt.$_FILES[upload][name];
copy($_FILES[upload][tmp_name],"discount/$file");
$sql="INSERT INTO discount (disc_key,http,desc,upload) VALUES ('','$_REQUEST[http]','$_REQUEST[desc]','$file')";
mysql_query($sql);
header("location:curves_discount_club.php");
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head><title>File Upload To Database</title></head>
<body>
<form name="frm" method="post" action="<?php echo $_SERVER[PHP_SELF]; ?> enctype="multipart/form-data">
<input type="hidden" name="disc_key" value="1">
<p class="heading_text"> </p>
<table width="85%" border="0" align="center" cellpadding="5" cellspacing="0">
<tr align="left" valign="middle" class="main_text">
<td width="36%">Website Address: </td>
<td width="64%"><input name="http" type="text" value="<?php echo $_REQUEST[http]; ?>" id="http"></td>
</tr>
<tr align="left" valign="middle" class="main_text">
<td>Description:</td>
<td><input name="desc" type="text" value="<?php echo $_REQUEST[desc]; ?>" id="desc"></td>
</tr>
<tr align="left" valign="middle" class="main_text">
<td>Upload The Image: </td>
<td><input name="upload" type="file" id="upload"></td>
</tr>
<tr align="left" valign="middle" class="main_text">
<td> </td>
<td><input type="submit" name="Submit" value="Submit"></td>
</tr>
</table></form>
</body>
</html>
I get the ' File Not Found
The requested URL was not found on this server.' Error and i get this in the address bar 'http://www.curvesregina.com/add_test.php%20%3E%20%20%20%20%3Cinput%20type='