Possible If Statement?

Hi all,

I currently have a php form set up as follows:

[php]<?php
$to = "[email protected]" ;
$from = $_REQUEST[‘email’] ;
$name = $_REQUEST[‘name’] ;
$headers = “From: $from”;
$subject = “Web Contact Query”;

$fields = array();
$fields{“name”} = “Name”;
$fields{“email”} = “Email”;
$fields{“telephone”} = “Telephone Number”;
$fields{“services”} = “Service One”;
$fields{“services2”} = “Service Two”;
$fields{“comments”} = “Comments”;

$body = “We have received the following information:\n\n”; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }

$headers2 = “From: [email protected]”;
$subject2 = “Thank you for contacting the Good Food Club”;
$autoreply = “Thank you for contacting us. Somebody will get back to you as quickly as possible, usually within 48 hours. For further details consult our website at http://www.goodfood-club.co.uk”;

if($from == ‘’) {print “You have not entered an email, please go back and try again”;}
else {
if($name == ‘’) {print “You have not entered a name, please go back and try again”;}
else {
$send = mail($to, $subject, $body, $headers);
$send2 = mail($from, $subject2, $autoreply, $headers2);
if($send)
{header( “Location: http://www.goodfood-club.co.uk/thankyou.html” );}
else
{print “We encountered an error sending your mail, please notify [email protected]”; }
}
}
?> [/php]

It works in conjunction with the following web page:

http://goodfood-club.co.uk/contact.html

I have been asked to have the ability to select from selection one, which would then automatically change the choices for selection two.

So as an example the first selection would be “Pies” which would enable me to then choose from a list of pie types.

I’ve not really done php but I do understand basic coding, so any help or pointers are greatly appreciated as I would like to become more proficient with PHP. :slight_smile:

Regards

K

Sponsor our Newsletter | Privacy Policy | Terms of Service