This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$password = 'admin'; | |
for ($i=0; $i<=32; $i++) { | |
$d=rand(1,30)%2; | |
$salt .= $d ? chr(rand(65,90)) : chr(rand(48,57)); | |
} | |
$hashed = md5($password . $salt); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Closures & Anonymous functions test */ | |
$data = array( | |
array( | |
'name' => 'John', | |
'quantity' => '15', | |
'price' => '5.00' | |
), | |
array( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Custom API function to extract all products configoptions from tblproducts */ | |
if( preg_match('/^\d+$/', $_POST['pid']) ) { | |
$resource_id = mysql_query("SELECT * FROM tblproducts WHERE id='{$_POST['pid']}'"); | |
$rows = mysql_num_rows($resource_id); | |
$xml = array(); | |
$xml[] = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n"; | |
$xml[] = "<whmcsapi version=\"5.1.3\">\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELIMITER $$ | |
CREATE PROCEDURE DALOOP() | |
BEGIN | |
DECLARE i INT Default 1; | |
da_loop: LOOP | |
insert into tbl_stuff values(i); | |
SET i=i+1; | |
IF i=101 THEN | |
LEAVE da_loop; | |
END IF; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$connectionHandler = mysql_connect("localhost","username","password"); | |
if( !$connectionHandler ) { | |
die("Connection Failed: " . mysql_error()); | |
} | |
$dbname = 'users_db'; | |
mysql_select_db($dbname); | |
//some simple select queries to test connection |
NewerOlder