Re: simple example on redirecting to other URL
| From: | Babak Bandpey | Date: | Mon, 04 Dec 2000 12:08:27 +0000 |
| Subject: | Re: simple example on redirecting to other URL | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-28557@lists.php.net to get a copy of this message | ||
Hi
Can you be more specific?
Have you tried the header("Location: $url"); ?
Or maybe I'm missunderstood.
Cheers
todd.pong@tw.arthurandersen.com wrote:
>
> I'm bothered by how to redirect to desired URL in PHP....
> Finally, I find my own solution...(use javascript.....:Q)
> Share it with PHPers.....it u got better way, please let me know...thanks
>
> I write a include file, named "redirect.inc"....
> then use the following two line to redirect to desired URL.
> the first parameter is the target the url shows, the 2nd is the desired URL
>
> include("redirect.inc");
> redirect("parent","index1.php");
>
> ===========================================================================
> <?
> function redirect($target,$url)
> {
> echo "<script language=JavaScript>";
> echo "function MM_goToURL() {";
> echo " var i, args=MM_goToURL.arguments; document.MM_returnValue = false;";
> echo " for (i=0; i<(args.length-1); i+=2)";
> echo "eval(args[i]+\".location='\"+args[i+1]+\"'\");";
> echo "}";
> echo "</script>";
>
> echo
> "<script>MM_goToURL(\"$target\",\"$url\")</script>";
> }
> ?>
> ===========================================================================
>
> *******************Internet Email Confidentiality Footer*******************
>
> Privileged/Confidential Information may be contained in this message. If you
> are not the addressee indicated in this message (or responsible for delivery of
> the message to such person), you may not copy or deliver this message to anyone.
> In such case, you should destroy this message and kindly notify the sender by
> reply email. Please advise immediately if you or your employer do not consent to
> Internet email for messages of this kind. Opinions, conclusions and other
> information in this message that do not relate to the official business of my
> firm shall be understood as neither given nor endorsed by it.
>
> --
> 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