...

View Full Version : sending data from one page to another page in php



mafeh
01-05-2007, 10:11 AM
hi, guys. can give some tips on how to send a data from one page to another page using php code...



it would be greatly appreciated.......

thank you so much...

ess
01-05-2007, 12:34 PM
Hello there,

You can do this in many ways.

one way is to use $_GET to send data from one page to another. for example, you have a link in page one.php and you wish to send data to page two.php. you can write your link in this way.


<a href="two.php?data=some_data_here">page two</a>

if you look at the href, you will notice "?" followed by data=....

here, we have create a variable and called data and assigned a value to it. In page two.php, we can obtain this data as follow


<?php $data = $_GET['data']; ?>

Another way is to use sessions variables. this method is better in a sense that you would be able to share this data throughout your website.

Good luck.
Ess



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum