473,545 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VERY URGENT! Relating to PHP Script......... .

10 New Member
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('c onfig.php');
include_once('f unctions.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($FI LE_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_VERIFICA TION == 1){
$te_co = hex2bin($_POST['hid_code']);
$word_is = RC4($te_co,$IMA GE_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_f ile($_FILES['user_file']['tmp_name'],$FILE_UPLOADS_ DIR.$new_filena me);
}
//compose admin/user message templates replaces
$do_search = array('$+Countr y+$','$+pk_loca tion+$','$+drp_ location+$','$+ day+$','$+month +$','$+year+$', '$+ETAHour+$',' $+ETAMinute+$', '$+day1+$','$+m onth1+$','$+yea r1+$','$+ETTHou r+$','$+ETTHour +$','$+CountryO fRes+$','$+AWD+ $','$+WIZ+$','$ +CHKNAME+$','$+ Salut+$','$+nam e+$','$+Sname+$ ','$+House+$',' $+Address1+$',' $+Address2+$',' $+Pcode+$','$+T own+$','$+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_rep lace,$USER_TEMP LATE);
//Set Headers
$user_header = "Return-Path: ".$EMAIL_OPTION S['TITLE']." <".$EMAIL_OPTIO NS['FROM'].">\r\n";
$user_header .= "From: ".$EMAIL_OPTION S['TITLE']." <".$EMAIL_OPTIO NS['FROM'].">\r\n";
$user_header .= "Content-Type: ".$EMAIL_OPTION S['TYPE']."; charset=".$EMAI L_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_rep lace,$ADMIN_TEM PLATE);
//Do we need to send file as attachment?
if($FILE_DO != 1){
//Get file attriubtes
$fileatt_type = $_FILES['user_file']['type'];

$file = fopen($FILE_UPL OADS_DIR.$new_f ilename,'rb');
while($dat = fread($file,102 5657)){
$attachment_dat a .= $dat;
}
fclose($file);

// Encode file content
$attachment_dat a = chunk_split(bas e64_encode($att achment_data));
//File upload headers
$semi_rand = md5(time());
$mime_boundary = "==Multipart_Bo undary_x{$semi_ rand}x";

$headers = "From: ".$EMAIL_OPTION S['TITLE']." <".$EMAIL_OPTIO NS['FROM'].">";

// Add the headers for a file attachment
$headers .= "\nMIME-Version: 1.0\n" .
"Content-Type: multipart/mixed;\n" .
" boundary=\"{$mi me_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_OPTION S['TYPE']."; charset=\"".$EM AIL_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_fi lename}\"\n" .
"Content-Disposition: attachment;\n" .
" filename=\"{$ne w_filename}\"\n " .
"Content-Transfer-Encoding: base64\n\n" .
$attachment_dat a . "\n\n" .
"--{$mime_boundary }--\n";

unset($attachme nt_data);
} else {
//regular headers
$headers = "Return-Path: ".$EMAIL_OPTION S['TITLE']." <".$EMAIL_OPTIO NS['FROM'].">\r\n";
$headers .= "From: ".$EMAIL_OPTION S['TITLE']." <".$EMAIL_OPTIO NS['FROM'].">\r\n";
$headers .= "Content-Type: ".$EMAIL_OPTION S['TYPE']."; charset=".$EMAI L_OPTIONS['CHARSET'].";\n\n\r\n" ;
$new_message = $admin_message;
}
//Send admin emails
foreach($ADMIN_ EMAILS as $this_email){
mail ($this_email,$E MAIL_OPTIONS['USER_SUBJECT'],$new_message,$ headers);
}
}

