Problem while redirecting user after registration

Posted by Eternal Learner on Stack Overflow See other posts from Stack Overflow or by Eternal Learner
Published on 2010-05-27T20:16:39Z Indexed on 2010/05/27 20:21 UTC
Read the original article Hit count: 153

Filed under:
|

I am creating a simple website . My situation is like this. After registering an user, I want to redirect the user after say 3 seconds to a main page(if the registration succeeds) . The code I have now is as below

$query = "INSERT INTO Privileges VALUES('$user','$password1','$role')";

$result = mysql_query($query, $dbcon) 
 or die('Registration Failed: ' . mysql_error());
print 'Thanks for Registering , You will be redirected shortly';

ob_start();

echo "Test";

header("Location: http://www.php.net");

ob_flush()

I get the error message Warning: Cannot modify header information - headers already sent by (output started at/home/srinivasa/public_html/ThanksForRegistering.php:27) in /home/srinivasa /public_html/ThanksForRegistering.php on line 35.

What do I need to do now ?

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql