Monday, March 2, 2009

What is the reason for virus attack in the site?

Reason for virus attack
---------------------------

Nowadays most of the sites are attacked by the virus which result to be the terrible cause for the owners. By means of E-commerce site and shopping cart site it will result in huge loss to the owners. So, most of the people would be thinking that what might be the reason for the virus attack. There might be some of the reasons for the virus attack below are some of the points specified for the cause of the virus attack. Check your site whether it escapes from these sequence.

  • Is there any open source is added in your site?
  • Is comment posting is enabled in your site?
  • Is there any iframe in your site?
  • Is there any third party site link is in your site?
If you have any one of the above said points please review the remedy for it.

  • If your site have included the open source then disable it.
  • Is there any option for comment posting, disable it
  • If you are using the iframe then remove it.
  • If any third party links are added in your site remove it. Because that third party site might be spreading the virus in your site. So be cautious while adding the third party link to your site.

Friday, November 14, 2008

.htaccess tutorial

AuthUserFile /home/yourdomain/www/.htpasswd
AuthType Basic
AuthName "yourUsername"
Require valid-user

note: The password will be stored in .htpasswd file which is in root directory of the site.

Saturday, September 13, 2008

PHP XML foreach loop

<?php
$xmlDoc = new DOMDocument();
$xmlDoc->load("checkbox array.xml");

$x = $xmlDoc->documentElement;
foreach ($x->childNodes AS $item)
{
echo $item->nodeName . " = " . $item->nodeValue . "
";
}
?>

Load XML and Save XML - PHP

<?php
$xmlDom = new DOMDocument();
$xmlDom->load("enthiran.xml");

print $xmlDom->saveXML();
?>

Thursday, September 4, 2008

PHP array shift

<?php
$stack = array("ajax", "php", "javascript", "mysql");
$fruit = array_shift($stack);
print_r($stack); // first value of the array off
?>

PHP array difference

<?php    
$array1 = array("a" => "php", "string", "array", "PHP");   
$array2 = array("b" => "php", "PHP", "string");    
$result = array_diff($array1, $array2);   
print_r($result);
?>

Saturday, August 30, 2008

Export datas to mysql tables

Export CSV datas to mysql tables

LOAD DATA INFILE 'data.csv' INTO TABLE tbl_name
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n';

Export Excel sheet datas to mysql tables

LOAD DATA INFILE 'data.csv' INTO TABLE tbl_name
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n';

Export XML spread sheet datas to mysql tables

LOAD DATA INFILE 'data.csv' INTO TABLE tbl_name
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\n';