Hi everyone.
Can someone please have a look at the following code and tell me what I’m doing wrong?
I have a form on one of my clients websites (a photographer) which allows the client to select the size of prints they require (using 6 radio buttons underneath the corresponding size for each image) and a text box at the end of the row where they can enter the quantity of prints they require.
I am getting the error (in Google Chrome) “The website encountered an error while retrieving http://…/purchase.php. It may be down for maintenance or configured incorrectly”
A shortened version of the PHP code is as follows:
<?php $to = "[email protected]"; $name = $_POST['name']; $address = $_POST['address']; $email = $_POST['email']; $tel = $_POST['tel']; $img1size = $_POST['img1size']; $1qty = $_POST['1qty'];$N = count($addon);
$subject = “Purchase from … Website”;
$body = “Name: $name \n\n Address: $address \n\n Email: $email \n\n
Tel: $tel \n\n Image 1 Size: $img1size \n\n Image 1 Quantity: $1qty \n\n”;
$sent = mail($to, $subject, $body) ;
if($sent)
{echo “”;}
else
{echo “window.location = ‘error.html’;</script”;}
?>
A shortened version of the HTML for this form is:
Name: Address: Email: Tel: Select the images and sizes you wish to purchase from the list below.
8" x 6" 10" x 8" 20" x 16"
Framed 20" x 16"
Canvas 32" +
Framed 32"+
Canvas Quantity
The form works fine when I upload and test the first part of the form (name, address, email and tel) but when I add the code for the radio buttons I get the error message.
Any help would be greatly appreciated.