Ok, I’ve tried everything I can think of with this script… Maybe I’ve looked at it to much and have just overlooked it.
I get this:
Parse error: parse error in /webdirectory/admin_add.php on line 30
<html>
<head>
<title>Add Scholarship Entry</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<?php
#This script is to add scholarships into the database.
#admin_add.php
#Address error handling. Tell us if there is an error.
ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);
#Handle the form
if (isset ($_POST['submit'])) { #This checks if submit has been clicked.
#Connect and select the database
if ($dbc = @mysql_connect ('localhost', 'root', '')) {
if (!@mysql_select_db ('scholarships')) {
die ('<p>Could not select the database because: <b>' . mysql_error() . '</b></p>');
}
} else { #Cant connect to MySQL
die ('<p>Could not connect to MySQL because: <b>' . mysql_error() . '</b></p>');
}
#Define the query
$query = "INSERT INTO scholarships (id, title, org, description, type, eligibility, decision, minimum, maximum, deadline, address, phone, site, keywords, date_entered)
VALUES (0, '$_POST[title]', '$_POST[org]', '$_POST[description]', '$_POST[type]', '$_POST[eligibility]', '$_POST[decision]', '$_POST[minimum]', '$_POST[maximum]', '$_POST[deadline]', '$_POST[address]', '$_POST[phone]', '$_POST[site]', '$_POST[keywords]', NOW())";
#Execute the query
if (@mysql_query ($query)) {
echo '<p>The ' . {$_POST['title']} . ' Scholarship has been added to the database</p>';
} else {
print '<p>Could not add the entry because: <b>' . mysql_error() . '</b></p>';
}
mysql_close(); #Close the connection to MySQL
}
#Display the HTML Form Below
?>
<br>
<form name="form1" method="post" action="admin_add.php">
<table width="70%" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="27%">Award Name:</td>
<td width="73%" align="center"> <input name="title" type="text" id="title" size="50" maxlength="100"></td>
</tr>
<tr>
<td>Organization:</td>
<td align="center"><input name="org" type="text" id="org" size="50" maxlength="100"></td>
</tr>
<tr>
<td>Description:</td>
<td align="center"><textarea name="description" cols="50" rows="6" id="description"></textarea></td>
</tr>
<tr>
<td>Type:</td>
<td align="center"><input name="type" type="text" id="type" size="50" maxlength="100"></td>
</tr>
<tr>
<td>Eligibility:</td>
<td align="center"><textarea name="eligibility" cols="50" rows="6" id="eligibility"></textarea></td>
</tr>
<tr>
<td>Decision:</td>
<td align="center"><input name="decision" type="text" id="decision" size="50" maxlength="200"></td>
</tr>
<tr>
<td>Minimum:</td>
<td align="center"><input name="minimum" type="text" id="minimum" size="50" maxlength="30"></td>
</tr>
<tr>
<td>Maximim:</td>
<td align="center"><input name="maximum" type="text" id="maximum" size="50" maxlength="30"></td>
</tr>
<tr>
<td>Deadline:</td>
<td align="center"><input name="deadline" type="text" id="deadline" size="50" maxlength="50"></td>
</tr>
<tr>
<td>Address:</td>
<td align="center"><input name="address" type="text" id="address" size="50" maxlength="150"></td>
</tr>
<tr>
<td>Phone:</td>
<td align="center"><input name="phone" type="text" id="phone" size="50" maxlength="12"></td>
</tr>
<tr>
<td>Web Site:</td>
<td align="center"><input name="site" type="text" id="site" size="50" maxlength="100"></td>
</tr>
<tr>
<td>Keywords:</td>
<td align="center"><input name="keywords" type="text" id="keywords" size="50" maxlength="100"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="submit" value="Add Scholarship">
</div></td>
</tr>
</table>
</form>
</body>
</html>
Thanks in advance!