[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-windows
Subject:    Re: [PHP-WIN] Call another page after the menu had been
From:       Mike Flynn <mike () mikeflynn ! net>
Date:       2001-12-28 14:54:44
[Download RAW message or body]

At 02:10 PM 12/28/2001 +0800, you wrote:
>Dear all
>I'm using UltraDev which build a form containing a menu, there a two items
>inside this menu for user to choose. This form is using Post Action to
>$php_self which means it will pass back the variable to itself.
>Then here is the question:
>
>  what should i do if i want to call a page prompt from a blank window when
>the item A is selected?
>and another page when Item B is selected!
>
>thx a lot
>jack
>jack@nedcor.com

I'm not sure what you mean by "call a page prompt from a blank window when 
item A is selected".  Do you mean at the exact moment that item A is 
selected, or do you mean after the user has submitted the form?  If you 
mean you want to pop a new window as soon as the user selects one of the 
pulldown options, then you use JavaScript for that.

Something like this:
   <script language="JavaScript"><!--//
     function loadpage(thepage) {
       if (thepage) {
         self.location = thepage;
       }
     }
   //--></script>
   <form action="./" method="post" name="theform">
     <select name="pages" 
onChange="loadpage(this.options[this.selectedIndex].value);">
       <option value="0">--- Please select one: ---</option>
       <option value="page1.php">Page 1</option>
       <option value="page2.php">Page 2</option>
       <option value="page3.php">Page 3</option>
     </select>
   </form>

If you mean you'd like it to redirect them after they submit the form, you 
could do it with the PHP..
[before any other HTML code]
<?php
   if ($submitted && $pages) {
      // .. do stuff..
      header("Location: $pages\r\n\n");
      exit();
   }
?>
[...html code...]
   <form action="./" method="post" name="theform">
     <select name="pages">
       <option value="0">--- Please select one: ---</option>
       <option value="page1.php">Page 1</option>
       <option value="page2.php">Page 2</option>
       <option value="page3.php">Page 3</option>
     </select><br>
     <input type="hidden" name="submitted" value="1">
     <input type="submit" value="Go to page">
   </form>
...

Hope that helps.

-Mike



-- 
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic