Hi guys, sorry for being a poo head.
Here is some code I've tried to generate myself
Its meant to take the values from the HTML form and post them to my database.
However, when I click submit the page reloads blank and nothing gets entered into the database table 'news'.
Am I doing something wrong? (clearly)
Here is some code I've tried to generate myself
Code:
<?php
if (!isset($_POST['submit']) || $_SERVER['REQUEST_METHOD'] != "POST")
$p_title = $_POST['title'];
$p_menu_title = $_POST['menutitle'];
$p_summary = $_POST['summary'];
$address = localhost;
$username = "mark1e_bourne";
$password = "******";
$database = "mark1e_bourne";
mysql_connect($address,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "INSERT INTO news VALUES ('$id','$p_title','$p_menu_title','$p_summary')";
mysql_query($query);
mysql_close();
?>
<html>
<head>
<title></title>
</head>
<body>
<form action="" method="POST">
<p><label for="name">Title:</label><input type="text" id="title" name="title" /></p>
<p><label for="menutitle">Menu Title:</label><input type="text" id="menutitle" name="menutitle" /></p>
<p><label for="summary">Summary:</label><input type="text" id="summary" name="summary" /></p>
<p><input type="submit" class="button" name="submit" value="Submit Enquiry" /></p>
</form>
</body>
</html>
Its meant to take the values from the HTML form and post them to my database.
However, when I click submit the page reloads blank and nothing gets entered into the database table 'news'.
Am I doing something wrong? (clearly)