Page 1 of 1

Form Issue

Posted: Sun Aug 01, 2010 4:55 pm
by Vegan
Seems to be some problem with my form, seems that nothing is being sent to the browser

Code: Select all

<?php
if(isset($_POST['user_url'])) {
 
    $user_url = $_POST['user_url'];
    $sitemap = "/sitemap.xml";
    
    $API = array(
        "webmaster.live.com/webmaster/ping.aspx?siteMap=",
        "search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=",
        "www.google.com/webmasters/tools/ping?sitemap=",
        "submissions.ask.com/ping?sitemap=",
        "api.moreover.com/ping?sitemap=",
        "www.bing.com/webmaster/ping.aspx?sitemap=",
    );
    
    foreach ($API as $api_url) {
        $arg  = "http://";
        $arg .= $api_url;
        $arg .= "http://";
        $arg .= $user_url;
        $arg .= $sitemap;
 
        echo $arg . "\n";   
        readfile($arg);
        flush();
        sleep(10); // 10 seconds, so servers do not balk
    };
} else {
    echo '<form method="post" action="http://www.contract-developer.tk/services/submit.php">'
        .'URL <input type="text" name="user_url"> <input type="submit" name="submit" value="Submit">'
        .'</form>';
}?>

Re: Form Issue

Posted: Sun Aug 01, 2010 5:07 pm
by superdezign
Hmm. Not exactly sure what the problem is. Maybe you should try file_get_contents() instead of readfile() and see if you get results.

Re: Form Issue

Posted: Sun Aug 01, 2010 5:14 pm
by Vegan
No joy

Seems to not want to display anything, does not make sense.

Re: Form Issue

Posted: Wed Aug 11, 2010 2:30 pm
by Jsphlane20
The form seems to be fine. Try commenting out the sleep satement and also replacing the $arg variable with a hard coded site that has downloadable content. Report back with results. The problem may potentially be in the below area.

Code: Select all

        //echo $arg . "\n";   
        readfile('Place website here');
        flush();
        //sleep(10); // 10 seconds, so servers do not balk
 

Re: Form Issue

Posted: Wed Aug 11, 2010 9:38 pm
by Vegan
I have to use the string processing to generate the list of URLs I am submitting to.

I will try the sleep and see how that helps.

Re: Form Issue

Posted: Wed Aug 11, 2010 9:44 pm
by Vegan
I was wondering, is there another way after the PHP code is done to return to the original page ready to accept another URL?