1 Replies - 601 Views - Last Post: 18 February 2009 - 08:45 AM Rate Topic: -----

#1 Locks  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 24-May 02

How to show auto generated confirmation number and some data from form

Posted 18 February 2009 - 08:35 AM

I created a php form to capture some user data which will be sent to me via email. How can I have an auto generated confirmation number (possibly using some numbers from the phone number, zip code and an increment) and show this plus some select data from the form on the confirmation page, plus send a confirmation email to the sender? The form code is below: [code]<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>book </title>
<meta http-equiv="content-type" content="text/html; charset=UTF-8"><link href="style.css" rel="stylesheet" type="text/css">
<!-- calendar stuff -->
<link rel="stylesheet" type="text/css" href="calendar/calendar-blue2.css" />
<script type="text/javascript" src="calendar/calendar.js"></script>
<script type="text/javascript" src="calendar/calendar-en.js"></script>
<script type="text/javascript" src="calendar/calendar-setup.js"></script>
<!-- END calendar stuff -->

<!-- expand/collapse function -->
<script type=text/javascript>
<!--
function collapseElem(obj)
{
var el = document.getElementById(obj);
el.style.display = 'none';
}


function expandElem(obj)
{
var el = document.getElementById(obj);
el.style.display = '';
}


//-->
</SCRIPT>
<!-- expand/collapse function -->


<!-- expand/collapse function -->
<script type=text/javascript>
<!--

// collapse all elements, except the first one
function collapseAll()
{
var numFormPages = 2;

for(i=2; i <= numFormPages; i++)
{
currPageId = ('mainForm_' + i);
collapseElem(currPageId);
}
}


//-->
</SCRIPT>
<!-- expand/collapse function -->


<!-- validate -->
<script type=text/javascript>
<!--
function validateField(fieldId, fieldBoxId, fieldType, required)
{
fieldBox = document.getElementById(fieldBoxId);
fieldObj = document.getElementById(fieldId);

if(fieldType == 'text' || fieldType == 'textarea' || fieldType == 'password' || fieldType == 'file' || fieldType == 'phone' || fieldType == 'website')
{
if(required == 1 && fieldObj.value == '')
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}

}


else if(fieldType == 'menu' || fieldType == 'country' || fieldType == 'state')
{
if(required == 1 && fieldObj.selectedIndex == 0)
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}

}


else if(fieldType == 'email')
{
if((required == 1 && fieldObj.value=='') || (fieldObj.value!='' && !validate_email(fieldObj.value)))
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}

}



}

function validate_email(emailStr)
{
apos=emailStr.indexOf("@");
dotpos=emailStr.lastIndexOf(".");

if (apos<1||dotpos-apos<2)
{
return false;
}
else
{
return true;
}
}


function validateDate(fieldId, fieldBoxId, fieldType, required, minDateStr, maxDateStr)
{
retValue = true;

fieldBox = document.getElementById(fieldBoxId);
fieldObj = document.getElementById(fieldId);
dateStr = fieldObj.value;


if(required == 0 && dateStr == '')
{
return true;
}


if(dateStr.charAt(2) != '/' || dateStr.charAt(5) != '/' || dateStr.length != 10)
{
retValue = false;
}

else // format's okay; check max, min
{
currDays = parseInt(dateStr.substr(0,2),10) + parseInt(dateStr.substr(3,2),10)*30 + parseInt(dateStr.substr(6,4),10)*365;
//alert(currDays);

if(maxDateStr != '')
{
maxDays = parseInt(maxDateStr.substr(0,2),10) + parseInt(maxDateStr.substr(3,2),10)*30 + parseInt(maxDateStr.substr(6,4),10)*365;
//alert(maxDays);
if(currDays > maxDays)
retValue = false;
}

if(minDateStr != '')
{
minDays = parseInt(minDateStr.substr(0,2),10) + parseInt(minDateStr.substr(3,2),10)*30 + parseInt(minDateStr.substr(6,4),10)*365;
//alert(minDays);
if(currDays < minDays)
retValue = false;
}
}

if(retValue == false)
{
fieldObj.setAttribute("class","mainFormError");
fieldObj.setAttribute("className","mainFormError");
fieldObj.focus();
return false;
}
}
//-->
</SCRIPT>
<!-- end validate -->




</head>

<body onload="collapseAll()">

<div id="mainForm">




<div id="formHeader">
<p class="formInfo">GROUP TRAVEL BOOKING</p>
</div>


<BR/><!-- begin form -->
<form method=post enctype=multipart/form-data action=processor.php onsubmit="return validatePage2();"><ul class=mainForm id="mainForm_1"><input type=hidden name=field_1 id=field_1 value="Cruise Booking"><input type=hidden name=field_2 id=field_2 value="Double Occupancy">

<li class="mainForm" id="fieldBox_3">
<label class="formFieldQuestion">Passenger Name:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Name must match legal documentation (Passport, Drivers License, Birth Certificate, etc.) you will provide before boarding. You will not be allowed to board unless your name matches exactly. For example, if Robert Smith is on your Passport, do not enter Bob Smith.</span></a></label><input class=mainForm type=text name=field_3 id=field_3 size='60' value=''></li>

<li class="mainForm" id="fieldBox_4">
<label class="formFieldQuestion">Address:*</label><input class=mainForm type=text name=field_4 id=field_4 size='60' value=''></li>

<li class="mainForm" id="fieldBox_5">
<label class="formFieldQuestion">Address 2:<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Enter Apt number, etc.</span></a></label><input class=mainForm type=text name=field_5 id=field_5 size='60' value=''></li>

<li class="mainForm" id="fieldBox_6">
<label class="formFieldQuestion">City:*</label><input class=mainForm type=text name=field_6 id=field_6 size='60' value=''></li>

<li class="mainForm" id="fieldBox_7">
<label class="formFieldQuestion">State:*</label><select class=mainForm name=field_7 id=field_7><option value=''> </option><option value="Alabama">Alabama</option><option value="Alaska">Alaska</option><option value="Arizona">Arizona</option><option value="Arkansas">Arkansas</option><option value="California">California</option><option value="Colorado">Colorado</option><option value="Connecticut">Connecticut</option><option value="Delaware">Delaware</option><option value="Florida">Florida</option><option value="Georgia">Georgia</option><option value="Hawaii">Hawaii</option><option value="Idaho">Idaho</option><option value="Illinois">Illinois</option><option value="Indiana">Indiana</option><option value="Iowa">Iowa</option><option value="Kansas">Kansas</option><option value="Kentucky">Kentucky</option><option value="Louisiana">Louisiana</option><option value="Maine">Maine</option><option value="Maryland">Maryland</option><option value="Massachusetts">Massachusetts</option><option value="Michigan">Michigan</option><option value="Minnesota">Minnesota</option><option value="Mississippi">Mississippi</option><option value="Missouri">Missouri</option><option value="Montana">Montana</option><option value="Nebraska">Nebraska</option><option value="Nevada">Nevada</option><option value="New Hampshire">New Hampshire</option><option value="New Jersey">New Jersey</option><option value="New Mexico">New Mexico</option><option value="New York">New York</option><option value="North Carolina">North Carolina</option><option value="North Dakota">North Dakota</option><option value="Ohio">Ohio</option><option value="Oklahoma">Oklahoma</option><option value="Oregon">Oregon</option><option value="Pennsylvania">Pennsylvania</option><option value="Rhode Island">Rhode Island</option><option value="South Carolina">South Carolina</option><option value="South Dakota">South Dakota</option><option value="Tennessee">Tennessee</option><option value="Texas">Texas</option><option value="Utah">Utah</option><option value="Vermont">Vermont</option><option value="Virginia">Virginia</option><option value="Washington">Washington</option><option value="West Virginia">West Virginia</option><option value="Wisconsin">Wisconsin</option><option value="Wyoming">Wyoming</option></SELECT></li>

<li class="mainForm" id="fieldBox_8">
<label class="formFieldQuestion">Zip Code:*</label><input class=mainForm type=text name=field_8 id=field_8 size='10' value=''></li>

<li class="mainForm" id="fieldBox_9">
<label class="formFieldQuestion">Phone Number:*</label><input class=mainForm type=phone name=field_9 id=field_9 size=20 value="" style="background-image:url(imgs/phone.png); background-repeat: no-repeat; padding: 2px 2px 2px 25px;"></li>

<li class="mainForm" id="fieldBox_10">
<label class="formFieldQuestion">Emergency Contact:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>You must enter an emergency contact number.</span></a></label><input class=mainForm type=phone name=field_10 id=field_10 size=20 value="" style="background-image:url(imgs/phone.png); background-repeat: no-repeat; padding: 2px 2px 2px 25px;"></li>

