> Well, I think I should give a better explanation. I have been 
> seeing a lot
> of scripts that appear to be on multiple pages. For example:
> You  open file.php, and you are greeted with a form asking 
> your name. You
> give in your name and then submit the form. After you submit 
> the form you
> would normally get a new page saying your name has been 
> stored or something
> like that. This time, that also happens BUT you do not go to 
> a new separate
> file. The URL in your browser is still on file.php, however 
> the form that
> was there before is GONE and you see a totally new page. I am 
> asking how
> something like this can be done. If it will help I can attach 
> a file that
> does this.

Yes, and exactly this is what I told you ;)

I've got one page, let's say "main.php".
This page is looking for a var, let's say called "$curAction";
$curAction is not present the script knows that you're new to
this site and calls a function called "displayWelcome" (wherever
this function is defined ;)).


$curAction = $HTTP_POST_VARS["curAction"];

switch ($curAction)
        case "displayForm1":
        case "displayForm2":
        case "logoff":

        // And so on...

function displayForm1()
        ?><form><!-- html goes here --></form><?php

// ...and so forth

So this switch casecade handles what content is to be displayed,
which looks as if you where getting different pages...

Better now?



It's not a bug, it's a feature.
christoph starkmann
ICQ: 100601600

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to