Jump to content

[SOLVED] Redirect user after registration


Rother2005

Recommended Posts

hi im trying to get the user to see a screen after successful registration that says thanks for registering then auto redirecting them to another page (member.php)

<?php
include('connect1.inc');?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Booze Cruise Reg</title>

</head>
<body>

<?php
if(!$_POST['register']){echo'<p align="center"><strong>Member Registration</strong></p>
<form name="form1" method="POST" action="">
<p align="center">Username:  <input type="text" name="username"></p>
<p align="center">Password:  <input type="text" name="password"></p>
<p align="center">Firsname:  <input type="text" name="firstname"></p>
<p align="center">Surname:  <input type="text" name="surname"></p>
<p align="center">Address 1: <input type="text" name="address1"></p>
<p align="center">Address 2: <input type="text" name="address2"></p>
<p align="center">Town:      <input type="text" name="town"></p>
<p align="center">County:    <input type="text" name="county"></p>
<p align="center">Postcode:  <input type="text" name="postcode"></p>
<p align="center">Tel No:    <input type="text" name="telno"></p>
<p align="center">Mobile:    <input type="text" name="mobile"></p>
<p align="center">Email:    <input type="text" name="email"></p>
<p align="center"><input type="submit" name="register" value="Enter Details"></p></form>';}
//27
else{$username=$_POST['username'];$password=$_POST['password'];$firstname=$_POST['firstname'];$surname=$_POST['surname'];$address1=$_POST['address1'];$address2=$_POST['address2'];$town=$_POST['town'];$county=$_POST['county'];
$postcode=$_POST['postcode'];$telno=$_POST['telno'];$mobile=$_POST['mobile'];$email=$_POST['email'];
//encrypts password server side into md5 32bytes
$password = stripslashes($password);
$password = md5($password);

$sql = "INSERT INTO member(Username,Password,Firstname,Surname,Address1,Address2,Town,County,Postcode,TelNo,Mobile,Email)
VALUES ('$username','$password','$firstname','$surname','$address1','$address2','$town','$county','$postcode','$telno','$mobile','$email')";

mysql_query($sql)             

or die(mysql_error());
//40
echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=member.php\"/>Thank You! You will be redirected");
</body>
</html>

here is my code but i just keep getting error 'Parse error: parse error, unexpected '<' in C:\Program Files\xampp\htdocs\Loginpage.php on line 42'

please if anyone can help me please do

thanks in advance
Link to comment
https://forums.phpfreaks.com/topic/32463-solved-redirect-user-after-registration/
Share on other sites

hi ive changed the code to inculde the ?> on  new line b4 </body>

but now i get

Parse error: parse error, unexpected $end in C:\Program Files\xampp\htdocs\Loginpage.php on line 44

//line 40
echo ("<meta http-equiv=\"Refresh\" content=\"2; URL=member.php\"/>Thank You! You will be redirected");
?>
</body>
</html>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.