Quantcast
Channel: Programming Forums
Viewing all articles
Browse latest Browse all 51036

PHP form that at submit opens on same page

$
0
0
Hi all,

Thank you for taking the time to look at my issue. I am a student and am having a a problem. I have a form that a user fills out, on submit, the form should display on the same page. I have several tabs on the site that when you click on them they pop up in the correct div on the main page, it is just this form at submit that opens in a new window. This is my below code. Any help would be appreciated.

<div id="primaryContent"> &lt!-- this is the code on my main index page where everything needs to display in primary content-->		&lt!-- primaryContent - START -->
			
			<?php		    if (isset($_GET['menukey'])) {
			$menukey = $_GET['menukey'];
		    } else {
			$menukey = 0;
		    }
		    switch ($menukey) {
			case 1:
        			include 'primarycontent.php';
			        break;
			case 2:
		         	include 'aboutme.php';
	        		break;
			case 3:
			        include 'products.php';
			        break;
	    		case 4:
		        	include 'AdvisorsEdit.php';
	        		break;
	        	case 5:
	        		include 'AdvisorsEditPost.php';
	        		break;
						default:	// case else
        			include 'primarycontent.php';
		        	break; 
		    }
 


&lt!--this is the code form action which does display in the correct location on the main page  it is found in the AdvisorsEdit where the form is filled out-->  
<form action="AdvisorsEditPost.php" method="post" name="AdvisorsEdit">




&lt!--THe following code is for AdvisorsEditPost which is supposed to display on the main index page in primary content like AdvisorsEdit-->
&lt!--  I am wondering if I should have something different in("Location: closewindow.htm");
        -->
<?php

	switch($_POST['action']) { 
	case "Cancel": 
	    header("Location: closewindow.htm");
	    break; 
	case "Save": 
	    $AdvisorID = $_REQUEST['AdvisorID'];
	    break;
	 
	}

&lt!--  This is the form action code on advisorseditpost-->

<form action="primarycontent.php" method="post" name="AdvisorsEditPost">



Viewing all articles
Browse latest Browse all 51036

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>