Parašė gintulis· 2010 Kov. 24 14:03:45
#3
Na kad tox būtu tai būtu labai gerai :D
Va tas failas kuri reikia redaguot
<?php
#nustatymai
include "config.php"; // adresas turi buti teisingas, iki tikrojo config.php
$slaptazodis = 'slaptazodis'; //iraðyk mokëjimai.lt slaptaþodá
#nustatymai
function dbquery($query) {
$result = @mysql_query($query);
if (!$result) {
echo mysql_error();
return false;
} else {
return $result;
}
}
$db_connect = @mysql_connect($db_host, $db_user, $db_pass);
$db_select = @mysql_select_db($db_name);
if (trans( $_GET['transaction'], $slaptazodis, $_GET['id'])) {
$chars = "abcdefghijklmnpqrstuvwxyz123456789";
$char_count = strlen($chars) - 1;
$pass = "";
for ($i = 0; $i < 8; $i++) {
$pass .= substr($chars, mt_rand(0, $char_count), 1);
}
$result = dbquery("INSERT INTO sms (kodas) VALUES ('$pass')");
echo "Tavo kodas: ".$pass;
} else { echo "Ivyko klaida"; }
function trans($transaction, $userPassword, $ordeID, $test = 0, $status = 1 ) {
return ( $transaction == md5("{$userPassword}|{$_SERVER['REMOTE_ADDR']}|{$ordeID}|{$test}|{$status}") ); }
?>