affordit Posted August 23, 2009 Share Posted August 23, 2009 I need to redirect the user if a query has been executed how do I do that I was trying to use if ( $query){ (header("location:index.php") Is this the wrong syntax and if it is how can I fix it please? Link to comment https://forums.phpfreaks.com/topic/171563-mysql-query-problem/ Share on other sites More sharing options...
tekrscom Posted August 24, 2009 Share Posted August 24, 2009 header("Location: index.php"); Link to comment https://forums.phpfreaks.com/topic/171563-mysql-query-problem/#findComment-904776 Share on other sites More sharing options...
EchoFool Posted August 24, 2009 Share Posted August 24, 2009 don't forget to close the curly bracket after the header line : if ($query){ header("location:index.php"); } Bare in mind make sure you have no output prior to this or you will get an output already sent error. Click this to understand header errors: http://www.phpfreaks.com/forums/index.php/topic,37442.0.html Link to comment https://forums.phpfreaks.com/topic/171563-mysql-query-problem/#findComment-904779 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.