This is my registration php page..!
when i get registered on localhost it works fine and redirect me to feedsomeinfo.php
but in server
it is redirecting me on login_attempt.php
any clue why it is happening?
<?php
// Report runtime errors
error_reporting(E_ERROR | E_WARNING | E_PARSE);
// Report all errors
error_reporting(E_ALL);
// Same as error_reporting(E_ALL);
ini_set("error_reporting", E_ALL);
// Report all errors except E_NOTICE
error_reporting(E_ALL & ~E_NOTICE);
session_start();
include("config.php");
function clean($str) {
$str = @trim($str);
if(get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
return mysql_real_escape_string($str);
}
$user=$_SESSION['SESS_MEMBER_ID'];
$invitecount=5;
$fname=ucfirst(clean($_POST['fname']));
$lname=ucfirst(clean($_POST['lname']));
$usern=clean($_POST['usern']);
$emailadd=clean($_POST['emailadd']);
$password=mysql_real_escape_string($_POST['password']);
$password= sha1($password);
$num='1';
mysql_query("INSERT INTO members(fname, lname, invitecount, usern, email, password, profilepic, coverphoto,number)
VALUES('$fname', '$lname', '$invitecount', '$usern', '$emailadd', '$password', 'profilepic/friends.png', 'coverphotos/cover.png', '$num')");
//Create query
$result=mysql_query("SELECT * FROM members WHERE email = '$emailadd' AND password = '$password'");
if(mysql_num_rows($result) > 0) {
//Login Successful
session_regenerate_id();
$member = mysql_fetch_assoc($result);
$_SESSION['SESS_MEMBER_ID'] = $member['id'];
$_SESSION['SESS_FIRST_NAME'] = $member['fname'];
$id=$member['id'];
$name=$member['fname'];
$number=$member['number'];
$expires = 1 * 1000 * 60 * 60 * 24;
setcookie("email", $emailadd, time()+$expires);
setcookie("password", $password, time()+$expires);
mysql_query("insert into logged(logid,logdin) VALUES('$id', '$name') ");
if($number=='1')
{ header("location: feedsomeinfo.php");
}
else
{ header("location: timewall.php");
}
}
else{
header("location: login_attempt.php");
exit();
}
mysql_close($bd);
?>
$passwordx
that's undefined as is$a
. Plus, storing passwords in cookies is not a very good idea. Plus,mysql_close($bd);
which API are you using to connect with? – Fred -ii- 27 mins ago