Jump to content

[SOLVED] define issues!


xyn

Recommended Posts

hey,

I'm having a problem with my define, basicallyon my login page

i have defined LOGIN_MESSAGE to say "please login below:"

however when the user logs out it says "you have logged out"

 

Well when i do the login if the user fails to login due to incorrect user or pass

i wanted to change the LOGIN_MESSAGE with the error messages. but it doesnt

display correctly.

 

Either the message is the "please login" or it shows "please login" then the error

message!

 

My code:

$sql_load_files = mysql_query("SELECT `name`,`value` 
FROM `panel_templates`");
while(list($name, $value) = mysql_fetch_array($sql_load_files))
{
	switch($_GET['action'])
	{
		case logged_out:
				$value = "You've successfully logged out!";
				break;
		default:
				$value = $value;
	}
	define(strtoupper($name), nl2br($value));
}
if(!isset($_POST['send']))
{
	include("templates/" . TEMPLATE . "/login.php");
}
else
{
	$sql_login = mysql_query("SELECT * 
	FROM `panel_accounts` 
	WHERE `username`='".i_var($_POST['username'])."' 
	AND `password`='".md5(md5(i_var($_POST['password'])))."'");
	if(!mysql_num_rows($sql_login))
	{
		$error = "<div id=\"error\">Error:<br>";
		$error.= "- Incorrect username / password combination.";
		$error.= "</div><br>";
		define("LOGIN_MESSAGE", $error);
		include("templates/" . TEMPLATE . "/login.php");
	}
	else
	{
		//check users ban

		//set sessions
		echo('correct');
	}
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.