Retriving value through url

Reply

Join Date: Dec 2007
Posts: 2
Reputation: jyshr is an unknown quantity at this point 
Solved Threads: 0
jyshr jyshr is offline Offline
Newbie Poster

Retriving value through url

 
0
  #1
Dec 20th, 2007
How can i pass a value from one webpage to another without using form,plz explain with example
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 3,760
Reputation: nav33n is a jewel in the rough nav33n is a jewel in the rough nav33n is a jewel in the rough 
Solved Threads: 332
Moderator
Featured Poster
nav33n's Avatar
nav33n nav33n is offline Offline
Senior Poster

Re: Retriving value through url

 
0
  #2
Dec 20th, 2007
window.location='url.php?user=blah&password=blah'
Ignorance is definitely not bliss!

*PM asking for help will be ignored*
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 36
Reputation: tirivamwe is an unknown quantity at this point 
Solved Threads: 2
tirivamwe's Avatar
tirivamwe tirivamwe is offline Offline
Light Poster

Re: Retriving value through url

 
0
  #3
Dec 20th, 2007
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

  1. <?php
  2. echo "<a href='page2.php?var1=1&var2=2&var3=3>"."link </a>";
  3. ?>

page2.php

on this page you will retrieve the values using $_GET
  1. <?php
  2.  
  3. $var1=$_GET["var1"];
  4. $var2=$_GET["var2"];
  5. $var3=$_GET["var3"];
  6.  
  7. echo "$var1";
  8. echo "$var2";
  9. echo "$var3";
  10.  
  11. ?>
If you find this useful you can add to my reputation
Reply With Quote Quick reply to this message  
Join Date: Aug 2007
Posts: 569
Reputation: ryan_vietnow is an unknown quantity at this point 
Solved Threads: 71
ryan_vietnow's Avatar
ryan_vietnow ryan_vietnow is offline Offline
Posting Pro

Re: Retriving value through url

 
0
  #4
Dec 20th, 2007
you could use sessions to store variables between pages.For example:

page1
  1. session_start();
  2. $_SESSION['var1']="this is variable1";

page2
  1. session_start();
  2. echo $_SESSION['var1'];

output of page2 will be:

this is variable1
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC