PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Sun Aug 01, 2010 4:55 pm
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>';
}?>
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
superdezign
DevNet Master
Posts: 4135 Joined: Sat Jan 20, 2007 11:06 pm
Post
by superdezign » Sun Aug 01, 2010 5:07 pm
Hmm. Not exactly sure what the problem is. Maybe you should try
file_get_contents() instead of readfile() and see if you get results.
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Sun Aug 01, 2010 5:14 pm
No joy
Seems to not want to display anything, does not make sense.
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Jsphlane20
Forum Newbie
Posts: 17 Joined: Wed Aug 11, 2010 1:17 pm
Contact:
Post
by Jsphlane20 » Wed Aug 11, 2010 2:30 pm
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
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Wed Aug 11, 2010 9:38 pm
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.
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
Vegan
Forum Regular
Posts: 574 Joined: Fri Sep 05, 2008 3:34 pm
Location: Victoria, BC
Contact:
Post
by Vegan » Wed Aug 11, 2010 9:44 pm
I was wondering, is there another way after the PHP code is done to return to the original page ready to accept another URL?
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP