doubledee Posted May 20, 2012 Share Posted May 20, 2012 I have the following Form Buttons in my Inbox page... <input type="submit" name="cmdGo" class="" value="Go"/> <input id="createPM" type="submit" name="createPM" class="" value="Create PM"/> If the I submit the Form, apparently both Buttons get passed over in the $_POST array. The problem is that since you can't click on both Buttons, my code is giving me this error... Notice: Undefined index: createPM The error above refers to this code... if ($_POST['createPM']=="Create PM"){ // Redirect to Send PM page. header("Location: " . BASE_URL . "/account/send_pm.php"); // End script. exit(); } What would be the best way to handle this issue? Thanks, Debbie Link to comment https://forums.phpfreaks.com/topic/262841-form-buttons-and-undefined-index/ Share on other sites More sharing options...
.josh Posted May 21, 2012 Share Posted May 21, 2012 check if it isset before checking the value. Link to comment https://forums.phpfreaks.com/topic/262841-form-buttons-and-undefined-index/#findComment-1347175 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.