Here's a basic tutorial: http://www.phpeasystep.com/phptu/6.html. It looks
like you are already doing most of what the tutorial shows already. I can
help you convert your script to PDO's, if you want.
On Friday, December 28, 2012 3:45:00 AM UTC-5, Chrystopher Medina wrote:
>
>
> 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 view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/GTpCdALTWKUJ.
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.