//Remove file if not needed
if($FILE_DO == 2){
unlink($FILE_UP LOADS_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="#FF808 0">
<tr>
<td bgcolor="#FFD5D 5"><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="#FFFFF F" LEFTMARGIN="10" TOPMARGIN="0" MARGINWIDTH="10 " MARGINHEIGHT="0 " onLoad="checkRa te();" style="backgrou nd-color=#FFFFFF;" link="#C20000" alink="#C20000" vlink="#C20000" >

<form action="<?php echo $_SERVER['http://www. yoursite.com/Check/finalCon.php'];?>" method="post" enctype="multip art/form-data" name="contact" id="contact" style="display: inline
</form>
</body>
</html>

Plzzzzzz do anyone help me.
Nov 23 '06 #1
1 1469
ronverdonk
4,258 Recognized Expert Specialist
This stuff you posted is absolutely messy and unreadable. Read the Posting Guidelines first and then enclose your code within the mentioned php, code or html tags!
I really hope you don't expect anyone to read this from his/her screen and get an idea of the code.

Ronald :cool:
Nov 23 '06 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
1189
by: samir dsf | last post by:
hi this is kinda urgent ... i will insert some data in html format..i just need to know how to disply it back.its urgent...so if anyone can suggest pls tell me i simply need to know that if i store it in bold or something ..then how will i retreive it thnkas
33
3370
by: dembla | last post by:
Hey Frnds can anyone help me in this i need a program in 'c' PROGRAM to print NxN Matrix 9 1 8 1 2 3 2 7 3 as 4 5 6 6 4 5 7 8 9 in sorted form
4
1386
by: archana | last post by:
Hi all, I am having one confusion regarding invoking web method of web service asychronously through windows applicaiton. What i am doing is i am having one long runing web method whose one way attribute is set as i don't want any return value from that method. What i observered is when my window application start calling web method...
1
1910
by: alok sengar | last post by:
hi, I have already tried this URL's code "http://www.java2s.com/Code/CSharp/Network/SimpleSNMP.htm" but I am getting error when i am creating a UDP type Socket and recieving packet from this socket. some time error is---"An existing connection was forcibly closed by the remote host" and some time error is--- "A connection attempt failed...
3
6435
by: N. Spiker | last post by:
I am attempting to receive a single TCP packet with some text ending with carriage return and line feed characters. When the text is send and the packet has the urgent flag set, the text read from the socket is missing the last character (line feed). When the same text is sent without the urgent flag set, all of the characters are read. ...
1
1318
by: sohail28 | last post by:
Respected Sir, I try to connect my DB which is present in my hosting server control panel using Dreamweaver MX 2004. Everything is going fine, except while testing connection configuration, its show error "An Unidentified Error has occured". what will be the solution?, plzzz anyone help me to solve this problem... Its very very...
3
1537
by: settyv | last post by:
Hi, I need to generate PDF stream when i click on Linkbutton in datagrid ..At present i hardcoded the DMS Id and now it is working.But i need to pass DMS ID when click linkbutton.How can i do that? Here is the ASPX code: <asp:datagrid id="grdTentativeResults" Width="800" Runat="server"
1
2103
by: rajesh.us.it.recruiter | last post by:
Hi Guys/Partners, We have a URGENT Requirement for Perl Programmer with H1 visa in India/US for one of our prestigious Client. Location : New Jersey Requirements : Should be very strong in Perl Should be strong in SQL, Unix, C++ Should have some knowledge in RDBMS
6
3293
by: jenipriya | last post by:
Hi all... its very urgent.. please........i m a beginner in oracle.... Anyone please help me wit dese codes i hv tried... and correct the errors... The table structures i hav Employee (EmpID, EmpName,DeptID,DateOfJoin, Sal, Addr) Finance (EmpID, Sal) Club (Clubname, EmpID, Fee, DateOfJoin) Leave (EmpID, Date) Department (DeptID, DeptName,...
9
1611
by: uppili4chi | last post by:
Good morning my dear friends, I am uppili from India. i am working in one mnc. I need a help very urgent. "My problem i need to write a program for search a file just like search option at start menu in our computer". plse give idea, if it possible code.. its very urgent...........
0
7420
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7680
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7934
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7446
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6003
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3476
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1908
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1033
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
731
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.