Jump to content

passing form variables onto a url


Stifler

Recommended Posts

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)
Link to comment
https://forums.phpfreaks.com/topic/6289-passing-form-variables-onto-a-url/
Share on other sites

Something like this?
[code]<?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()"/>[/code]
[!--quoteo(post=360443:date=Mar 31 2006, 01:54 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Mar 31 2006, 01:54 PM) [snapback]360443[/snapback][/div][div class=\'quotemain\'][!--quotec--]
Something like this?
[code]<?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()"/>[/code]
[/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
[code]/order/orderwiz.php?submit_domain=register&domains[]=register|$dname|$dtpl&submit=[/code]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.