<li class="mainForm" id="fieldBox_11">
<label class="formFieldQuestion">Email Address:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Enter valid email address. Confirmation will be sent via the email address submitted here.</span></a></label><input class=mainForm type=email name=field_11 id=field_11 size=20 value="" style="background-image:url(imgs/email.png); background-repeat: no-repeat; padding: 2px 2px 2px 25px;"></li>

<li class="mainForm" id="fieldBox_12">
<label class="formFieldQuestion">Dinner Seating:*</label><span><input class=mainForm type=radio name=field_12 id=field_12_option_1 value="Early" /><label class=formFieldOption for="field_12_option_1">Early</label><input class=mainForm type=radio name=field_12 id=field_12_option_2 value="Late" /><label class=formFieldOption for="field_12_option_2">Late</label></span></li>

<li class="mainForm" id="fieldBox_13">
<label class="formFieldQuestion">Need Insurance?*</label><span><input class=mainForm type=radio name=field_13 id=field_13_option_1 value="Yes" /><label class=formFieldOption for="field_13_option_1">Yes</label><input class=mainForm type=radio name=field_13 id=field_13_option_2 value="No" /><label class=formFieldOption for="field_13_option_2">No</label></span></li>

<li class="mainForm" id="fieldBox_14">
<label class="formFieldQuestion">Special Medical Needs:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Enter Medical Needs, i.e. Wheel Chair Accessibility, Service Animal, Pregnancy, Medication etc. in the comments field below.</span></a></label><span><input class=mainForm type=radio name=field_14 id=field_14_option_1 value="Yes" /><label class=formFieldOption for="field_14_option_1">Yes</label><input class=mainForm type=radio name=field_14 id=field_14_option_2 value="No" /><label class=formFieldOption for="field_14_option_2">No</label></span></li>

<li class="mainForm" id="fieldBox_15">
<label class="formFieldQuestion">Special Dietary Needs:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Enter Request for special dietary needs, i.e. Bland Diet in Comment field provided below. </span></a></label><span><input class=mainForm type=radio name=field_15 id=field_15_option_1 value="Yes" /><label class=formFieldOption for="field_15_option_1">Yes</label><input class=mainForm type=radio name=field_15 id=field_15_option_2 value="No" /><label class=formFieldOption for="field_15_option_2">No</label></span></li>

<li class="mainForm" id="fieldBox_16">
<label class="formFieldQuestion">Pay in Full:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Paying in full will charge you the full amount on the first payment date.</span></a></label><span><input class=mainForm type=radio name=field_16 id=field_16_option_1 value="Yes" /><label class=formFieldOption for="field_16_option_1">Yes</label><input class=mainForm type=radio name=field_16 id=field_16_option_2 value="No" /><label class=formFieldOption for="field_16_option_2">No</label></span></li>

<li class="mainForm" id="fieldBox_17">
<label class="formFieldQuestion">Card Type:*</label><select class=mainForm name=field_17 id=field_17><option value=''></option><option value="Master Card">Master Card</option><option value="Visa">Visa</option><option value="American Express">American Express</option><option value="Discover">Discover</option></select></li>

<li class="mainForm" id="fieldBox_18">
<label class="formFieldQuestion">Credit Card #:*</label><input class=mainForm type=text name=field_18 id=field_18 size='20' value=''></li>

<li class="mainForm" id="fieldBox_19">
<label class="formFieldQuestion">Exp. Month:*</label><select class=mainForm name=field_19 id=field_19><option value=''></option><option value="01">01</option><option value="02">02</option><option value="03">03</option><option value="04">04</option><option value="05">05</option><option value="06">06</option><option value="07">07</option><option value="08">08</option><option value="09">09</option><option value="10">10</option><option value="11">11</option><option value="12">12</option></select></li>

<li class="mainForm" id="fieldBox_20">
<label class="formFieldQuestion">Exp. Year:*</label><select class=mainForm name=field_20 id=field_20><option value=''></option><option value="2009">2009</option><option value="2010">2010</option><option value="2011">2011</option><option value="2012">2012</option><option value="2013">2013</option><option value="2014">2014</option><option value="2015">2015</option><option value="2016">2016</option></select></li>

<li class="mainForm" id="fieldBox_21">
<label class="formFieldQuestion">CV#:<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Enter card Verification Number</span></a></label><input class=mainForm type=text name=field_21 id=field_21 size='5' value=''></li>

<li class="mainForm" id="fieldBox_22">
<label class="formFieldQuestion">Card Holder Address:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Enter card holder address as found on credit card statement. If same as passenger address, enter S/A</span></a></label><input class=mainForm type=text name=field_22 id=field_22 size='20' value=''></li>

<li class="mainForm" id="fieldBox_23">
<label class="formFieldQuestion">Comment:<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>If you would like to make a dinner seating request, or have special dietary needs, please enter this information in this field</span></a></label>
<textarea class=mainForm name=field_23 id=field_23 rows=6 cols=60></textarea>
</li>
<li class="mainForm" id="fieldBox_24">
<label class="formFieldQuestion">Agreement:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>You must check this box to authorize payment in order to process your booking</span></a></label><span><input class=mainForm type=checkbox name=field_24[] id=field_24_option_1 value="I authorize the charging of my credit card for this cruise" /><label class=formFieldOption for="field_24_option_1">I authorize the charging of my credit card for this cruise</label></span></li>


<!-- end of this page -->

<!-- page validation -->
<script type=text/javascript>
<!--
function validatePage1()
{
retVal = true;
if (validateField('field_1','fieldBox_1','hidden',0) == false)
retVal=false;
if (validateField('field_2','fieldBox_2','hidden',0) == false)
retVal=false;
if (validateField('field_3','fieldBox_3','text',1) == false)
retVal=false;
if (validateField('field_4','fieldBox_4','text',1) == false)
retVal=false;
if (validateField('field_5','fieldBox_5','text',0) == false)
retVal=false;
if (validateField('field_6','fieldBox_6','text',1) == false)
retVal=false;
if (validateField('field_7','fieldBox_7','state',1) == false)
retVal=false;
if (validateField('field_8','fieldBox_8','text',1) == false)
retVal=false;
if (validateField('field_9','fieldBox_9','phone',1) == false)
retVal=false;
if (validateField('field_10','fieldBox_10','phone',1) == false)
retVal=false;
if (validateField('field_11','fieldBox_11','email',1) == false)
retVal=false;
if (validateField('field_12','fieldBox_12','radio',1) == false)
retVal=false;
if (validateField('field_13','fieldBox_13','radio',1) == false)
retVal=false;
if (validateField('field_14','fieldBox_14','radio',1) == false)
retVal=false;
if (validateField('field_15','fieldBox_15','radio',1) == false)
retVal=false;
if (validateField('field_16','fieldBox_16','radio',1) == false)
retVal=false;
if (validateField('field_17','fieldBox_17','menu',1) == false)
retVal=false;
if (validateField('field_18','fieldBox_18','text',1) == false)
retVal=false;
if (validateField('field_19','fieldBox_19','menu',1) == false)
retVal=false;
if (validateField('field_20','fieldBox_20','menu',1) == false)
retVal=false;
if (validateField('field_21','fieldBox_21','text',0) == false)
retVal=false;
if (validateField('field_22','fieldBox_22','text',1) == false)
retVal=false;
if (validateField('field_23','fieldBox_23','textarea',0) == false)
retVal=false;
if (validateField('field_24','fieldBox_24','checkbox',1) == false)
retVal=false;

if(retVal == false)
{
alert('Please correct the errors. Fields marked with an asterisk (*) are required');
return false;
}
return retVal;
}
//-->
</SCRIPT>

<!-- end page validaton -->



<!-- next page buttons --><li class="mainForm">
<input type=button onclick="if (validatePage1()) { collapseElem('mainForm_1'); expandElem('mainForm_2');}" class="mainForm" value="Go to page 2"/>
</li>
<!-- close the display stuff for this page -->
</ul>
<ul class=mainForm id="mainForm_2"><input type=hidden name=field_25 id=field_25 value="Passenger 2 Information">

Passenger 2 of 2
<li class="mainForm" id="fieldBox_26">
<label class="formFieldQuestion">Passenger 2 Name:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Name must match legal documentation (Passport, Drivers License, Birth Certificate, etc.) you will provide before boarding. You will not be allowed to board unless your name matches exactly. For example, if Robert Smith is on your Passport, do not enter Bob Smith.</span></a></label><input class=mainForm type=text name=field_26 id=field_26 size='60' value=''></li>

<li class="mainForm" id="fieldBox_27">
<label class="formFieldQuestion">Address:*</label><input class=mainForm type=text name=field_27 id=field_27 size='60' value=''></li>

