/    Sign up×
Community /Pin to ProfileBookmark

I urgently need php script for membership forms i have made the form all i need is to process those forms and make them work this way:

When visitor fill it and click submit all information send to my mail address and browser will take him to a thanks.html page.

Please if anyone can provide me with the code or just guide me what should i do further thanks.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@KDLANov 14.2008 — Your "membership form" sounds like a contact form. If so, check out http://green-beast.com/blog/?p=128
Copy linkTweet thisAlerts:
@tariq_wajihaauthorNov 14.2008 — THIS IS THE CODE AND ITS NOT WORKING ITS GIVING ME THIS ERROR PLEASE HELP:

Parse error: syntax error, unexpected $end in F:wampwwwWajihacorrected.php on line 241


















<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />

<title>California Unified Taekwondo Association - Online Club Membership Registration</title>

</head>

<body>

<?php

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

$newmembership = $_
POST['newmembership'];

$renewal = $_POST['renewal'];

$clubname = $_
POST['clubname'];

$mastername = $_POST['mastername'];

$address = $_
POST['address'];

$city = $_POST['city'];

$areacode = $_
POST['areacode'];

$phoneno = $_POST['phoneno'];

$email = $_
POST['email'];

$website = $_POST['website'];

$comments = $_
POST['comments'];

// defining counter variable

$counter = 0;

// assuming clubname and mastername as mandatory fields


if ($newmembership == '') { // checks if the newmembership is empty

echo "<strong style='color:red;'>Please check the newmembership option</strong> <br>";

} else {

// if the newmembership is not empty thn it adds 1 to the counter

$counter++;

}

if ($renewal == '') { // checks if the renewal option is empty

echo "<strong style='color:red;'>Please check the renewal option</strong> <br>";

} else {

// if the renewal option is not empty thn it adds 1 to the counter

$counter++;

}

if ($clubname == '') { // checks if the clubname field is empty

echo "<strong style='color:red;'>Please fill the club name field</strong> <br>";

} else {

// if the clubname field is not empty thn it adds 1 to the counter

$counter ++;

}


if ($mastername == '') { // checks if the mastername field is empty

echo "<strong style='color:red;'>Please fill the master name field</strong> <br>";

} else {

// if the mastername field is not empty thn it adds 1 to the counter

$counter++;

}

if ($address == '') { // checks if the address field is empty

echo "<strong style='color:red;'>Please fill the address field</strong> <br>";

} else {

// if the address field is not empty thn it adds 1 to the counter

$counter++;

}


if ($city == '') { // checks if the city field is empty

echo "<strong style='color:red;'>Please fill the city field</strong> <br>";

} else {

// if the city field is not empty thn it adds 1 to the counter

$counter++;

}

if ($areacode == '') { // checks if the areacode field is empty

echo "<strong style='color:red;'>Please fill the areacode field</strong> <br>";

} else {

// if the areacode field is not empty thn it adds 1 to the counter

$counter++;

}


if ($phoneno == '') { // checks if the phoneno field is empty

echo "<strong style='color:red;'>Please fill the phone number field</strong> <br>";

} else {

// if the phone number field is not empty thn it adds 1 to the counter

$counter++;

}

if ($email == '') { // checks if the email field is empty

echo "<strong style='color:red;'>Please fill the email field</strong> <br>";

} else {

// if the email field is not empty thn it adds 1 to the counter

$counter++;

}


if ($website == '') { // checks if the website field is empty

echo "<strong style='color:red;'>Please fill the website field</strong> <br>";

} else {

// if the website field is not empty thn it adds 1 to the counter

$counter++;

}


if ($comments == '') { // checks if the comments field is empty

echo "<strong style='color:red;'>Please fill the comments field</strong> <br>";

} else {

// if the comments field is not empty thn it adds 1 to the counter

$counter++;

}

// email settings

$subject = "your subject here";

$to = "[email protected]"; // the receiver's email address

$headers = "From: $emailnr"; // sender's email address

$message = "Club Name: " . $clubname . "n"; // n used for line break if its a text email

$message .= "Master Name: " . $mastername . "n"; // --> . <-- used with $message .= just to add the values of the same variables rest of the fields can be added same as this using $message .= "next field: " . $nextfield . "n";


