RE: [PHP] Redirecting to index.php from index.html
| From: | Ralph | Date: | Tue, 17 Jun 2003 21:26:54 +0000 |
| Subject: | RE: [PHP] Redirecting to index.php from index.html | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151909@lists.php.net to get a copy of this message | ||
Oops. Typos. Try this:
if(strstr($HTTP_USER_AGENT, "Mozilla/4")){
header("Location: http://www.mydomain.com/moz4_page.php");
}
elseif(strstr($HTTP_USER_AGENT, "MSIE")){
header("Location: http://www.mydomain.com/ie_page.php");
}
-----Original Message-----
From: Michael [mailto:mlewis@exasource.com]
Sent: Tuesday, June 17, 2003 1:12 PM
To: Jay Blanchard; Ralph; php-general@lists.php.net
Subject: Re: [PHP] Redirecting to index.php from index.html
With that I get:
Parse error: parse error, unexpected T_STRING in
/path/to/file_named/main.php
on line 4
Michael
On Tuesday 17 June 2003 02:50 pm, Jay Blanchard wrote:
> [snip]
> If I use this on index.html, it does nothing. If I use it on
index.php
> I get:
>
> Parse error: parse error, unexpected '=' in
> /path/to/file_named/main.php on line 3
>
> What am I doing wrong
>
> On Tuesday 17 June 2003 02:11 pm, Ralph wrote:
> > <?php
> >
> > if(strstr = ($HTTP_USER_AGENT, "Mozilla/4")){
> > header("Location:
> > http://www.mydomain.com/moz4_page.php")
> > }
> >
> > elseif(strstr = ($HTTP_USER_AGENT, "MSIE")){
> > header("Location:
> > http://www.mydomain.com/ie_page.php")
> > }
>
> [/snip]
>
>
> Shouldn't it be ....
>
> > if(strstr($HTTP_USER_AGENT, "Mozilla/4")){
> > header("Location:
> > http://www.mydomain.com/moz4_page.php")
> > }
> >
> > elseif(strstr($HTTP_USER_AGENT, "MSIE")){
> > header("Location:
> > http://www.mydomain.com/ie_page.php")
> > }
>
> HTH
--
Exasource Inc.
Web: http://www.exasource.com
Email: rml@exasource.com
Phone: 970-206-4556
"The Israelite army looked at Goliath and said, he's so big we can't
possibly win. David looked at Goliath and said, wait a minute, he's
so big I can't possibly miss"