Hi there, newbie to this forum and newbie to PHP (infact I only started "attempting" to use it today)
I have a contact form on https://scm-intranet.tees.ac.uk/users/l1071039/bobbin/order.html
And I have a table set up on MySQL named "orderform"
According to my order.html, the form data should be posted to order.php (code can be seen below)
<?php
$product = $_POST['product'];
$productcomments = $_POST['productcomments'];
$name = $_POST['name'];
$address = $_POST['address'];
$age = $_POST['age'];
$delivery = $_POST['delivery'];
?>
<?php
$host=”mysql.scm.tees.ac.uk”;
$user_name=”l1071039”;
$pwd=”+i^RR9b7”;
$database_name=”l1071039”;
$db=mysql_connect($host, $user_name, $pwd);
if (mysql_error() > “”) print mysql_error() . “<br>”;
mysql_select_db($database_name, $db);
if (mysql_error() > “”) print mysql_error() . “<br>”;
?>
<?php
$query = “insert into orderform (product, productcomments, name, address, age, delivery) values (‘” . $product . “‘, ” . $productcomments . “, ‘” . $name . “‘, ‘” . $address . “. $age . “. $delivery . “‘)”;
$qresult = mysql_query($query);
?>
However when I fill the form in I get a snippet of code? How do I get it so when the submit button is clicked, it returns to the Home Page, and how can I view the data that was inputted?
Many Thanks in advance