// all four parameters are set for sending email

if ($counter == 11) { // checks if all the mandatory fields are not empty

// if statement returns true execute this code

mail($to, $subject, $message, $headers); // will only work on the webserver with smtp access otherwise just comment it out for testing

?>

<b>Thank you</b>

<?php



?>

<?php if (!isset($_POST['submit']) || $counter < 2) { // checks the two conditions if nothing has been touched thn it just displays the form or if the fields are empty it displays form ?>

<form id="form1" name="form1" method="post" action="<?php echo $_
SERVER['PHP_SELF']; ?>">

<table width="517" border="0">

<input type="hidden" name="posted" value="true" />

<tr>

<td width="511">Club Information </td>

</tr>

<tr>

<td>Memebership is $50 per year - see below for membership eligibility and benefits.<br /></td>

</tr>

<tr>

<td><label>

<input name="newmembership" type="radio" value="<?php echo $newmembership;?>" />

New Membership </label></td>

</tr>

<tr>

<td><label>

<input name="renewal" type="radio" value="<?php echo $renewal;?>" />

Renewal - CUTA Club Number:

<input name="clubno" type="text" id="clubno" size="6" maxlength="3" />

</label></td>

</tr>

<tr>

<td>Club Name:

<label>

<input type="text" name="clubname" value="<?php echo $clubname;?>" />

</label></td>

</tr>

<tr>

<td>Master/Instructor Name:

<label>

<input name="mastername" type="text" id="mastername" value="<?php echo $mastername;?>" />

</label></td>

</tr>

<tr>

<td>Address:

<label>

<input name="address" type="text" id="address" value="<?php echo $address;?>" />

</label></td>

</tr>

<tr>

<td>City, State/Zip:

<label>

<input name="city" type="text" id="city" value="<?php echo $city;?>" />

</label></td>

</tr>

<tr>

<td>Phone: area code(

<label>

<input name="areacode" type="text" id="areacode" value="<?php echo $areacode;?>" />

) number:

<input name="phoneno" type="text" id="phoneno" value="<?php echo $phoneno;?>" />

</label></td>

</tr>

<tr>

<td>Email:

<label>

<input name="email" type="text" id="email" value="<?php echo $email;?>" />

</label></td>

</tr>

<tr>

<td>Website:

<label>

<input name="website" type="text" id="website" value="<?php echo $website;?>" />

</label></td>

</tr>

<tr>

<td>Questions or comments:

<label>

<input name="comments" type="text" id="comments" value="<?php echo $comments;?>" />

</label></td>

</tr>

<tr>

<td><label>

<input name="Reset Form" type="reset" id="Reset Form" value="Reset Form" />

<input type="submit" name="submit" value="Submit" />

</label></td>

</tr>

<tr>

<td height="15"><hr /></td>

<tr>

<td></td>

</tr>

<tr>

<td height="31">The clubs eligible for membership shall:

<ol type="a">

<li>be bona fide clubs, educational institutions or other organizations of a permanent nature which are primarily promoting amateur Taekwondo sports and games; </li>

<li>have a minimum of five (5) registered individual members; </li>

<li>have an instructor who is Kukkiwon certified black belt, age 18 &amp; older; </li>

<li>have established a Taekwondo Dojang or training facility (other than a private home) which is used primarily for the practice of Taekwondo. </li>

</ol>


<tr>

<td height="31">Each qualified club member is entitled to:

<ol type="a">

<li>one (1) voting delegate </li>

<li>to receive an appropriate recognition certificate, plaque or CUTA flag; </li>

<li>registered club will be listed on the CUTA website; </li>

<li>the continued eligibility of each club is conditioned upon continued registration as a member and continued compliance with the Articles of Incorporation and Bylaws of the Corporation. </li>

<li>Membership valid for one year from date of receipt. </li>

</ol>


<tr>

<td height="31">http://www.cutkda.com/membership_individual.html </td>

</tr>

</table>

</form>

<?php // end block of the if statement starts before the form ?>

</body>

</html>
×

Success!

Help @tariq_wajiha spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...