Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_php thread: Re: Dymanically redirecting to a specific page


Message #1 by "Justin Vincent" <j.vincent@e...> on Fri, 6 Sep 2002 18:49:16
Recently I have done both of these:

$user=func($someInput);
$pageName="info$user.php";
include($pageName);

and

switch(func($queryString))
{
case "A": include("pageA.php"); break;
case "B": include("Bpage.php"); break;
default: something else
}

It works great both in a page that doesn't do anything except choose 
the page and as an inclusion in a table. It saves the whole header 
interaction and makes a nice smooth user experience.

tqii



>Hello Justin,
>
>
>Do this to correct your script
>
>  // validate input
>   if (!$user_name)
>   {
>     $error = "You must enter a name";
>     include("NewUser.php"); // re-open form displaying error,
>                             //print the variable $error in the form page
>- NewUser.php
>   }
>   else
>   {
>    db_query("INSERT INTO etc etc");
>    include "Options.php"; // open options page
>   }
>
>
>
>Hani
>
>-----Original Message-----
>From: Justin Vincent [mailto:j.vincent@e...]
>Sent: Friday, September 06, 2002 6:49 PM
>To: professional php
>Subject: [pro_php] Re: Dymanically redirecting to a specific page
>
>
>Am I missing somethign here...
>
>Can't you just do an include in your file after
>the details have been aded to the DB.
>
>For example..
>
>   // validate input
>   if ( !$user_name )
>   {
>     $error = "You must enter a name";
>   }
>
>   if ( $error )
>   {
>     include "NewUser.php"; // re-open form displaying error
>   }
>   else
>   {
>    db_query("INSERT INTO etc etc");
>    include "Options.php"; // open options page
>   }
>
>
>


-- 

--------------------------------------------------------------------------------

We protect data, the 21st century asset.

TQ White II
Chief Operating Officer
Backup Bank, LLC

312/566-0600

tq@B...
http://beSafe.BackupBank.com

--------------------------------------------------------------------------------

  Return to Index