Reg Posted October 10, 2011 Share Posted October 10, 2011 Hi All, I am new to this forum and apologize if this topic has been covered before, I did a search but could not find an answer. I have no formal training in programming and have been learning "on the job". I need to stop a member from registering twice for an event, if they have already registered I need to redirect them to a new page(should be simple enough). I am testing locally using Mamp on my iMac. What happens at the moment is that I am taken to a blank page with the words CAN YOU SEE THIS TEST is displayed. Can anyone assist with the right code to redirect to the event_reg.php page ?? Thank you all for your time. This code is from a working website that I have slowly been making changes to so that it is more "bullet proof". At the moment, members can register as many times as they like. Here is my code ////////////******************* CHECK IF THE PERSON HAS ALREADY REGISTERED FOR THIS EVENT ******************////////// $query2 = "SELECT * FROM `booking_sheet` WHERE `last_name`='$last_name' AND `email`='$email' AND `events_id`='$events_id' LIMIT 1"; $res2 = mysql_query($query2); if (mysql_num_rows($res2) >= 1) {//if already registered redirect to the event_reg.php page // Redirect: header("Location: localhost:8888/at46_local/event_reg.php"); echo "CAN YOU SEE THIS TEST"; exit(); // Quit the script. } else { //Allow to register for this event while ($row2 = mysql_fetch_array($res2)) { $booking_sheet_id = $row2['booking_sheet_id']; } } Link to comment Share on other sites More sharing options...
Larry Posted October 10, 2011 Share Posted October 10, 2011 I don't actually see anything wrong with the code. Well, not seriously. If that redirection code isn't working, start by verifying the query being run and the results. Link to comment Share on other sites More sharing options...
Reg Posted October 11, 2011 Author Share Posted October 11, 2011 Thanks for your advice Larry, I will give it a go. Have spent a lot of time trying to solve this one.... You have published some great books, thank you. Link to comment Share on other sites More sharing options...
Recommended Posts