Re: Redirecting to index.php from index.html
| From: | Michael | Date: | Tue, 17 Jun 2003 21:27:04 +0000 |
| Subject: | Re: Redirecting to index.php from index.html | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-151914@lists.php.net to get a copy of this message | ||
Parse error: parse error, unexpected T_STRING in /path/to/file_named/main.php
on line 4
Here is my actual code so you can look at it and see what I am doing
something wrong. I know I must be, since I don't see how php could become so
popular for site development when it appears to be so difficult to do a
simple test and redirect.
It works fine in forms such as:
<input type="text" name="phrase" size="
<?php
if (strstr(getenv("HTTP_USER_AGENT"), "MSIE")) {
echo "50";
} else {
echo "35";
}
?>
" maxlength="50">
But I have yet to be able to do a redirect after a test.
index.html is a dhtml splash screen to allow time for image preloading. It
does not work on Opera or Konqueror.
<?
if(strstr($HTTP_USER_AGENT, "Opera")){
  header("Location: http://www.servantsmc.com/main.php");
}
elseif(strstr($HTTP_USER_AGENT, "Konqueror")){
  header("Location: http://www.servantsmc.com/main.php");
}
?>
<html>
<head>
<title>Motorcycle Clubs. Servants For Christ - Northern Colorado</title>
<meta name="generator" content="NEdit 5.1">
On Tuesday 17 June 2003 03:26 pm, Ralph wrote:
>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"ƒ%¹b3£é
>
íÉÍ/œ‰);
> }