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
16
Other forums
New to mysqli library - Multiple query problem
Greetings,
I am writing a batch program that executes 3 queries on a single page. Using mysql
Mail Form receiving emails with no content
Hi, I hope someone here can help me.
I have a simple form in my website, it was working OK, after
PHP Code reffering to database, doing something wrong.. pls help
Well i am quite new with PHP
and for school we have to make a PHP script which reffers to a Data
in php, link returns to the line
When I add a link in a php page, the link word returns to the line (as a
would do)
Examp
How to have a log of all the status a VIM document had been ?
Hi guys,
I’m using SAP Invoice Management plugin and the /OPT/VIM_ANALYTICS transa
date function help
i need help with date function
Code: [Select]<!DOCTYPE HTML PUBLIC "-//W3C//DTD H
Error querying database.
I get the above error when trying to insert some values to a datatable.
Here's the code :
Cursor statement failed with errors
Following statement failed with the errors.
cursor proj_cursor1 is (select projectID from
Alternate messaging
I have 4 strings in MySQL db1
$string1 : Hello
$string2 : Hi
$string3 : Great
$strin
How would I do "Users not logged in since *** delete them"
I know how I would set this up, and delete the user roughly.
I'll create a table called "Use