<li class="mainForm" id="fieldBox_28">
<label class="formFieldQuestion">Address 2:</label><input class=mainForm type=text name=field_28 id=field_28 size='60' value=''></li>

<li class="mainForm" id="fieldBox_29">
<label class="formFieldQuestion">City:*</label><input class=mainForm type=text name=field_29 id=field_29 size='60' value=''></li>

<li class="mainForm" id="fieldBox_30">
<label class="formFieldQuestion">State:*</label><select class=mainForm name=field_30 id=field_30><option value=''> </option><option value="Alabama">Alabama</option><option value="Alaska">Alaska</option><option value="Arizona">Arizona</option><option value="Arkansas">Arkansas</option><option value="California">California</option><option value="Colorado">Colorado</option><option value="Connecticut">Connecticut</option><option value="Delaware">Delaware</option><option value="Florida">Florida</option><option value="Georgia">Georgia</option><option value="Hawaii">Hawaii</option><option value="Idaho">Idaho</option><option value="Illinois">Illinois</option><option value="Indiana">Indiana</option><option value="Iowa">Iowa</option><option value="Kansas">Kansas</option><option value="Kentucky">Kentucky</option><option value="Louisiana">Louisiana</option><option value="Maine">Maine</option><option value="Maryland">Maryland</option><option value="Massachusetts">Massachusetts</option><option value="Michigan">Michigan</option><option value="Minnesota">Minnesota</option><option value="Mississippi">Mississippi</option><option value="Missouri">Missouri</option><option value="Montana">Montana</option><option value="Nebraska">Nebraska</option><option value="Nevada">Nevada</option><option value="New Hampshire">New Hampshire</option><option value="New Jersey">New Jersey</option><option value="New Mexico">New Mexico</option><option value="New York">New York</option><option value="North Carolina">North Carolina</option><option value="North Dakota">North Dakota</option><option value="Ohio">Ohio</option><option value="Oklahoma">Oklahoma</option><option value="Oregon">Oregon</option><option value="Pennsylvania">Pennsylvania</option><option value="Rhode Island">Rhode Island</option><option value="South Carolina">South Carolina</option><option value="South Dakota">South Dakota</option><option value="Tennessee">Tennessee</option><option value="Texas">Texas</option><option value="Utah">Utah</option><option value="Vermont">Vermont</option><option value="Virginia">Virginia</option><option value="Washington">Washington</option><option value="West Virginia">West Virginia</option><option value="Wisconsin">Wisconsin</option><option value="Wyoming">Wyoming</option></SELECT></li>

<li class="mainForm" id="fieldBox_31">
<label class="formFieldQuestion">Zip Code:*</label><input class=mainForm type=text name=field_31 id=field_31 size='10' value=''></li>

<li class="mainForm" id="fieldBox_32">
<label class="formFieldQuestion">Phone Number:*</label><input class=mainForm type=phone name=field_32 id=field_32 size=20 value="" style="background-image:url(imgs/phone.png); background-repeat: no-repeat; padding: 2px 2px 2px 25px;"></li>

<li class="mainForm" id="fieldBox_33">
<label class="formFieldQuestion">Emergency Contact:*</label><input class=mainForm type=phone name=field_33 id=field_33 size=20 value="" style="background-image:url(imgs/phone.png); background-repeat: no-repeat; padding: 2px 2px 2px 25px;"></li>

<li class="mainForm" id="fieldBox_34">
<label class="formFieldQuestion">Email Address:</label><input class=mainForm type=email name=field_34 id=field_34 size=20 value="" style="background-image:url(imgs/email.png); background-repeat: no-repeat; padding: 2px 2px 2px 25px;"></li>

<li class="mainForm" id="fieldBox_35">
<label class="formFieldQuestion">Dinner Seating:*</label><span><input class=mainForm type=radio name=field_35 id=field_35_option_1 value="Early" /><label class=formFieldOption for="field_35_option_1">Early</label><input class=mainForm type=radio name=field_35 id=field_35_option_2 value="Late" /><label class=formFieldOption for="field_35_option_2">Late</label></span></li>

