PHP UserLogin Problem

St4nley

Member
Apr 13, 2013
469
76
Hello, i'm following a phpacademy tutorial which i must say is good but that man needs to slow the fuck down. but anyways in the tutorial i have entered the same code
Code:
<?php
include 'core/init.php';
 
if (empty($_POST) === false) {
    $username = $_POST['username'];
    $password = $_POST['password'];
   
    if ($username&&$password)
    {
    $connect = mysql_connect("localhost,"root","password") or die ("couldn't connect");
    mysql_select_db("lr") or die ("Couldn't Find Db");
   
    }
    else
        die("please enter a username and a password");
 
    }
   
?>
thats my login.php
i submit my premade username and password that i made in the database, and i get no result just the page reloads, also when i went to localhost/login.php i got this error
Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\lr\login.php on line 10

What am i doing wrong?
Thanks!, Stanley
 

Markshall

Русский Стандарт
Contributor
Dec 18, 2010
2,637
2,389
oh sweet appreciate it, also in the tutorial when he enters his login data he gets a blank page, while i get my index page reloaded is this normal?

That's because you're only connecting to your database. You're not actually starting a users session.
 

Users who are viewing this thread

Top