Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 25-09-2009
Member
 
Join Date: Dec 2008
Posts: 112
How to Pass data from one page to another in PHP?

I am trying to pass the variables in a form from one page to another. Could someone take the time to walk me through this? I do not know anything about PHP. This works fine in that the company name appears in the URL... but when I try it displayed as very long URL variables as well as broken link.
Reply With Quote
  #2  
Old 25-09-2009
Member
 
Join Date: Dec 2008
Posts: 120
Re: How to Pass data from one page to another in PHP?

Passing the variables from a form to another page depends on the method of your form...for the purposes of this explanation, I will assume your form has an method of POST.

Code:
^a href="http://yourdomain.com/test2.php?first_name=^?php echo $first_name?*&last_name=^?php echo $last_name?*"*Test Page 2^/a*

I can also pass variables in the "action" attribute of the form.
This method of passing values in php only works if the user clicks on the links that I have structured.
Reply With Quote
  #3  
Old 25-09-2009
Member
 
Join Date: Mar 2008
Posts: 232
Re: How to Pass data from one page to another in PHP?

It should be noted that you are supplying the same URL as the action for both forms...did you not specify that you will be sending the information through different pages? I don't recommend ever using GET variables to save session state as URL's are easily modified. Either use sessions with PHP (real simple) and populate the javascript variables on page load, or even better, just use Javascript cookies. This method of passing values in php only works if the user clicks on the links that I have structured. This proves handy when I only want the user to choose a certain link, or when I want the variable I passed to only be available to the script that the link targets.
Reply With Quote
  #4  
Old 25-09-2009
Member
 
Join Date: Nov 2008
Posts: 43
Re: How to Pass data from one page to another in PHP?

I'm not very good at XML, but another option you may have, is to send all the data to a XML file, and store the information in it through all the 4 pages, and when you are done, parse it to add the info to your database. The $_GET method should not be used for security sensitive stuff unless other mesures to encrypt and secure the data have been taken. Don't ask me for code for I still have to learn a lot of XML.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "How to Pass data from one page to another in PHP?"
Thread Thread Starter Forum Replies Last Post
Network Diagram - Configure to show Forward Pass/Backward Pass m3lyssa Microsoft Project 9 30-08-2010 04:57 PM
How to Pass Data Between Two MDI Forms Brunoz Windows Software 3 25-09-2009 11:19 AM
How to pass MVC data from attribute to controller Saaarc Software Development 3 14-07-2009 10:14 AM
What is difference between pass by value & pass by reference in java? Baran Software Development 4 25-02-2009 07:15 PM
how to pass the dataset from one page to another page in Asp.Net kaartik Software Development 3 27-12-2008 05:29 PM


All times are GMT +5.5. The time now is 01:18 AM.