dcro2 Posted January 1, 2007 Share Posted January 1, 2007 Heh, well... never read any books ;D. Sorry. Good luck with everything else. Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150648 Share on other sites More sharing options...
Rother2005 Posted January 1, 2007 Author Share Posted January 1, 2007 just 1 question i have.. is it possible to get the user directed to a page automatically once they have registered? Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150650 Share on other sites More sharing options...
dcro2 Posted January 1, 2007 Share Posted January 1, 2007 You can use <meta http-equip="Refresh" content="5; members.php">5 is the time to wait in seconds, members.php is the URL.Or..If you're not going to echo anything on the page, then use header("Location: members.php"); to instantly redirect them. Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150656 Share on other sites More sharing options...
Rother2005 Posted January 1, 2007 Author Share Posted January 1, 2007 where do i put that tho??echo("You are registered! $username") HERE??? ;}?> Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150662 Share on other sites More sharing options...
dcro2 Posted January 1, 2007 Share Posted January 1, 2007 Well, the <meta> tag goes in the <head>. If you use the header() method, you can't output anything to the browser before it's called. Anything output to the browser after header() will probably not be seen anyways. Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150664 Share on other sites More sharing options...
Rother2005 Posted January 1, 2007 Author Share Posted January 1, 2007 <?phpinclude('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>';} 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'];$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());echo("You are registered! $username");}?> [b]//CAN I DELETE THIS LINE AND GET THE CODE TO GO TO A DIFF PAGE, THEN JUST PUT THAT META TAG ON THE NEW PAGE??[/b]</body></html> Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150665 Share on other sites More sharing options...
dcro2 Posted January 1, 2007 Share Posted January 1, 2007 You can just replace that line with [code]$username = stripslashes($username);$hour = time() + 3600;setcookie("ID_my_site", $username, $hour);setcookie("Key_my_site", $password, $hour);header("Location: members.php");[/code] Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150666 Share on other sites More sharing options...
Rother2005 Posted January 1, 2007 Author Share Posted January 1, 2007 an errors appeared after i put that in:Parse error: parse error, unexpected '<' in C:\Program Files\xampp\htdocs\Loginpage.php on line 47lines 45 - 47//45 header("Location: members.php");//46//47 </body>i assume this is cos the codes in the body? Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150668 Share on other sites More sharing options...
dcro2 Posted January 1, 2007 Share Posted January 1, 2007 Well, you need to end the PHP tag before you put HTML in.[code]$username = stripslashes($username);$hour = time() + 3600;setcookie("ID_my_site", $username, $hour);setcookie("Key_my_site", $password, $hour);header("Location: members.php");?></body>[/code] Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150669 Share on other sites More sharing options...
Rother2005 Posted January 1, 2007 Author Share Posted January 1, 2007 but now its givein:Parse error: parse error, unexpected $end in C:\Program Files\xampp\htdocs\Loginpage.php on line 48lol bloody error msgs that line is //47 </body>//48 </html> Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150672 Share on other sites More sharing options...
dcro2 Posted January 1, 2007 Share Posted January 1, 2007 OK...[code]$username = stripslashes($username);$hour = time() + 3600;setcookie("ID_my_site", $username, $hour);setcookie("Key_my_site", $password, $hour);header("Location: members.php");}?></body>[/code] Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150674 Share on other sites More sharing options...
Rother2005 Posted January 1, 2007 Author Share Posted January 1, 2007 sorry im takin advantage now thanks for all your help and i spose i sud got to bed it is 4.50am lol Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150676 Share on other sites More sharing options...
dcro2 Posted January 1, 2007 Share Posted January 1, 2007 Only 11:52 here ;D Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150679 Share on other sites More sharing options...
Rother2005 Posted January 1, 2007 Author Share Posted January 1, 2007 where you at good olde US of A?? Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150681 Share on other sites More sharing options...
dcro2 Posted January 1, 2007 Share Posted January 1, 2007 Yup. Eastern Time. New Year in 4 minutes. Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150683 Share on other sites More sharing options...
Rother2005 Posted January 1, 2007 Author Share Posted January 1, 2007 why you not out getting wrecked then?? Link to comment https://forums.phpfreaks.com/topic/32421-solved-log-in-action/page/2/#findComment-150686 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.