<li class="mainForm" id="fieldBox_36">
<label class="formFieldQuestion">Need Insurance?*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Insurance is optional but highly recommended.</span></a></label><span><input class=mainForm type=radio name=field_36 id=field_36_option_1 value="Yes" /><label class=formFieldOption for="field_36_option_1">Yes</label><input class=mainForm type=radio name=field_36 id=field_36_option_2 value="No" /><label class=formFieldOption for="field_36_option_2">No</label></span></li>

<li class="mainForm" id="fieldBox_37">
<label class="formFieldQuestion">Special Medical Needs:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Enter Medical Needs, i.e. Wheel Chair Accessibility, Service Animal, Pregnancy, Medication etc. in the comments field below.</span></a></label><span><input class=mainForm type=radio name=field_37 id=field_37_option_1 value="Yes" /><label class=formFieldOption for="field_37_option_1">Yes</label><input class=mainForm type=radio name=field_37 id=field_37_option_2 value="No" /><label class=formFieldOption for="field_37_option_2">No</label></span></li>

<li class="mainForm" id="fieldBox_38">
<label class="formFieldQuestion">Special Dietary Needs:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Enter Request for special dietary needs, i.e. Bland Diet in Comment field provided below. </span></a></label><span><input class=mainForm type=radio name=field_38 id=field_38_option_1 value="Yes" /><label class=formFieldOption for="field_38_option_1">Yes</label><input class=mainForm type=radio name=field_38 id=field_38_option_2 value="No" /><label class=formFieldOption for="field_38_option_2">No</label></span></li>

<li class="mainForm" id="fieldBox_39">
<label class="formFieldQuestion">Pay In Full:*<a class=info href=#><img src=imgs/tip_small.png border=0><span class=infobox>Paying in full will charge you the full amount on the first payment date.</span></a></label><span><input class=mainForm type=radio name=field_39 id=field_39_option_1 value="Yes" /><label class=formFieldOption for="field_39_option_1">Yes</label><input class=mainForm type=radio name=field_39 id=field_39_option_2 value="No" /><label class=formFieldOption for="field_39_option_2">No</label></span></li>

<li class="mainForm" id="fieldBox_40">
<label class="formFieldQuestion">Card Holder Name (as it appear on card):*</label><input class=mainForm type=text name=field_40 id=field_40 size='60' value=''></li>

<li class="mainForm" id="fieldBox_41">
<label class="formFieldQuestion">Card Type:*</label><select class=mainForm name=field_41 id=field_41><option value=''></option><option value="American Express">American Express</option><option value="Visa">Visa</option><option value="Master Card">Master Card</option><option value="Discover">Discover</option></select></li>

<li class="mainForm" id="fieldBox_42">
<label class="formFieldQuestion">Credit Card #:*</label><input class=mainForm type=text name=field_42 id=field_42 size='20' value=''></li>

<li class="mainForm" id="fieldBox_43">
<label class="formFieldQuestion">Exp Month:*</label><select class=mainForm name=field_43 id=field_43><option value=''></option><option value="11">11</option><option value="10">10</option><option value="09">09</option><option value="08">08</option><option value="07">07</option><option value="06">06</option><option value="05">05</option><option value="04">04</option><option value="03">03</option><option value="02">02</option><option value="01">01</option><option value="Select...">Select...</option><option value="12">12</option></select></li>

<li class="mainForm" id="fieldBox_44">
<label class="formFieldQuestion">Exp Year:*</label><select class=mainForm name=field_44 id=field_44><option value=''></option><option value="2015">2015</option><option value="2014">2014</option><option value="2013">2013</option><option value="2012">2012</option><option value="2011">2011</option><option value="2010">2010</option><option value="2009">2009</option><option value="Select...">Select...</option></select></li>

 

Is This A Good Question/Topic? 0
  • +

Replies To: How to show auto generated confirmation number and some data from form

#2 pr4y  Icon User is offline

  • Location: 127.0.0.1
  • member icon

Reputation: 35
  • View blog
  • Posts: 621
  • Joined: 19-September 08

Re: How to show auto generated confirmation number and some data from form

Posted 18 February 2009 - 08:45 AM

First off, you would never want any form of the user input data as a confirmation number. All you need for a confirmation number is a random integer.

// Random 9 digit integer (confirmation number)
$confirm = rand(100000000,999999999);




Store this information serverside, and add a validation check against this integer.

There is absolutely no need to create an algorythm for a confirmation number, unless you are working with ultra-sensitive data such as credit card confirmations ect.


Hope this helps!

This post has been edited by pr4y: 18 February 2009 - 08:45 AM

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1