Jump to content

does this simple code work?


sedif

Recommended Posts

Guys i wrote one pinging script but i don't know it works or not... Someone help me about it works or not?

<?php
site1("http://site.com/sitemap.xml");
site2("http://site2.com/sitemap.xml");

function site1($url){
@file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url);
@file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url);
@file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url);
@file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url);
}
Print "Pinging1 success";

function site2($url){
@file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url);
@file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url);
@file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url);
@file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url);
}
Print "<br>Pinging2 success";
?>

Link to comment
https://forums.phpfreaks.com/topic/228082-does-this-simple-code-work/
Share on other sites

Hi

 

That just appears to attempt to get responses from various search engines about a web site. However it is doing nothing with the responses and isn't even caring if there is an error.

 

There are also 2 functions there that are (as best I can see) identical. The idea of functions is that you write one and call it passing different data. The 2nd function could be removed and the call for it just changed to use the first function instead.

 

All the best

 

Keith

Thanks for response.

 

So what should i do for the working regarding script? Can you help me brother...

 

I want to simply clicking this automatically like using with web browser;

http://www.google.com/webmasters/tools/ping?sitemap=http://site.com/sitemap.xml

 

Regards.

 

Hi

 

<?php
site1("http://site.com/sitemap.xml");
site1("http://site2.com/sitemap.xml");

function site1($url){
@file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url);
@file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url);
@file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url);
@file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url);
}

?>

 

<?php
site1("http://site.com/sitemap.xml");
site1("http://site2.com/sitemap.xml");

function site1($url)
{
if( false == ($str=file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url))) echo "Could not contact server.";
else echo "Returned data:<br /> $str";
if( false == ($str=file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url))) echo "Could not contact server.";
else echo "Returned data:<br /> $str";
if( false == ($str=file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url))) echo "Could not contact server.";
else echo "Returned data:<br /> $str";
if( false == ($str=file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url))) echo "Could not contact server.";
else echo "Returned data:<br /> $str";
}
?>

 

Remember than the returned pages could contain Javascript functions.

 

All the best

 

Keith

Well thanks, i wrote that codes to notepad++, created *.php file and sended to host;

 

http://jesusfuckingchrist.info/pingercode1.php

<?php
pinger("http://site.com/sitemap.xml");
pinger("http://site2.com/sitemap.xml");

function pinger($url){
@file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url);
@file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url);
@file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url);
@file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url);
}

?>

 

 

http://jesusfuckingchrist.info/pingercode2.php

<?php
pinger("http://site.com/sitemap.xml");
pinger("http://site2.com/sitemap.xml");

function pinger($url)
{
if( false == ($str=file_get_contents("http://www.google.com/webmasters/tools/ping?sitemap=" . $url))) echo "Could not contact server.";
else echo "Returned data:<br /> $str";
if( false == ($str=file_get_contents("http://search.yahooapis.com/SiteExplorerService/V1/updateNotification?appid=YahooDemo&url=" . $url))) echo "Could not contact server.";
else echo "Returned data:<br /> $str";
if( false == ($str=file_get_contents("http://www.bing.com/webmaster/ping.aspx?siteMap=" . $url))) echo "Could not contact server.";
else echo "Returned data:<br /> $str";
if( false == ($str=file_get_contents("http://submissions.ask.com/ping?sitemap=" . $url))) echo "Could not contact server.";
else echo "Returned data:<br /> $str";
}
?>

 

Now, when i click to http://jesusfuckingchrist.info/pingercode1.php or pingercode2.php, site.com and site2.com will ping?

 

Regards

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.