seany123 Posted June 29, 2009 Share Posted June 29, 2009 i have this code... <?php if($_POST['update']) { //Updates Email Address. if($_POST['email'] != $player->email) { $query = $db->execute("update `players` set `email`=?, `validkey`=?, `validated`=? where `id`=?", array($_POST['email'], $string, 0, $player->id)); $email = $_POST['email']; $subject = 'NAME email change!'; $message = "NAME would like to inform you that you have recently changed your email address, please use the link below to activate your new email: http://URL/validate.php?email=$email&string=$string You can login to the game after activating account at: http://URL *WARNING* if you did not change your email address, please contact Mafiakillerz staff ASAP. Best Regards URL Admin Team."; $headers = "From: [email protected]\r\nReply-To: [email protected]"; mail($_POST['email'], $subject, $message, $headers); } //Updates players password. if($_POST['password'] != $player->password) { $query = $db->execute("update `players` set `password`=? where `id`=?", array($_POST['password'], $player->id )); } //Updates Quote. if($_POST['quote'] != $player->quote) { $query = $db->execute("update `players` set `quote`=? where `id`=?", array($_POST['quote'], $player->id )); } //Updates Gender. if($_POST['gender'] != $player->gender) { $query = $db->execute("update `players` set `gender`=? where `id`=?", array($_POST['gender'], $player->id )); } //Updates Signature. if($_POST['signature'] != $player->signature) { $query = $db->execute("update `players` set `signature`=? where `id`=?", array($_POST['signature'], $player->id )); } //PROBLEM AREA!!!! if($player->validated == 0){ header('Location: edit_account.php'); } else if($player->validated == 1){ header('Location: edit_account.php'); } } if($_POST['delete_avatar']) { $query = $db->execute("update `players` set `avatar`=? where `id`=?", array("", $player->id )); header('Location: edit_account.php'); } if($_POST['edit_avatar']) { $query = $db->execute("update `players` set `avatar`=? where `id`=?", array($_POST['avatar'], $player->id )); header('Location: edit_account.php'); } ?> basically ive tried to get it so if the person changes their email address they have to re-active their account.. but my problem is its not redirecting to index.php... its just redirecting them to edit_account instead. basically when they change email address a value called validated changes in their database table to 0. so i made a if statement that if $player->validated == 0 then redirect to index.php Link to comment https://forums.phpfreaks.com/topic/164032-solved-not-redirecting-to-right-url/ Share on other sites More sharing options...
timmah1 Posted June 29, 2009 Share Posted June 29, 2009 i have this code... <?php //PROBLEM AREA!!!! if($player->validated == 0){ header('Location: edit_account.php'); } else if($player->validated == 1){ header('Location: edit_account.php'); } ?> Yes, this looks like a problem. It won't re-direct to index.php, because you don't have it re-directing to index.php. Link to comment https://forums.phpfreaks.com/topic/164032-solved-not-redirecting-to-right-url/#findComment-865325 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.