Sorry for the ambiguity, i was using code from a website as a template to assist me, the code:
if($_SERVER['REQUEST_METHOD'] != 'POST')
{
//the form hasn't been posted yet, display it
echo '<form method='post' action=''>
Category name: <input type='text' name='cat_name' />
Category description: <textarea name='cat_description' />
<input type='submit' value='Add category' />
</form>';
}
else
{
//the form has been posted, so save it
$sql = ìINSERT INTO categories(cat_name, cat_description)
VALUES('' . mysql_real_escape_string($_POST['cat_name']) . ì', '' . mysql_real_escape_string($_POST['cat_description']) . ì');
needed changed to
if($_SERVER['REQUEST_METHOD'] != 'POST')
{
//the form hasn't been posted yet, display it
echo '<form method=\'post\' action=\'\'/>
Category name: <input type=\'text\' name=\'cat_name\' />
Category description: <textarea name=\'cat_description\' /></textarea>
<input type=\'submit\' value=\'Add category\' />
</form>';
}
else
{
//the form has been posted, so save it
$sql = "INSERT INTO categories(cat_name, cat_description)
VALUES('".mysql_real_escape_string($_POST['cat_name'])."', '". mysql_real_escape_string($_POST['cat_description'])."')";