Jump to content

tomasantunes

New Members
  • Posts

    4
  • Joined

  • Last visited

tomasantunes's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I'm just making some experiments. I'm not gonna release anything to the public at the moment. I'm checking out the HybridAuth code, but I can't make it work. I will study the php security online book as soon as I can. Does anyone know any good websites to study more php? Cheers
  2. Thanks a lot! Meanwhile I have downloaded a login script, and restructured my website. It also uses hashing, so I guess it was a good solution. Anyway, it's good to see how the code works. The script I used was https://github.com/panique/php-login-minimal
  3. Thanks. So should I use md5 to make it safe? I've made some alterations but at the moment I get a blank page when I run it. <?php include("mysql_connect.inc.php"); ?> <?php $user = $_POST['user']; $pass = $_POST['pass']; session_start(); $query = mysqli_query("SELECT username FROM users WHERE username='$user'"); $results = mysqli_query($con, $query) or die(mysqli_error($con)); $resultsarray = mysql_fetch_array($results); if (isset($_POST['user']) && $_POST['user'] == $resultsarray && isset($_POST['pass']) && $_POST['pass'] == $resultsarray) { $_SESSION['username'] = $_POST['user']; echo "<p>Login success. You are logged in as: " . $_SESSION['username'] . "</p>Return to mainpage, click <a href='index.php'>here</a>!"; } else { echo "<p>Wrong username or password.</p>"; } mysqli_close($con); ?>
  4. Hi could you help me get this login page working? I made a form which posts to login.php the "user" and "pass". Then this is my code for login.php: <?php include("mysql_connect.inc.php"); ?> <?php $user = $_POST['user']; $pass = $_POST['pass']; session_start(); $query = mysqli_query("SELECT * FROM users WHERE username='$user'"); $results = mysqli_query($con, $query) or die(mysqli_error($con)); $resultsarray = mysql_fetch_array($userresults); if (isset($_POST['user']) && $_POST['user'] == $query && isset($_POST['pass']) && $_POST['pass'] == $query) { $_SESSION['username'] = $_POST['user']; echo "<p>Login success. You are logged in as: " . $_SESSION['username'] . "</p>Return to mainpage, click <a href='index.php'>here</a>!"; } else { echo "<p>Wrong username or password.</p>"; } mysqli_close($con); ?>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.