View Single Post
  #9 (permalink)  
Old 09-10-10, 12:28 PM
photoworks photoworks is offline
Newbie Coder
 
Join Date: Sep 2010
Location: Greenock
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Golith View Post
i would be doing this inside the html first


PHP Code:





$to 
$_REQUEST['sendto'] ;
$from $_REQUEST['Email'] ;
$name $_REQUEST['Name'] ;
$list $_REQUEST['list'];
$headers "From: $from";
$subject "inquiry Email";

$fields = array();
$fields{"Name"} = "Name";
$fields{"Company"} = "Company";
$fields{"Email"} = "Email";
$fields{"Phone"} = "Phone";
$fields{"list"} = "Where did you hear about me ";
$fields{"Specify"} = "Specify";
$fields{"Message"} = "Message"

$body "We have received the following information:\n\n"

foreach(
$fields as $a => $b){ 
     
$body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); 


$headers2 "From: info@pwks.net"
$subject2 "Thank you for contacting me"
$autoreply "Thank you for contacting me. I will get back to you as soon as possible. Please do not reply to this message"

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";} 
if(
$list == '') {print "You have not selected an option for 'where did you hear about me', please go back and try again";} 
else 
Where exactly do i put that piece of code in the html page :

Quote:
<?PHP
// make sure that all values are set to unchecked in case the page has been refreshed
$Search engine_status = 'unchecked';
$Advertising = 'unchecked';
$referral_status = 'unchecked';
$Facebook = 'unchecked';
$Other = 'unchecked';

if (isset($_POST['Submit1'])) {

$selected_radio = $_POST['list'];

if ($selected_radio == 'Search engine') {
$searchengine= 'checked';
}else if ($selected_radio == 'Advertising') {
$adveretising= 'checked';
}else if ($selected_radio == 'referral') {
$adveretising= 'checked';
}else if ($selected_radio == 'Facebook') {
$adveretising= 'checked';
}else if ($selected_radio == 'Other') {
$adveretising= 'checked';
}
}
?>

// To get the value of a radio button with PHP code, again you access the NAME attribute of the HTML form elements
so add name='submit1' to the <form>
Reply With Quote