php - I want to see "redirecting you to the login page" when a user successfully registers on my website. How can i do this? -
this php question. here's code inserting data database:
$con=mysql_connect("localhost","root",""); if(!$con){ die('could not connect:' .mysql_error()); } echo "connected successfully."; $database=mysql_select_db('90210store'); if(!$database){ die('<br>could not select database:' .mysql_error()); } echo "<br>database selected"; $firstname=$_post['firstname']; //to information written in form $lastname=$_post['lastname']; $emailadd=$_post['emailadd']; $check_list=$_post['check_list']; $dob=$_post['dob']; $gender=$_post['gender']; $password=$_post['password']; $first= "insert login (firstname,lastname,emailadd,newsletter,dob,gender,password) values ('$firstname','$lastname','$emailadd','$check_list','$dob','$gender','$password')"; $result=mysql_query($first); if($result){ echo('<br>data entered successfully'); } else{ echo('<br>fail'); } if($result) { header('location: phpredirectlogin.php'); } mysql_close($con); ?>
i tried redirect user page phpredirectlogin.php have "redirecting login page" written on page , redirecting him login page i'm not being able find way it. here's code phpredirectlogin.php page:
<? echo ('redirecting login page'); header('location:account.html'); ?>
it redirects user login page directly without showing "redirecting login page". can tell me how this? thank , sorry english.
that not possible ..
you cannot display , redirect @ same time , redirected , not able see message.
you can use native javascript alert redirect.
<?php echo "<script>alert('redirecting login page');</script>"; echo "<script>window.location = 'account.html';</script>";
Comments
Post a Comment