Too lazy to read everything, but I noticed:
quite fast.. you did $username; in a if statement.... take away that semi-colon :PPHP Code:if(isset($_SESSION['M_USER'] = $username;) == "1")
Too lazy to read everything, but I noticed:
quite fast.. you did $username; in a if statement.... take away that semi-colon :PPHP Code:if(isset($_SESSION['M_USER'] = $username;) == "1")
PHP Code:<?php
include ('global.php');
if(isset($_SESSION['M_USER'] = $username;) == "1")
{
echo 'You are already logged in';
}
else
{
if(isset($_POST['login']))
{
$username = strip_tags(mysql_real_escape_string($_POST['username']));
$password = md5($_POST['password']);
if (empty ($username)||empty($password))
{
echo 'Please enter both fields and try again';
}
else
{
$userQ = mysql_query ("SELECT * FROM users WHERE `username` = $username ");
if (mysql_num_rows ($userQ)==0)
{
echo 'Please enter a valid username and try again';
}
else
{
$userA = mysql_fetch_array( $userQ );
if ( $password !== $userA["password"] )
{
echo 'This user exists but the password is incorrect please try again';
}
else
{
$_SESSION['M_USER'] = $username;
Header("Location: me.php");
define('LOGGED_IN', true);
}
}
}
}
}
Last edited by Kryptos; 15-02-12 at 08:22 PM.
MOD Close thread please, Didn't realise me trying to learn and do something for the community is a bad thing.
@Seano2o6 You can enable errors in php.ini to see what's wrong with your code when you get a white page.
Decent, so far.
Thanks Hejula for supporting me, I'm resuming it in private development and will just release it eventually.
Looks good ;3. My design seems to be used a little more now!![]()
Good luck Sean! I'd be interested in co-developing this with you.