954,561 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Retriving value through url

How can i pass a value from one webpage to another without using form,plz explain with example

jyshr
Newbie Poster
2 posts since Dec 2007
Reputation Points: 10
Solved Threads: 0
 

window.location='url.php?user=blah&password=blah'

nav33n
Purple hazed!
Moderator
4,465 posts since Nov 2007
Reputation Points: 524
Solved Threads: 356
 

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

<?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 

$var1=$_GET["var1"];
$var2=$_GET["var2"];
$var3=$_GET["var3"];

echo "$var1";
echo "$var2";
echo "$var3";

?>
tirivamwe
Light Poster
36 posts since Oct 2005
Reputation Points: 11
Solved Threads: 2
 

you could use sessions to store variables between pages.For example:

page1

session_start();
$_SESSION['var1']="this is variable1";


page2

session_start();
echo $_SESSION['var1'];


output of page2 will be: this is variable1

ryan_vietnow
Posting Pro
578 posts since Aug 2007
Reputation Points: 28
Solved Threads: 71
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You