i could change that about the date in the server thanks my friend ....
u know could u help me with this.. i think that is the most important part
of the web site .. i have to login to the users i have this file:
but i dont think so that this is the best way to do ... u know ido a lot of
querys ... and i could not implement PDO¨S i did everyhing ... but i CULD
not .... coul u help me my friend o could u give me some tutorial on
internet in order to learn witch is the best way to login
<?php
if($_POST['usuario'] != '' && $_POST['password']!= ''){
$con = mysql_connect("localhost","root","chrystopher");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
else{
mysql_select_db("encuestasavandaro",$con);
$sqlrol="select a.rol from rollusuario a,usuarios b
where a.id_rol = b.id_rol and usuario='$_POST[usuario]';";
$resu = mysql_query($sqlrol, $con) or die(mysql_error());
while ($rows = mysql_fetch_row($resu)){
$rol=$rows[0];
}
$sqluserpwd="select usuario from usuarios where
usuario='$_POST[usuario]';";
$resu1 = mysql_query($sqluserpwd, $con) or die(mysql_error());
while ($rows1 = mysql_fetch_row($resu1)){
$user=$rows1[0];
}
$sqlpwd="select id_usuario from usuarios where
password=SHA('$_POST[password]')and usuario='$_POST[usuario]';";
$resu2 = mysql_query($sqlpwd, $con) or die(mysql_error());
$pwd = mysql_num_rows($resu2);
}
if($_POST['usuario'] == $user && $pwd > 0){
//the user has been login
session_start();
$_SESSION["autentificado"]= true;
$_SESSION["usuario"]= $_POST["usuario"]."|".$rol;
echo 0;
}else{
//the values are wonrg
echo 1;
}
mysql_close($con);
}else{
// the fields are without values
echo 2;
}
?>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.