I'm having trouble with a website i'm building.... got the site running just fine, but on the iphone browser I am running into some issues. The main problem is my login form doesn't work. When I enter correct login info and press submit, the page just refreshes, and does not log me in. What's going on here? The form works fine on all browsers, including safari... but not on the iphone. Anyone know what the problem is?
One more thing--- one of the links appears to be broken. When I click it, iphone-safari takes me to "404 not found" error. The link is fine, though, and when I hit refresh, it works perfect. The link only breaks when it's sent from another page. Typing in the exact url or simply refreshing takes me to the right page. Again, what the hell is going on here!
My main issue is the login form so here's the code:
Any help is appreciated! Thanks!
-mark
Code: Select all
<?php
if (isset($_POST['submit']))
{
$email = $_POST['email'];
$password = ($_POST['password']);
$email = addslashes($email);
$password = addslashes($password);
if ($email&&$password)
{
mysql_connect("server","user","pword") or die("Could not connect.");
mysql_select_db("db") or die("Couldn't find db!");
$query = mysql_query("SELECT * FROM users WHERE email='".mysql_real_escape_string($email)."'");
$numrows = mysql_num_rows($query);
if ($numrows!=0)
{
while ($row = mysql_fetch_assoc($query))
{
$dbemail = $row['email'];
$dbpassword = $row['password'];
}
if ($email==$dbemail&&md5($password)==$dbpassword)
{
$_SESSION['email'] = $email;
echo "<meta http-equiv='refresh' content='0'>";
}
if (md5($password)!=$dbpassword)
{
echo "<span style='position:absolute;color:#944d4d;right:22%;top:250px;'>Incorrect email and/or password.</span>";
}
}
else
echo "<span style='position:absolute;color:#944d4d;right:22%;top:250px;'>Incorrect email and/or password.</span>";
}
else
echo "<span style='position:absolute;color:#944d4d;right:22%;top:250px;'>Enter username and password.</span>";
}
?>