Jump to content

header redirect... need another set of eyes


mellis95

Recommended Posts

I know I must have a simple mistake in here somewhere, but I just can't find it. I have the following HTML buttons to submit a form:

 

<td><input type="submit" name="back" value="BACK">
		<input type="submit" name="save" value="SAVE">
		<input type="submit" name="continue" value="NEXT">
	    <input type="button" value="Check Spelling" onClick="openSpellChecker();" />
	</td>

 

They all submit to "submit_page_7.php"

on submit_page_7.php I have the following at the end of my db updates:

 

if($_POST[save]){
header("location: http://$sname/therapydoc/view/documentation/page_7.php?doc_id=$doc_id&&a=$a&&pid=$pid");
ob_flush();
}
else if($_POST[back]){
header("location: http://$sname/therapydoc/view/documentation/page_6.php?doc_id=$doc_id&&a=$a&&pid=$pid");
ob_flush();
}

 

The problem is, if I click the "BACK" button, it is going to page_7.php. If I click the "SAVE" button, it is going to page_6.php..... exactly the opposite of what it is suppose to do. I have had this redirect working for months with only the SAVE button. but adding the BACK button is causing me problems.

What am I overlooking/not aware of here?

 

Thanks for the help.

 

Matt

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.