PHP SUBMIT


Posted on 16th Feb 2014 07:03 pm by admin

Code: <input name="doLogin" type="image" src="images/loginsubmit.jpg" id="doLogin3" value="Login">
ON FIREFOX it works fine


but on Opera/IE it just refreshes and goes to login.php?




Here is my full thing:


Code: if (isset($_POST['doLogin'])=='Login')
{
include 'dbc.php';
$user_email = mysql_real_escape_string($_POST['usr_email']);
$md5pass = md5(mysql_real_escape_string($_POST['pwd']));


if (strpos($user_email,'@') === false) {
$user_cond = "user_name='$user_email'";
} else {
$user_cond = "user_email='$user_email'";

}


$sql = "SELECT `id`,`user_name`,`approved` FROM users WHERE
$user_cond
AND `pwd` = '$md5pass' AND `banned` = '0'
";


$result = mysql_query($sql) or die (mysql_error());
$num = mysql_num_rows($result);
// Match row found with more than 1 results - the user is authenticated.
if ( $num > 0 ) {

list($id,$full_name,$approved) = mysql_fetch_row($result);

if(!$approved) {
$msg = "Account not activated. Please check your email for activation code";
header("Location: ./?God=Login&msg=$msg");
exit();
}

// this sets session and logs user in

session_start();
// this sets variables in the session
$_SESSION['user_id']= $id;
$_SESSION['user_name'] = $full_name;

//set a cookie witout expiry until 60 days

if(isset($_POST['remember'])){
setcookie("user_id", $_SESSION['user_id'], time()+60*60*24*60, "/");
setcookie("user_name", $_SESSION['user_name'], time()+60*60*24*60, "/");
}


Redirect( "Thanks you have Successfully Logged in!", './?' );
exit;
}
else
{
$msg = urlencode("Invalid Login. Please try again with correct user email and password. ");
header("Location: ./?God=Login&msg=$msg");
}

}

if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE'))
{

echo "hey";
}

?>
<form action="login.php" method="post" name="logForm" id="logForm" >

Code: <?php
/******************** ERROR MESSAGES*************************************************
This code is to show error messages
**************************************************************************/
if (isset($_GET['msg'])) {
$msg = mysql_real_escape_string($_GET['msg']);
echo "<div class="msg">$msg</div>";
}
/******************************* END ********************************/
?>









<center>
<div id="main_content">
<div id="login">
- <input name="usr_email" type="text" class="required" id="txtbox" size="25" style="background-color: transparent;
filter: alpha(opacity=50):
moz-opacity: .50;
opacity: .50;z-index:1;
">
</div>
<div id="password">
- <input name="pwd" type="password" class="required password" id="txtbox" size="25" style="background-color: transparent;
filter: alpha(opacity=50):
moz-opacity: .50;
opacity: .50;z-index:1;
">
<b><i>Remember Me?</i></b> <input name="remember" type="checkbox" id="remember" value="1">
</div>

<div id="submit">
- <input name="doLogin" type="image" src="images/loginsubmit.jpg" id="doLogin3" value="Login">
</div>

No comments posted yet

Your Answer:

Login to answer
270 Like 16 Dislike
Previous forums Next forums
Other forums

 formating when pulling data from a mysql database 
Ok so Im not to sure if this is the right thread to post in but here is my catch 22 issue.

I

Trouble verifying database password
Thankyou to everyone who responded to my last post (I can't find the posting, it has been buried). <

How do I know when getBounds Method is ready to be called.
I have an application that changes out stylesheets client side. Once I change stylesheet the browse

Generate multilayered array from string.
ok so i have a string that looks like this:
Code: blog:edit_all,delete_all|users:edit_all,delete_

Inserting a check in checkbox from array value
Hello all,
I have a bit of code that works for a select option box, but does not work for my chec

Check Date/Time in PHP
What I need the code to check is that $reQuest is 24 hours in the past then return a time based on h

How to search for several parameters from objects in a database?
I have a database with lots of information about objects.
Now I would like to search for 4 or 5 p

Redirecting Admin
In my members table, I have a field called "perm" and it's set to zero for all members. Ho

ob_ dynamic content
i was wondering about the potential to use ob to create a <div then remove it when the page

Facebook status update API
Hello,

So, I'm trying to create my first Facebook application with PHP.

Basic ideas fo

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash