me1000 Posted June 3, 2007 Share Posted June 3, 2007 Can someone please help me?? ??? ??? ??? ??? if (isset($inType)) { $query = "INSERT INTO $sTableName (TYPE, LINK, DATE, DESCRIPTION) VALUES ('$inType', '$inLink', '$inDate', '$inDescription')"; $result = mysql_query($query); $response = ($result) ? "Record Added" : "Error adding record!"; echo $response; header ("Location: process.php"); } Everything works great it even comes back and says "Record Added" All data is entered into the Database just like it should be! BUT IT WONT REDIRECT! what am I missing? lol I have looked at it for about 30 minutes now, maybe some fresh eyes will help! Thank You, Quote Link to comment https://forums.phpfreaks.com/topic/54067-solved-simple-redirect-problem/ Share on other sites More sharing options...
tail Posted June 3, 2007 Share Posted June 3, 2007 try this: if (isset($inType)) { $query = "INSERT INTO $sTableName (TYPE, LINK, DATE, DESCRIPTION) VALUES ('$inType', '$inLink', '$inDate', '$inDescription')"; $result = mysql_query($query); $response = ($result) ? "Record Added" : "Error adding record!"; echo '<meta http-equiv=\"refresh\" content=\"3;URL=process.php\">'.$response.''; } that will refresh to process.php in 3 seconds Quote Link to comment https://forums.phpfreaks.com/topic/54067-solved-simple-redirect-problem/#findComment-267285 Share on other sites More sharing options...
me1000 Posted June 3, 2007 Author Share Posted June 3, 2007 That works, but it isnt exactly what I want, I would like to keep it a php redirect if I can! Thanks Quote Link to comment https://forums.phpfreaks.com/topic/54067-solved-simple-redirect-problem/#findComment-267288 Share on other sites More sharing options...
per1os Posted June 3, 2007 Share Posted June 3, 2007 with php headers you cannot echo anything before the header. Meaning anything you echo has to be after the header() call which people will not see unless you do the refresh header, which you would need to post the echo AFTER the header call either way. Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/54067-solved-simple-redirect-problem/#findComment-267291 Share on other sites More sharing options...
tail Posted June 3, 2007 Share Posted June 3, 2007 you cant because the redirect in php only works when there is no other output Quote Link to comment https://forums.phpfreaks.com/topic/54067-solved-simple-redirect-problem/#findComment-267292 Share on other sites More sharing options...
me1000 Posted June 3, 2007 Author Share Posted June 3, 2007 That is interesting, Thanks, Quote Link to comment https://forums.phpfreaks.com/topic/54067-solved-simple-redirect-problem/#findComment-267295 Share on other sites More sharing options...
tail Posted June 3, 2007 Share Posted June 3, 2007 your welcome Quote Link to comment https://forums.phpfreaks.com/topic/54067-solved-simple-redirect-problem/#findComment-267297 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.