Results 1 to 3 of 3

Thread: PHP Question

  1. #1
    Join Date
    Aug 2003

    PHP Question

    I have a quick php question but not sure if what I am wanting to do is possible. I am using the whoiscart and one of the api's allows you to create a form and POST a "domain" to it to generate results.

    Here is my quandry. I have a form that has a spot for the user to type in their domain name and then a drop down for the user to choose the TLD that they want and then click submit.

    The text area is name=\"sld\" and the drop down is select name=\"tld\" how can I combine these 2 to form name=\"domain\" before submitting?

    I am obviously writing this in php and can post the code if necessary.

    Thanks for the help.

  2. #2
    Join Date
    Apr 2004
    Port St Lucie, FL
    What about making your form be self-submitting, and then on the second time around redirecting it to the whoiscart? i.e,

    PHP Code:

    if (
    $p_submit == "Submit")
    $domain $sld '.' $tld;
    $whoiscart_url "";  // Whatever it is
    $whoiscart_url .= "?domain=$domain";  // append a GET variable
         // Redirect the browser to $whoiscart_url
    echo ("<meta http-equiv=\"REFRESH\" content=\"0; URL=$whoiscart_url\">");
    // Display your form

    Paul Embry
    Knight Software and Web Design
    [email protected]
    Quality PHP Web Programming for Reasonable Prices

  3. #3
    If you are willing to dabble in a bit of javascript, try something like this:

    <form name="theform" blah blah>
    Form elements go here
    <input type="hidden" name="domain" value="Default">
    <button onclick="submitTheForm();">Submit</button>
    <script language="javascript">
      function submitTheForm()
        document.all.domain.value = document.all.sld.value + document.all.tld.value;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts