473,398 Members | 2,404 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

how to save data and at the same time redirect to another page with the data in php

hi i just wanna know if it is possible to save data in mysql and at the same time redirect it to another page with the data in php..(note: i know how to save the data but i can't find a way to drag that data to another page)
May 3 '12 #1
4 2004
johny10151981
1,059 1GB
follow this example below:
Expand|Select|Wrap|Line Numbers
  1. $eample_data='something';
  2. /*
  3. statements to save data;
  4.  
  5. */
  6.  
  7. header("Location: destination.php?example_data=".$eample_data);
  8.  
May 3 '12 #2
hi johny thanks for the rply but can u be more specific im still just starting to learn php and most of it i still dont know..uhm where am i going to put this code? this is may code for saving..thanks



<?php
$rnum=$_GET['txtrnum'];
$pday=$_GET['txtpday'];
$pmonth=$_GET['txtpmonth'];
$phr=$_GET['txtphr'];
$pmin =$_GET['txtpmin'];
$rday =$_GET['txtrday'];
$rmonth =$_GET['txtrmonth'];
$rhr =$_GET['txtrhr'];
$rmin =$_GET['txtrmin'];
$origin =$_GET['txtorigin'];
$destination =$_GET['txtdestination'];
$vehicle =$_GET['txtvehicle'];
$fname =$_GET['txtfname'];
$lname =$_GET['txtlname'];
$email =$_GET['txtemail'];
$contact =$_GET['txtcontact'];
$address =$_GET['txtaddress'];
$zip =$_GET['txtzip'];
$city =$_GET['txtcity'];
$country =$_GET['txtcountry'];
$rate=$_GET['txtrate'];


$dbhost = 'localhost';
$dbuser = 'root';
$dbpass = '';

$conn = mysql_connect($dbhost, $dbuser, $dbpass) or die ('Error connecting to mysql');

$dbname = 'msic';
mysql_select_db($dbname);




$sql="INSERT INTO sd (Rnum, Pickday, Pickmonth, Pickhour, Pickmin, Rday, Rmonth, Rhour, Rmin, Origin, Destination, Vehicle, Fname, Lname, Email, Contact, Address, Zip, City, Country, Rate)
VALUES ('".$_POST['txtrnum']."','".$_POST['txtpday']."','".$_POST['txtpmonth']."','".$_POST['txtphr']."','".$_POST['txtpmin']."','".$_POST['txtrday']."','".$_POST['txtrmonth']."','".$_POST['txtrhr']."','".$_POST['txtrmin']."', '".$_POST['txtorigin']."' , '".$_POST['txtdestination']."', '".$_POST['txtvehicle']."', '".$_POST['txtfname']."', '".$_POST['txtlname']."', '".$_POST['txtemail']."', '".$_POST['txtcontact']."', '".$_POST['txtaddress']."', '".$_POST['txtzip']."','".$_POST['txtcity']."', '".$_POST['txtcountry']."','".$_POST['txtrate']."')";

if (!mysql_query($sql,$conn))
{
die('Error: ' . mysql_error());
}
/*THIS IS THE PART THAT I WANT TO BE REDIRECTED WITH THE DATA THAT I SAVE IN MYSQL*/

header("location:http://localhost/msicrevised/europcar/PaymentForm.php");


mysql_close($conn)

?>
May 3 '12 #3
johny10151981
1,059 1GB
I was specific with my answer, read again
May 3 '12 #4
@johny10151981
okay i got it thanks..
May 3 '12 #5

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

Similar topics

8
by: Matt | last post by:
I want to submit the form to the server without opening another page. When we do the following, it will submit the form data in myform to the IIS, and open page2.asp. <form name="myform"...
1
by: Brian Kedersha | last post by:
I am receiving XML data that I would like to validate against my schema and write at the same time. Some of the data is optional, if the data in the optional elements is incorrect, I would like...
2
by: Stu | last post by:
Hi, When I try and use Javascript to post page form data from one aspx page to another I get the error 'Unable to validate data. '. I am not trying to read the data using web controls I am...
1
by: Darryl | last post by:
I have an Access 2003 front-end tied via ODBC to a SQL Anywhere 8 back-end. When I open a table & try to delete a record in a certain table, I get: "The Microsoft Jet database engine stopped...
3
by: chandrasekhar | last post by:
please help in transfering data from one page to another page which haveing data grid with chech boxes in it , when i select check boxes and click on submit button data should transfer to another...
4
by: skeerthi | last post by:
Hi While writing python script using pamie tool i got this problem. In a webpage if we have more than one link(with the same name) to another page than how we can identify the link we wanted to...
1
by: Jason7899 | last post by:
hi, i looking for do a solution to upload multi images and preview them or remove them at same time without reload page like in the picture that i have annexed in this post. how can i do that?...
7
by: desidude | last post by:
I have a grid view with 10 columns when I click edit it need to display data in another page with the row data in editable mode and also some other columns of the tables.
0
by: Anupam Jana | last post by:
Hello All, I want to redirect to some other directory page after displaying JavaScript alert message in ASP.net in a page. For that I tried bellow code in our application...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.