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";)
> }
>
> etc...
>
> ?>
>
> <HTML>
> <HEAD>
> <TITLE>My Page</TITLE>
> </HEAD>
>
> etc..
>
>
> -----Original Message-----
> From: Michael [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, June 17, 2003 11:42 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Redirecting to index.php from index.html
>
> I'm a relative newbie to PHP coming from the Zope/Python/DTML world.
> Does
> anyone know of a good way, short of a javascript, to redirect from
> index.html
> to index.php.   Also, can I use PHP to test for browsers, then redirect
> them
> to the appropriate page.  In DTML/Python it would be :
>
> <dtml-if "_.string.find(HTTP_USER_AGENT, 'Mozilla/4') >= 0>
> <dtml-call "RESPONSE.redirect('moz4_page.php')">
> </dtml-if>
>
> This can be called from anywhere in the page.  I know that PHP does not
> work
> this way and that this would need to be done before <html>, but I'm even
>
> having problems with that.  I guess I'm just having a hard time THINKING
> like
> php.

-- 
Exasource Inc.
Web: http://www.exasource.com
Email: [EMAIL PROTECTED]
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"

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to