sprintf

guarda $config = array ( 'database'=> array( 'dbname'=>'bandplace', 'user'=>'root', 'pass'=>'pixel', 'host'=>'localhost'), 'date'=> array( 'default'=>'d-m-Y H:i:s'), 'queries'=>array( 'login'=>"SELECT username,password,uid FROM users WHERE username='%s' AND password='%s'", 'news'=>"SELECT uid, author, description, news.permission, nid, insertdate, email, title, username FROM news JOIN users ON news.author = users.uid AND visible='1'",)); function login(){ if(isset($_POST['Submit']) && !isset($_COOKIE['Bb_logged'])){ if(!get_magic_quotes_gpc()){ $username = addslashes($_POST['UserName']); $password = addslashes(md5($_POST['PassWord'])); } else { $username = $_POST['UserName']; $password = md5($_POST['PassWord']); } } else { $username = $_COOKIE['Bb_username']; $password = $_COOKIE['Bb_userhash']; } $username = 'lol'; $password = 'asd'; $login_query = sprintf($config['queries']['login'],$username,$password); $login_exec = mysql_query($login_query); echo $login_query; $login_result= mysql_num_rows($login_exec);

nn funziona la sostituzione dello sprintf

inviato 10 anni fa
Andrea Turso
Andrea Turso
86
X 0 X
Effettua l'accesso o registrati per rispondere a questa domanda