Jump to content


Photo

Passing variables to another page


  • Please log in to reply
5 replies to this topic

#1 markspec87

markspec87
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 20 July 2006 - 02:16 PM

I have a whois checker that stores the domain in $domain.

When they click order i want the php page to pass the variable $domain to the order page so it can be display. "you are purchased the domain $domain"

I know this is probably really simple but i dont know how to do it.

thanks :)

#2 ChaosXero

ChaosXero
  • Members
  • PipPipPip
  • Advanced Member
  • 80 posts

Posted 20 July 2006 - 02:20 PM

Are you using a form? If so, when they post the form a variable called '$_POST['domain']' should be accesible from the page you post to.  If that doesnt work, can you give a little more detail/post significant code?

#3 markspec87

markspec87
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 20 July 2006 - 03:15 PM

it isnt using a form.

example: www.terra-army.com/whois/whois.php

Im trying to get it so when they click available, it takes them to the ordering page and passes on the domain they want registered (stored in $domain)

source code for script - www.terra-army.com/whois/whois.txt

#4 Picatta

Picatta
  • Members
  • PipPip
  • Member
  • 14 posts

Posted 20 July 2006 - 03:20 PM

You can try making the 'available' button redirect to another php script, with some get data that contaisn the url.  Like
pooppie.com      TAKEN
pooppie.net        AVAILABLE << buy.php?domain=pooppie.net
pooppie.org        AVAILABLE << buy.php?domain=pooppie.org
pooppie.info      AVAILABLE << buy.php?domain=pooppie.info

And then have buy.php extract the get key domain.

EDIT:
Looking at the sourcecode, doesn't it already do that?

         
echo "<tr><td>$domain</td><td><p class='available'><a href='/orderdomain.php?id=$domain'>AVAILABLE</a></p></td></tr>";


#5 markspec87

markspec87
  • Members
  • PipPipPip
  • Advanced Member
  • 63 posts

Posted 20 July 2006 - 03:48 PM

that file doesnt exist i put that there becuase thats what im looking to do.

You say "And then have buy.php extract the get key domain"

how do i do that? thats what i want to know :)

#6 DaveLinger

DaveLinger
  • Members
  • PipPipPip
  • Advanced Member
  • 268 posts
  • LocationWV, USA

Posted 20 July 2006 - 03:51 PM

<?php

$domain = $_GET['id'];

echo "Buying $domain";

?>
http://www.DaveLinger.com
dave at linger dot com




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users