php has both strict comparison and loose comparison.
see the example.
if("6x"==6)
{
echo "surprice";
}
else
{
echo "i am aware.";
}
in a comparison, if either side has number then both the parameters will be converted to number and will check 6==6, so the output will be "surprice".
In these case, checking with === will work as usual.
eg: if("6x"===6)
Sunday, 7 February 2010
Wednesday, 27 January 2010
Joomla 1.6 alpha released
joomla 1.6 alpha released.
It reduces the narrow advantage of Drupal over Joomla 1.5.
please check this
Thursday, 14 January 2010
Zencart
Zencart is a pretty easy tool for developing an ecommerce website. A medium level programming knowledge is enough to start because it does not have any complex OOP system to follow. Its not extendable but is highly customizable.
Sunday, 9 August 2009
change or reset ples admin password
find this tool through remote desktop connection ,
C:\Program Files\Parallels\Plesk\admin\bin\plesksrvclient.exe
click on that, and it will ask for a new password.
Saturday, 25 July 2009
remove phocagallery logo
change this
echo $this->tmpl['phocagalleryic'];
but, commercial version is recommended.
Wednesday, 22 July 2009
for debugging joomla
rename the index.php to index_main.php
then , create new index.php and paste the code
error_reporting(E_ALL);
ini_set("display_errors", 1);
include("index_main.php");
?>
Tuesday, 9 June 2009
Auto submit updated sitemap.xml to google webmasters with php code
Theory
To resubmit your Sitemap using an HTTP request:
Issue your request to the following URL:
www.google.com/webmasters/tools/ping?sitemap=sitemap_url
$result = get_web_page('www.google.com/webmasters/tools/ping?sitemap='.urldecode('http://site.com/sitemap.xml'));
if ( $result['errno'] != 0 )
echo "error , bad url";
if ( $result['http_code'] != 200 )
echo "error , no servivice";
$page = $result['content'];
echo $page;
?>
output
"Sitemap Notification Received
Your Sitemap has been successfully added to our list of Sitemaps to crawl. If this is the first time you are notifying Google about this Sitemap, please add it via http://www.google.com/webmasters/tools/ so you can track its status. Please note that we do not add all submitted URLs to our index, and we cannot make any predictions or guarantees about when or if they will appear."
After this, put a cron tab to the link , Note that please dont go less than a hour request to google. otherwise they will be angry.
To resubmit your Sitemap using an HTTP request:
Issue your request to the following URL:
www.google.com/webmasters/tools/ping?sitemap=sitemap_url
For example, if your Sitemap is located at http://www.example.com/sitemap.gz, your URL will become:
www.google.com/webmasters/tools/ping?sitemap=http://www.example.com/sitemap.gz
www.google.com/webmasters/tools/ping?sitemap=http://www.example.com/sitemap.gz
URL encode everything after the /ping?sitemap=:
www.google.com/webmasters/tools/ping?sitemap=http%3A%2F%2Fwww.yoursite.com%2Fsitemap.gz
www.google.com/webmasters/tools/ping?sitemap=http%3A%2F%2Fwww.yoursite.com%2Fsitemap.gz
Issue the HTTP request using wget, curl, or another mechanism of your choosing.
A successful request will return an HTTP 200 response code; if you receive a different response, you should resubmit your request. The HTTP 200 response code only indicates that Google has received your Sitemap, not that the Sitemap itself or the URLs contained in it were valid. To obtain status information about your Sitemap, resubmit it using Webmaster Tools account. We recommend that you resubmit a Sitemap no more than once per hour. An easy way to do this is to set up an automated job to generate and submit Sitemaps on a regular basis.
Code
I got the code from here
http://nadeausoftware.com/articles/2007/06/php_tip_how_get_web_page_using_curl#curlinit
The quick code
Code
I got the code from here
http://nadeausoftware.com/articles/2007/06/php_tip_how_get_web_page_using_curl#curlinit
The quick code
function get_web_page( $url )
{
$options = array(
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_HEADER => false, // don't return headers
CURLOPT_FOLLOWLOCATION => true, // follow redirects
CURLOPT_ENCODING => "", // handle all encodings
CURLOPT_USERAGENT => "spider", // who am i
CURLOPT_AUTOREFERER => true, // set referer on redirect
CURLOPT_CONNECTTIMEOUT => 120, // timeout on connect
CURLOPT_TIMEOUT => 120, // timeout on response
CURLOPT_MAXREDIRS => 10, // stop after 10 redirects
);
$ch = curl_init( $url );
curl_setopt_array( $ch, $options );
$content = curl_exec( $ch );
$err = curl_errno( $ch );
$errmsg = curl_error( $ch );
$header = curl_getinfo( $ch );
curl_close( $ch );
$header['errno'] = $err;
$header['errmsg'] = $errmsg;
$header['content'] = $content;
return $header;
}
$result = get_web_page('www.google.com/webmasters/tools/ping?sitemap='.urldecode('http://site.com/sitemap.xml'));
if ( $result['errno'] != 0 )
echo "error , bad url";
if ( $result['http_code'] != 200 )
echo "error , no servivice";
$page = $result['content'];
echo $page;
?>
output
"Sitemap Notification Received
Your Sitemap has been successfully added to our list of Sitemaps to crawl. If this is the first time you are notifying Google about this Sitemap, please add it via http://www.google.com/webmasters/tools/ so you can track its status. Please note that we do not add all submitted URLs to our index, and we cannot make any predictions or guarantees about when or if they will appear."
After this, put a cron tab to the link , Note that please dont go less than a hour request to google. otherwise they will be angry.
Subscribe to:
Posts (Atom)