| | |
Retriving value through url
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
You can also try this one.
for example on page1.php you can have a link that when clicked will pass variables to page2,php
page1.php
page2.php
on this page you will retrieve the values using $_GET
for example on page1.php you can have a link that when clicked will pass variables to page2,php
page1.php
PHP Syntax (Toggle Plain Text)
<?php echo "<a href='page2.php?var1=1&var2=2&var3=3>"."link </a>"; ?>
page2.php
on this page you will retrieve the values using $_GET
PHP Syntax (Toggle Plain Text)
<?php $var1=$_GET["var1"]; $var2=$_GET["var2"]; $var3=$_GET["var3"]; echo "$var1"; echo "$var2"; echo "$var3"; ?>
If you find this useful you can add to my reputation
you could use sessions to store variables between pages.For example:
page1
page2
output of page2 will be:
page1
php Syntax (Toggle Plain Text)
session_start(); $_SESSION['var1']="this is variable1";
page2
php Syntax (Toggle Plain Text)
session_start(); echo $_SESSION['var1'];
output of page2 will be:
this is variable1
![]() |
Similar Threads
- Retriving data from excel sheet into an asp page (ASP)
- changing part of URL PATH (VB.NET)
- Elapsed time for retriving data from database (Visual Basic 4 / 5 / 6)
Other Threads in the PHP Forum
- Previous Thread: php mySQL Problem
- Next Thread: searching for php script to sort data...
| Thread Tools | Search this Thread |
advanced ajax apache api array basics beginner binary broken cakephp check checkbox class cms code combobox cookies cron curl database date datepart display dynamic echo email error file files folder form forms function functions google head href htaccess html image include includingmysecondfileinthechain insert integration ip java javascript job joomla js limit link login loop mail menu mlm multiple mysql oop parse password paypal pdf php problem procedure query radio random recursion regex remote script search server sessions smarty smash sms soap source space sql stored syntax system table traffic tutorial unicode update upload url validator variable video web xml youtube






