| | |
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 |
Tag cloud for PHP
.htaccess ajax apache api array beginner binary broken cache cakephp checkbox class cms code confirm cron curl customizableitems database date directory display download dynamic echo email error external file files folder form forms forum function functions google header headmethod howtowriteathesis href htaccess html iframe image include insert integration ip java javascript joomla limit link login loop mail malfunction menu mlm mod_rewrite multiple mysql oop paypal pdf php phpmysql problem query question radio random recursion regex remote script search select server sessions sms soap source space sql syntax system table tutorial update upload url validation validator variable video web xml youtube






