Quantcast
Channel: SA-MP Forums
Viewing all articles
Browse latest Browse all 18226

help on php please.

$
0
0
hey there,
i was trying to make an ucp but im kinda new to this php / css and other stuff so i need some help out if you guys could , now the problem is that i have created an login system and also the checker if the player exists on a mysql database so , this part works okay the problem is i've created another style.css where i have couple tables and now i dont know how to direct for example once the player was checked if password and user matches to redirect him to those tables (styles2.css) ?? how to please help me out.

this how i check if player's password is same as he wrote also the username
HTML Code:

<?php
 
  $username = $_POST['user'];
  $password = $_POST['pass'];

  $username = stripcslashes($username);
  $password = stripcslashes($password);
  $username = mysql_real_escape_string($username);
  $password = mysql_real_escape_string($password);

  mysql_connect("localhost","root","");
  mysql_select_db("dbtest");

  $result = mysql_query("select * from username where PlayerName = '$username' and password = '$password'")
                      or die("Failed to query database".mysql_error());

    $row = mysql_fetch_array($result);
 
    if ($row ['username'] == $username  && $row ['password'] == $password )
    {
            echo "Login Sucess".$row['username'];
       
    } else {
            echo "Failed to Login";
    }
   
?>

if you need the tables let me know.

Viewing all articles
Browse latest Browse all 18226

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>