ok so the form i created has a few little things and then a file upload. what i need it to do is take the feilds and insert them into the database, except the upload feild. that just needs to be uploaded to the server then the PATH be stored in the database. im having 2 problems. 1 im getting this error
Parse error: parse error, unexpected T_VARIABLE in /home/virtual/site11/fst/var/www/html/insert.php on line 17
and 2 the form wont upload pdf files when it does work. which is the whole point of this upload. is there something i need to add to make pdfs upload?
form.php
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form action="insert.php" method="post" name="form" id="form">
<p>
<input name="alertID" type="hidden" id="alertID">
<br>
Alert Category:<br>
<select name="alertCat" id="alertCat">
<option value="TradeAlert">Trade Alert</option>
<option value="BiWeekly">Bi-Weekly</option>
<option value="ChemPharm">Chem & Pharm</option>
<option value="FDA">FDA</option>
</select>
<br>
Breif Summary:<br>
<textarea name="alert" cols="60" rows="10" id="alert"></textarea>
<br>
Date:
<input name="alertDate" type="text" id="alertDate">
(ex: DD/MM/YYYY)
<input name="MAX_FILE_SIZE" type="hidden" id="MAX_FILE_SIZE" value="100000">
<br>
<input name="filename" type="file" id="filename" size="60">
<br>
<input name="add" type="submit" id="add" value="Submit">
</p>
</form>
</body>
</html>
insert.php
<?php
if(isset($_POST['add']))
{
include 'library/config.php';
include 'library/opendb.php';
$alertID = $_POST['alerID'];
$alertCat = $_POST['alertCat'];
$alert = $_POST['alert'];
$alertDate = $_POST['alertDate'];
$uploaddir = '/home/virtual/site11/fst/var/www/html/uploads/';
$uploadfile = $uploaddir . basename($_FILES['userfile']['name']);
move_uploaded_file($_FILES['userfile']['tmp_name'], $uploadfile)
$alertPdf = $uploadfile
$query = "INSERT INTO alerts (alertID, alertCat, alert, alertDate, alertPdf) VALUES ('$alertID', '$alertCat', '$alert', '$alertDate', '$alertPdf')";
mysql_query($query) or die('Error, insert query failed');
$query = "FLUSH PRIVILEGES";
mysql_query($query) or die('Error, insert query failed');
include 'library/closedb.php';
echo "New Alert added";
}
?>
thanks in advance