Jump to content

Form Buttons and Undefined Index


doubledee

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.