Email/Registration Form - Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more
Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Webmaster Tech > Programming > PHP Development

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 05-02-2011, 01:02 PM   #1 (permalink)
Junior Member
 
Join Date: May 2011
Posts: 2
Default Email/Registration Form

Hi, I need to create a form that emails a list of information, and then when submitted, will redirect to the payment page. This is for a conference, and this information is needed prior to receiving the pay. This is where I am at right now:

<form method="post" action="registration-form.php">
<p>First Name:<br /><input name="firstname" type="text"><br /></p>
<p>Last Name:<br /><input name="lastname" type="text"><br /></p>
<p>T-Shirt Size:<br /><input type="radio" name="tshirt" value="Small"> S <input type="radio" name="tshirt" value="Medium"> M <input type="radio" name="tshirt" value="Large"> L <input type="radio" name="tshirt" value="Extra Large"> XL<br /></p>
<p>Mailing Address:<br /><input name="mailing" type="text"><br /></p>
<p>Postal Code:<br /><input name="postalcode" type="text"><br /></p>
<p>City:<br /><input name="city" type="text"><br /></p>
<p>School:<br /><input name="school" type="text"><br /></p>
<p>Phone Number:<br /><input name="phone" type="text"><br /></p>
<p>Email Address:<br /><input name="email" type="text"><br /></p>
Additional information or requests: <br /><textarea name="request" rows="3" cols="40"></textarea><br />
<input type="submit" value="Continue to Payment">
</form>

And the .php:

<?
ob_start();

// do stuff here
$url = 'URL GOES HERE';
// clear out the output buffer
while (ob_get_status())
{
ob_end_clean();
}

// no redirect
header( "Location: $url" );
?>

<?php
$to = "mikemueller2112@gmail.com";
$subject = "Registration Information";
$email = $_REQUEST['email'] ;
$firstname = $_REQUEST['firstname'] ;
$lastname = $_REQUEST['lastname'] ;
$tshirt = $_REQUEST['tshirt'];
$mailing = $_REQUEST['mailing'];
$postalcode = $_REQUEST['postalcode'];
$city = $_REQUEST['city'];
$school = $_REQUEST['school'];
$phone = $_REQUEST['phone'];
$message = $_REQUEST['message'];
$headers =
"First Name: $firstname
Last Name: $lastname
T-Shirt Size: $tshirt
Mailing Address: $mailing
Postal Code: $postalcode
City: $city
School: $school
Phone Number: $phone
Email Address: $email
Additional Information and/or Requests:";
$sent = mail($to, $subject, $message, $headers) ;
if($sent) {print "Your mail was sent successfully"; }
else {print "We encountered an error sending your mail"; }
?>



Now, what I need to do is, make sure all the information, except the last box, is filled out, before redirecting to the last page. And is it possible for php to refresh the page with new text printed by the form, or can it only print a new message like the above?

Please tell me what is wrong with the above code, I'm very limited with .php, and the first bit of code was how I could redirect it, but it will do it everytime I press the submit button on the form; I don't want this if the form is missing information.

Thanks in advance!
muellator is offline   Reply With Quote
Sponsored Links
Old 05-03-2011, 08:20 AM   #2 (permalink)
Regular User
 
Join Date: Apr 2011
Posts: 115
Default Re: Email/Registration Form

Please be more clear, what exactly are u looking for?
chunnilal is offline   Reply With Quote
Old 05-03-2011, 08:23 AM   #3 (permalink)
Regular User
 
Join Date: Apr 2011
Posts: 115
Default Re: Email/Registration Form

I got that, why dont you call the same page in action instead of going to registration-form.php.

Process the form before the HTML content with isset(POST)
Whatever the response is shall be printed on the same page, where the form is
chunnilal is offline   Reply With Quote
Old 05-04-2011, 05:53 PM   #4 (permalink)
Junior Member
 
Join Date: May 2011
Posts: 2
Default Re: Email/Registration Form

Quote:
Originally Posted by chunnilal View Post
I got that, why dont you call the same page in action instead of going to registration-form.php.

Process the form before the HTML content with isset(POST)
Whatever the response is shall be printed on the same page, where the form is
Alright, and do I put the php code in the head or the body?
muellator is offline   Reply With Quote
Old 05-05-2011, 01:46 PM   #5 (permalink)
Regular User
 
Join Date: Apr 2011
Posts: 115
Default Re: Email/Registration Form

It should be above the head.
even before starting the html tgs
chunnilal is offline   Reply With Quote
Old 05-05-2011, 01:47 PM   #6 (permalink)
Regular User
 
Join Date: Apr 2011
Posts: 115
Default Re: Email/Registration Form

It should be above the head.
even before starting the html tgs
chunnilal is offline   Reply With Quote
Old 05-12-2011, 01:12 PM   #7 (permalink)
Junior Member
 
jennyvoip's Avatar
 
Join Date: May 2011
Posts: 19
Default Re: Email/Registration Form

The best website for virtual phone numbers and call forwarding is virtualphone123.info.
Hope this will help you.
jennyvoip is offline   Reply With Quote
Old 05-18-2011, 05:26 AM   #8 (permalink)
Member
 
Join Date: Apr 2011
Posts: 136
Default Re: Email/Registration Form

I like this concept. Keep posting as I am gonna come to read it everyday!!

Euflexxa | Buy Xenical Online | Restylane
sweetsianjali is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Sponsors

» Links

» Affiliates
Web Hosting
Online Backup Reviews
Marketing Find
Merchant Select
SiteMap Builder
Host Compare

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 04:43 PM.


Powered by vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.2
Webmaster Forums
Web Hosting | Chicago Web Hosting | Web Hosting