Displaying the result page on the same page after submitting the form

I have webpage that has links to different contents. But everything gets displayed on the main content area of the page without redirecting it to the other page. All this works fine. I was trying to register a user on the form on the main content area. After registering I want to display a summary of the user selection on same page at main content area. I mean I want the summary to be displayed by replacing the registration form on the same page.
I am using menukeys to achieve this. When I click on Register, a form opens up on the main content area and after I submit the form I get summary results on a different page but I want that to be displayed on the same area where the form was displayed by replacing the form with the summary.

Thanks
ylsv

So you are wanting the code to be processed by the same page?
Or are you just wanting a kind of template setup?

So…
If needs to register include(‘register’)
If registered include(‘thanksforregistering’) ?

because if thats the case you could use

[php]<?php
// index.php
$actions = array(

‘home’ => ‘pages/home.php’,
‘register’ => ‘pages/register.php’,
‘registercomplete’ => ‘pages/registercomplete.php’,

            );

if(!isset($_GET[‘p’]) || !array_key_exists($_GET[‘p’], $actions))
$_GET[‘p’] = ‘home’; // set a default

include($actions[ $_GET[‘p’] ]);
?>[/php]

Then upon processing the register form you can send them back to index.php?p=registercomplete
But if your wanting the same page to process the 2 different pages, start a session, and check if the session has been started. If it has, display 1 page, if not, display the other

Sponsor our Newsletter | Privacy Policy | Terms of Service