Respected Sir /Madam,
I create one web page which includes online reservation using phpscript.
Now this page is working fine, but it executes on the same page.
i want here, when i click submit button , it shud post this page in next page.
Also i want to retrieve some of the text field result to be retreive in hidden text field in next page before it pass the records to email.
Here is the Coding:
<?php
//Include configuration file and function file
//(default location is in the same directory)
include_once('config.php');
include_once('functions.php');
//If contact is being sent:
if($_POST['submit_id'] == 1){
//Check name entered
if($_POST['GRP1'] == NULL){ $message = 'Please Select your Car Group.';}
if($_POST['ETAHour'] == NULL){ $message = 'Please enter your Pickup Time.';}
if($_POST['ETTHour'] == NULL){ $message = 'Please enter your Drop Time.';}
if($_POST['Salut'] == NULL){ $message = 'Please Select your Salutation.';}
if($_POST['name'] == NULL){ $message = 'Please enter your Name.';}
if($_POST['Sname'] == NULL){ $message = 'Please enter your Sur Name.';}
if($_POST['Address1'] == NULL){ $message = 'Please enter your Address1.';}
if($_POST['Pcode'] == NULL){ $message = 'Please enter your Post Code.';}
if($_POST['Town'] == NULL){ $message = 'Please enter your Town.';}
if($_POST['CORes'] == NULL){ $message = 'Please Select your Country of Residence.';}
if($_POST['email'] == NULL){ $message = 'Please enter your EMail ID.';}
//check if email is enetered
if($message == NULL && is_valid_email($_POST['email']) == false ){ $message = 'Please enter a valid email.';}
//check if message is entered
if($_POST['Tel'] == NULL && $message == NULL){ $message = 'Please enter a Telephone No.';}
//File Upload checks
if($message == NULL && $FILE_UPLOAD == 1 && $_FILES['user_file']['name'] != NULL){
if($_FILES['user_file']['size'] > (($FILE_UPLOAD_MAX*1024)*1024)){ $message = 'File is over '.$FILE_UPLOAD_MAX.' MB in size.';}
if($message == NULL && allowed_ext($FILE_UPLOADS_EXT,$_FILES['user_file']['name']) == false){$message = 'Invalid extension.';}
$new_filename = date("G_i_s_").$_FILES['user_file']['name'];
}
//Image verificaiton checks
if($message == NULL && $IMAGE_VERIFICATION == 1){
$te_co = hex2bin($_POST['hid_code']);
$word_is = RC4($te_co,$IMAGE_VER_CODE);
if($word_is != $_POST['confirm_image']){$message = 'Your verfication code is incorrect.';}
}
//End verifications, start processing
if($message == NULL){
//Check if file upload is needed
if($FILE_UPLOAD == 1 && $_FILES['user_file']['name'] != NULL){
//Store file for keep and email
move_uploaded_file($_FILES['user_file']['tmp_name'],$FILE_UPLOADS_DIR.$new_filename);
}
//compose admin/user message templates replaces
$do_search = array('$+Country+$','$+pk_location+$','$+drp_locat ion+$','$+day+$','$+month+$','$+year+$','$+ETAHour +$','$+ETAMinute+$','$+day1+$','$+month1+$','$+yea r1+$','$+ETTHour+$','$+ETTHour+$','$+CountryOfRes+ $','$+AWD+$','$+WIZ+$','$+CHKNAME+$','$+Salut+$',' $+name+$','$+Sname+$','$+House+$','$+Address1+$',' $+Address2+$','$+Pcode+$','$+Town+$','$+CORes+$',' $+Tel+$','$+Fax+$','$+MNo+$','$+email+$');
$do_replace = array($_POST['Country'],$_POST['pk_location'],$_POST['drp_location'],$_POST['day'],$_POST['month'],$_POST['year'],$_POST['ETAHour'],$_POST['ETAMinute'],$_POST['day1'],$_POST['month1'],$_POST['year1'],$_POST['ETTHour'],$_POST['CountryOfRes'],$_POST['AWD'],$_POST['WIZ'],$_POST['CHKNAME'],$_POST['Salut'],$_POST['name'],$_POST['Sname'],$_POST['House'],$_POST['Address1'],$_POST['Address2'],$_POST['Pcode'],$_POST['Town'],$_POST['CORes'],$_POST['Tel'],$_POST['Fax'],$_POST['MNo'],$_POST['email']);
//Send user email?
if($SEND_THANKS == 1){
$user_message = str_replace($do_search,$do_replace,$USER_TEMPLATE) ;
//Set Headers
$user_header = "Return-Path: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n";
$user_header .= "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n";
$user_header .= "Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=".$EMAIL_OPTIONS['CHARSET'].";\n\n\r\n";
//Send Thank you
mail ($_POST['email'],$EMAIL_OPTIONS['USER_SUBJECT'],$user_message,$user_header);
}
//Send admi email?
if(count($ADMIN_EMAILS) > 0){
$admin_message = str_replace($do_search,$do_replace,$ADMIN_TEMPLATE );
//Do we need to send file as attachment?
if($FILE_DO != 1){
//Get file attriubtes
$fileatt_type = $_FILES['user_file']['type'];
$file = fopen($FILE_UPLOADS_DIR.$new_filename,'rb');
while($dat = fread($file,1025657)){
$attachment_data .= $dat;
}
fclose($file);
// Encode file content
$attachment_data = chunk_split(base64_encode($attachment_data));
//File upload headers
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
$headers = "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">";
// Add the headers for a file attachment
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mime_boundary}\"";
// Add a multipart boundary above the plain message
$new_message = "This is a multi-part message in MIME format.\n\n" .
"--{$mime_boundary}\n" .
"Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=\"".$EMAIL_OPTIONS['CHARSET']."\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$admin_message . "\n\n";
// Add file attachment to the message
$new_message .= "--{$mime_boundary}\n" .
"Content-Type: {$fileatt_type};\n" .
" name=\"{$new_filename}\"\n" .
"Content-Disposition: attachment;\n" .
" filename=\"{$new_filename}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$attachment_data . "\n\n" .
"--{$mime_boundary}--\n";
unset($attachment_data);
} else {
//regular headers
$headers = "Return-Path: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n";
$headers .= "From: ".$EMAIL_OPTIONS['TITLE']." <".$EMAIL_OPTIONS['FROM'].">\r\n";
$headers .= "Content-Type: ".$EMAIL_OPTIONS['TYPE']."; charset=".$EMAIL_OPTIONS['CHARSET'].";\n\n\r\n";
$new_message = $admin_message;
}
//Send admin emails
foreach($ADMIN_EMAILS as $this_email){
mail ($this_email,$EMAIL_OPTIONS['USER_SUBJECT'],$new_message,$headers);
}
}
//Remove file if not needed
if($FILE_DO == 2){
unlink($FILE_UPLOADS_DIR.$new_filename);
}
$message = 'Your contact has been sent, thank you.';
$_POST = NULL;
}
}
if($message != NULL){
?>
<table width="100%" border="0" cellpadding="5" cellspacing="0" bgcolor="#FF8080">
<tr>
<td bgcolor="#FFD5D5"><font color="#FF0000"><?=$message;?></font></td>
</tr>
</table>
<br/>
<?php } ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body text="#000000" bgcolor="#FFFFFF" LEFTMARGIN="10" TOPMARGIN="0" MARGINWIDTH="10" MARGINHEIGHT="0" onLoad="checkRate();" style="background-color=#FFFFFF;" link="#C20000" alink="#C20000" vlink="#C20000">
<form action="<?php echo $_SERVER['http://www. yoursite.com/Check/finalCon.php'];?>" method="post" enctype="multipart/form-data" name="contact" id="contact" style="display:inline
</form>
</body>
</html>
Plzzzzzz do anyone help me.