sneakyimp;10960733 wrote:What is "not working" ?
Sorry I'm trying to get the hang of this post. I receive a script generated error message:
'Please click "back" and try again.'
And the form information isn't submitted, this is the part of the script that creates this:
if ($sh_name && $sh_add1 && $sh_add2 && $sh_town && $sh_county && $sh_phone && $sh_email && $sh_web && $sh_pcode) { // If everything's OK.
// Add the retailer to the database.
$query = "INSERT INTO retailers (ret_name, ret_add1, ret_add2, ret_town, ret_county, ret_pcode, ret_phone, ret_email, ret_web, ret_dateEntered) VALUES ('$sh_name', '$sh_add1', '$sh_add2', '$sh_town', '$sh_county', '$sh_pcode', '$sh_phone', '$sh_email', '$sh_web', NOW() )";
if ($result = mysql_query ($query)) { // Worked.
echo "<h3>Thank you for using this system, the Shop has been added.</h3><p>You have added:</p><strong>$sh_name<br /> Address:</strong><br />$sh_add1<br />$sh_add2<br>$sh_town<br />$sh_county<br />$sh_pcode<p>Telephone:<br />$sh_phone</p><p>Email:<br />$sh_email</p><p>Website:<br />$sh_web</p></p><a href='addRetailer.php'>Add Another shop</a>";
include ('./includes/footer.html'); // Include the HTML footer.
exit();
} else { // If the query did not run OK.
echo '<p><font color="red">Your submission could not be processed due to a system error.</font></p>';
}
} else { // Failed a test.
echo '<p><font color="red">Please click "back" and try again.</font></p>';
}
} else { // Display the form.
}
?>
I have tried the following peices of code resulting in the same error message:
//Check for the second line of the address
if (!empty($POST['sh_add2'])) {
$sh_add2 = escape_data($POST['sh_add2']);
} else {
$sh_add2 = '';
}
I've also tried:
//Check for the second line of the address
if (!empty($POST['sh_add2'])) {
$sh_add2 = escape_data($POST['sh_add2']);
} else {
$sh_add2 = NULL;
}
The corresponding database fields are set to NULL
Thanks for your response