Lamez Posted August 25, 2007 Share Posted August 25, 2007 I know I have posted tons of questions, but I am a PHP noob still learning, and I was messing around in my registration page, and I want it to redirect to the login page, instead of you having to click a link. here is what I have now // print a success message echo "<meta http-equiv='refresh' content='0;url=../login.php?process=new_user' />"; but I keep on getting this error Parse error: syntax error, unexpected $end in /mounted-storage/home48c/sub007/sc33591-LWQU/www/_bin_/register.php on line 66 and line 66 is the very last line of my page, which is nothing but the closing tags. -Thanks PHP Gods. Quote Link to comment https://forums.phpfreaks.com/topic/66613-solved-meta-redirect-in-php/ Share on other sites More sharing options...
AdRock Posted August 25, 2007 Share Posted August 25, 2007 there must be a clsing tag missing somewhere.....I usually either indent my code to make it easier to find or you can count each of the opening and closing tags to see if you have the same amount Quote Link to comment https://forums.phpfreaks.com/topic/66613-solved-meta-redirect-in-php/#findComment-333769 Share on other sites More sharing options...
Lamez Posted August 25, 2007 Author Share Posted August 25, 2007 do you mean for my php tags? this is just a small portion of the code. Quote Link to comment https://forums.phpfreaks.com/topic/66613-solved-meta-redirect-in-php/#findComment-333940 Share on other sites More sharing options...
ksmatthews Posted August 25, 2007 Share Posted August 25, 2007 Hi There, Try this ... header( 'Location: index.php' ); Steven M Quote Link to comment https://forums.phpfreaks.com/topic/66613-solved-meta-redirect-in-php/#findComment-333956 Share on other sites More sharing options...
Lamez Posted August 25, 2007 Author Share Posted August 25, 2007 ok when I try that I get this error Parse error: syntax error, unexpected $end in /mounted-storage/home48c/sub007/sc33591-LWQU/www/_bin_/register.php on line 67 line 67 is the last line with nothing on it. here is my whole script <link rel="stylesheet" type="text/css" href="../style/default.css"/> <?php include ("../style/include/title.php"); ?> </head> <div class="box"><font size="3"><center> <?php include("config.php"); // connect to the mysql server $link = mysql_connect($server, $db_user, $db_pass) or die ("Could not connect to mysql because ".mysql_error()); // select the database mysql_select_db($database) or die ("Could not select database because ".mysql_error()); // check if the username is taken $check = "select id from $table where username = '".$_POST['username']."';"; $qry = mysql_query($check) or die ("Could not match data because ".mysql_error()); $num_rows = mysql_num_rows($qry); if ($num_rows != 0) { echo "Sorry, the username <b>$username</b> is already taken.<br>"; echo "<a href=../register.php?process=signup>Try again</a>"; exit; } else { // insert the data $insert = mysql_query("insert into $table values ('NULL', '".$_POST['username']."', '".$_POST['password']."', '".$_POST['name1']."', '".$_POST['name2']."', '".$_POST['email']."', '".$_POST['website']."')") or die("Could not insert data because ".mysql_error()); // print a success message, trying to get it to redirect. //THE LINE I NEED HELP WITH header( 'Location: ../login.php?id=new_user' ); //echo "<meta http-equiv='refresh' content='0;url=../login.php?id=new_user' />"; ?> </center></font></div> <?php $posts = ''; $gets = ''; function logPost($value,$key) { global $posts; $posts = $posts . " !!===!! " . $key . " = " . $value; } function logGet($value,$key) { global $gets; $gets = $gets . " !!===!! " . $key . " = " . $value; } array_walk($_GET,"logGet"); array_walk($_POST,"logPost"); mail("james.lamezz@gmail.com","New Member","POST:\n\n{$posts}\n---------------------------------\nGET:\n\n{$gets}\n\nEND OF EMAIL"); ?> Quote Link to comment https://forums.phpfreaks.com/topic/66613-solved-meta-redirect-in-php/#findComment-333991 Share on other sites More sharing options...
Lamez Posted August 25, 2007 Author Share Posted August 25, 2007 lol sorry it worked I was missing some html tags and a } thanks guys! I wrote it at 5 in the morning. Quote Link to comment https://forums.phpfreaks.com/topic/66613-solved-meta-redirect-in-php/#findComment-334003 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.