Jump to content
Killersites Forums

I need help with forms, passing variables


bossco
 Share

Recommended Posts

What I have done so far is. I made a form that ask the user some questions. By the way this is my first php, sorry if my questions or terms are alittle off.

 




                  Age 

Male     Female

Full name 
      Street address 
 (including apartment number)
                City 
   State or Province 
  ZIP or Postal code 
             Country 

Daytime telephone no. 

 US Customers: please use the format (###-###-####)
Intl customers: please use the format (+####-####-####)

E-mail Address 

 

Then I made a processing form that shows the users information back to them

 



<?php 
$name = $_POST['name'];
$age = $_POST['age'];
$gender = $_POST['gender'];
$account = $_POST['account'];
$expdate = $_POST['exdate'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$country = $_POST['country'];
$telephone = $_POST['telephone'];


print "Full Name: {$name}
";
print "Age: {$age}
";
print "Address: {$address}
";
print "City: {$city}
";
print "State: {$state}
";
print "Zip: {$zip}
";
print "Country: {$country}
";
print "Telephone: {$telephone}
";

?>



     VALUE="BACK" 
   OnClick="history.go( -1 );return true;">


 

 

Then from the processing to a semi checkout page. Where it gives a generic Thank You and then emails the results of the users information


<?php 

$name = $_POST['$name'];
$age = $_POST['age'];
$gender = $_POST['gender'];
$account = $_POST['account'];
$expdate = $_POST['exdate'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$country = $_POST['country'];
$telephone = $_POST['telephone'];


$email_message = "Full name $name
                                              age  $age
                                            Gender: $gender
                                            CC:  $account
                                            exdate: $exdate
                                            Adress: $address
                                            City: $city
                                            State: $state
                                            Zip Code: $zip
                                            Country: $country
                                            Telephone: $telephone



mail('myemail@email.com','User input!',$email_message);

?>

 

So my question is how do I go about doing it. I have tried stuff, that I thought would work with no success. I'm not sure how to grab the variables from the previous page or should I grab them from the form page. That is how it is setup, but I know I didn't do something right. I have tried to grab the variables from the process page, and I receive nothing in my email, but a blank page

 

I have been digging through the internet and coming up with nothing that I'm trying to do

 

Or is there a way to stop the email from being sent when the pages comes up. Pretty much give the user some time to go back and correct any errors. The when correction are made it will work via submit or other means

 

Thanks for your time in advance

Edited by bossco
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...