RE: [PHP] drop down used to redirect?
| From: | duirfire | Date: | Mon, 26 Mar 2001 20:48:45 +0000 |
| Subject: | RE: [PHP] drop down used to redirect? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-45646@lists.php.net to get a copy of this message | ||
hmmm... thanks, but I want to use a directory.
I've tried "<option value="dir1/dir2/page.html">Page</option>
but the "/" url that get's passed is:
nav.php?loc=dir1%2Fdir2%2Fpage.html
can I escape the quotes somehow?
thanks!
duirfire
> -----Original Message-----
> From: Data Driven Design [mailto:jeff@datadrivendesign.com]
> Sent: Monday, March 26, 2001 2:11 AM
> To: duirfire; PHP User Group
> Subject: Re: [PHP] drop down used to redirect?
>
>
> You can do it with javascript like this.
>
> <script language="javascript">
> function go(selectBox) {
> var where = selectBox.options[selectBox.selectedIndex].value;
> if (where != "") window.location = where;
> }
> </script>
>
> <form>
> <select onchange="go(this)">
> <option value="page.html">Page</option>
> ...
>
> Or you can use PHP like this.
>
> <form action="nav.php" method="post">
> <select name="loc">
> <option value="page.html">page</option>
> ...
>
> --- nav.php ---
> <?php
> header("Location:$loc");
> ?>
>
> ----- Original Message -----
> From: duirfire <duirfire@virtweb.ne.mediaone.net>
> To: PHP User Group <php-general@lists.php.net>
> Sent: Sunday, March 25, 2001 2:39 PM
> Subject: [PHP] drop down used to redirect?
>
>
> >
> > Hi, can anyone point me towards an example of how to use a drop down
> select
> > as a navigation jump, maybe by sending a redirect header?
> >
> > thanks!
> > duirfire
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> > For additional commands, e-mail: php-general-help@lists.php.net
> > To contact the list administrators, e-mail: php-list-admin@lists.php.net
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>