We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30735
    • 18 Posts
    Hi

    I’m trying to get my script to work in ModX, but I cannot get it to work properly.

    Any help would be appreciated.

    echo '<form action="" method="post">
    <legend><tt>Specify the domain address to check.</tt></legend>
    <br>
    <input type="text" name="domain" value="www.example.com" size="50" maxlength="100">
    <br><br>
    <input type="submit" name="submit" value="Submit">';
    /*
    Changes by Juiced Lime Design 2006
    http://www.juicedlime.com
    */
    
    ini_set ('display_errors', 1);
    error_reporting (E_ALL & ~E_NOTICE);
    
    if (isset($_REQUEST['domain']))
    	{
    	if (isset($_POST['submit']))
    		{
    		if (gethostbyname($_POST['domain']) != $_POST['domain'])
    			{ // It exists
    			echo "<br><br><tt><b>" . $_POST['domain'] . ": The domain address exists.</b></tt>\n";
    			}
    			elseif (!(strlen($_POST['domain']) > 0))
    			{ // Text field empty
    			echo "<br><br><tt><b>No domain address specified.</b></tt>\n";
    			}
    			else
    			{ // It doesn't exist
    			header("Location: http:///www.tsone.info/index.php?domain=".$_POST['domain']."&id=25");
    			}
    		}
    	}
    
    echo'</form>';
    
    


    Thomas :: TSOne.info
      • 7923
      • 4,213 Posts
      Better explanation about the issues you are having would probably get you better answers..

      Also, instead of using echo in a snippet, collect the output to a string and return it from the snippet at the end of it’s execution.


        "He can have a lollipop any time he wants to. That's what it means to be a programmer."
        • 30735
        • 18 Posts
        Hi

        It refuses to return anything.

        the script is at: http://www.tsone.info/index.php?id=22

        I’m not sure why it won’t do anything, I didn’t write the script and I can’t get the person who started it.

        Thomas
          • 7923
          • 4,213 Posts
          That error is not probably coming from that snippet, the line number does not match. If you are trying to do a domain checker snippet, you can probably get better results with this: http://modxcms.com/forums/index.php/topic,7633.0.html

          There is also other domain name checkers around this forum somewhere.. try to search around (using google).


            "He can have a lollipop any time he wants to. That's what it means to be a programmer."