Page 1 of 1

form HUGE problem....

Posted: Wed Sep 29, 2010 11:09 pm
by rophillips77
Hello All,
I am very new to php, and have a problem with a web form that i did...
I am testing it, and when i fill out the form, all the questions except for the first 3 appears on the email that i receive..
here is my code.. any help will be truly appreciated... i am going crazy with this already.

Code: Select all

$to = 'heaven@cloudnine-cupcakes.com';


//User info (DO NOT EDIT!)
$name = stripslashes($_POST['name']); //sender's email
$address = stripslashes($_POST['address']); //sender's email
$state = stripslashes($_POST['state']); //sender's email
$city = stripslashes($_POST['city']); //sender's email
$zip = stripslashes($_POST['zip']); //sender's email
$phone = stripslashes($_POST['phone']); //sender's email
$email = stripslashes($_POST['email']); //sender's email
$city = stripslashes($_POST['city']); //sender's email
$event = stripslashes($_POST['event']); //sender's email
$date = stripslashes($_POST['date']); //sender's website
$number = stripslashes($_POST['number']); //sender's website

//The subject
$subject  = "contact form "; //The default subject. Will appear by default in all messages. Change this if you want.
$subject .= stripslashes($_POST['subject']); // the subject


//The message you will receive in your mailbox
//Each parts are commented to help you understand what it does exaclty.
//YOU DON'T NEED TO EDIT IT BELOW BUT IF YOU DO, DO IT WITH CAUTION!
$msg  = "Name : $name \r\n";  //add sender's name to the message
$msg  = "Address : $address \r\n";  //add sender's name to the message
$msg  = "City : $city \r\n";  //add sender's name to the message
$msg  = "State : $state \r\n";  //add sender's name to the message
$msg .= "Zip : $zip \r\n";  //add sender's email to the message
$msg .= "Phone : $phone \r\n"; //add sender's website to the message
$msg .= "Email : $email \r\n"; //add sender's website to the message

$msg .= "Date of Event : $date \r\n"; //add sender's website to the message
$msg .= "Number of People : $number \r\n"; //add sender's website to the message


//Extras: User info (Optional!)
//Delete this part if you don't need it
//Display user information such as Ip address and browsers information...
$msg .= "---User information--- \r\n"; //Title
$msg .= "User IP : ".$_SERVER["REMOTE_ADDR"]."\r\n"; //Sender's IP
$msg .= "Browser info : ".$_SERVER["HTTP_USER_AGENT"]."\r\n"; //User agent
$msg .= "User come from : ".$_SERVER["HTTP_REFERER"]; //Referrer
// END Extras

?>

then in the body i have:

Code: Select all

<?php
   if ($_SERVER['REQUEST_METHOD'] != 'POST'){
      $self = $_SERVER['PHP_SELF'];
?>

    <!-- Start HTML form -->
   	<form name="form" method="post"  action="<?php echo $self;?>">
   <fieldset>
<strong>
<label for="name" class="label">Name</label></strong><input type="text" in put id="name" name="name" size="50"/></fieldset>
<fieldset>
<strong>
<label for="address" class="label">Address</label></strong><input type="text" in put id="address" name="address" size="50"/></fieldset>
<fieldset>
<strong>
<label for="city" class="label">City</label></strong><input type="text" in put id="city" name="city" size="20"/></fieldset>
<fieldset>
<strong>
<label for="state" class="label">State</label></strong><input type="text" in put id="state" name="state" size="4"/></fieldset>

<fieldset>
<strong><label for="zip" class="label">ZIP</label></strong><input type="text" in put id="zip" name="zip" size="4"/>
                </fieldset>
                <fieldset>
	          <label for="phone" class="label">Phone</label>
                <input type="text" id="phone" name="phone" size="20" input/>
                </fieldset>
                
                
                
                
                
                <fieldset>
	          <label for="email" class="label">Email</label>
                <input type="text" id="email" name="email" size="50" input/>
                </fieldset>
                
                <fieldset>
	          <label for="date" class="label">Event's Date</label>
                <input type="text" input id="date" name="date"/>
                </fieldset>
               <fieldset>
	          <label for="number" class="label">Number of People</label>
                <input type="text" id="number" name="number" size="4" input/>
      </fieldset>
     
				
				<div class="button">
				  <input type="submit" value="Send" />
				</div>
			
  </form>


thank yoU!!!!!!!!!!!!!!!!!!!

Re: form HUGE problem....

Posted: Wed Sep 29, 2010 11:51 pm
by requinix

Code: Select all

$msg  = "Name : $name \r\n";  //add sender's name to the message
$msg  = "Address : $address \r\n";  //add sender's name to the message
$msg  = "City : $city \r\n";  //add sender's name to the message
$msg  = "State : $state \r\n";  //add sender's name to the message
$msg .= "Zip : $zip \r\n";  //add sender's email to the message
Compare the first four lines with the fifth.

Spoiler: only the first and fifth lines are correct. The second through fourth need a slight change.

Re: form HUGE problem....

Posted: Thu Sep 30, 2010 9:13 pm
by rophillips77
i cant see a difference in these...! i think im so sick in looking at it already, i cant do it anymore... please help~! thanks!!!!!!!

Re: form HUGE problem....

Posted: Thu Sep 30, 2010 9:49 pm
by requinix
Then take a break. Play some games. Go out and watch a movie. Eat a sandwich. Come back to the code when you're ready.

Lemme narrow it down. Could also be that the highlighter makes it hard to read, I understand that one.

Code: Select all

$msg  =
$msg  =
$msg  =
$msg  =
$msg .=

Re: form HUGE problem....

Posted: Fri Oct 01, 2010 8:29 am
by rophillips77
LITTLE DOT!!!!!!!!!!!!!!!!! :) u are the best.. thanks!!!!! this takes a BUNCH OF my shoulder!!!
thanks again! :D