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
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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.