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