Jump to content

Problems With login form


supermerc

Recommended Posts

Hi, Im trying to make a login form, but for some reason its not working, it goes to the page its supposed to in the action but then does nothing when it gets to that page.

 

This is my form:

 

<form method="post" action="log.php" name="form">
			<input type="text" class="text-inp" name="email" id="email" value="EMAIL" />
			<input type="password" class="text-inp" name="password" id="password"	value="PASSWORD" />
			<input type="image" src="./images/button_input_bg.gif" class="button" onclick="document.form.submit()" name="login"  value="" />
		</form>

 

Then this is my log.php file:

 

<?php 
session_start();
include 'config.php';
if(isset($_POST['login']))
{
$email = trim(addslashes($_POST['email']));
$password = md5(trim($_POST['password']));
$query = mysql_query("SELECT * FROM users WHERE email = '$email' AND password = '$password' LIMIT 1") or die(mysql_error());
$row = mysql_fetch_array($query);
	if(mysql_num_rows($query) > 0)
{

	if($row['activated'] > 0)
	{

		header("Location: member.php"); 
	        exit();
			} else {
			echo 'account not activated';
			}
			} else {
			echo 'bad pass';
			}
			}

?>

 

it seems to me that it doesnt see that the form was submited but I dont understand why.

Link to comment
https://forums.phpfreaks.com/topic/91575-problems-with-login-form/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

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