Jump to content


Photo

passing form variables onto a url


  • Please log in to reply
2 replies to this topic

#1 Stifler

Stifler
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 31 March 2006 - 06:27 PM

I have a text box for the domain name and a drop down box for the TLD (domain extension)

I want to pass on the text box value and the drop down value onto the next page that the person gets sent to which is a URL.

the URL will look something like this
[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]/order/orderwiz.php?submit_domain=register&domains[]=register|DOMAIN|TLD&submit=

DOMAIN = domain name being registered

TLD = top level domain Ex: .com, .net, .org[/quote]

Therefore both variables will have to be into the url..

How would I go about coding this? Would I need 1 page to forward to the final result? or would I be able to put the php on the page with the form and have it directly forward to the results page.

Thankyou for the help :D (ahead of time)

#2 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 31 March 2006 - 06:54 PM

Something like this?
<?php

if(isset($_GET['dname']) && isset($_GET['dtld']))
{
    $dname = $_GET['dname'];
    $dtpl = $_GET['dtld'];

    echo "Your domain name is: <b>" . $dname . $dtpl . "</b><br /><br />";
}

?>

<form name="dOrder" action="<?php $_SERVER['PHP_SELF']; ?>" method="get">
Domain Name: <input type="text" name="dname" /> &nbsp;
tld: <select name="dtld">
<option value=".com">.com</option>
<option value=".co.uk">.co.uk</option>
<option value=".biz">.biz</option>
<option value=".net">.net</option>
<option value=".org.uk">.org.uk</option>
</select>
</form>
<input type="button" name="submit" value="Order Domain" onClick="document.dOrder.submit()"/>


#3 Stifler

Stifler
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 31 March 2006 - 06:59 PM

[!--quoteo(post=360443:date=Mar 31 2006, 01:54 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Mar 31 2006, 01:54 PM) View Post[/div][div class=\'quotemain\'][!--quotec--]
Something like this?
<?php

if(isset($_GET['dname']) && isset($_GET['dtld']))
{
    $dname = $_GET['dname'];
    $dtpl = $_GET['dtld'];

    echo "Your domain name is: <b>" . $dname . $dtpl . "</b><br /><br />";
}

?>

<form name="dOrder" action="<?php $_SERVER['PHP_SELF']; ?>" method="get">
Domain Name: <input type="text" name="dname" /> &nbsp;
tld: <select name="dtld">
<option value=".com">.com</option>
<option value=".co.uk">.co.uk</option>
<option value=".biz">.biz</option>
<option value=".net">.net</option>
<option value=".org.uk">.org.uk</option>
</select>
</form>
<input type="button" name="submit" value="Order Domain" onClick="document.dOrder.submit()"/>
[/quote]

well the URL that it forwards to takes the information they put into the form and processes it into the order form.
so how would i get the variables $dname and $dtpl put into where i put it - in the code below and then forward to the fully parsed URL
/order/orderwiz.php?submit_domain=register&domains[]=register|$dname|$dtpl&submit=





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users