RE: [PHP] Redirecting to index.php from index.html
| From: | Ralph | Date: | Tue, 17 Jun 2003 22:53:10 +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-151916@lists.php.net to get a copy of this message | ||
Well it does appear to be working because according to this error, the
problem is with main.php on line 4.
-----Original Message-----
From: Michael [mailto:mlewis@exasource.com]
Sent: Tuesday, June 17, 2003 2:27 PM
To: Ralph; 'Jay Blanchard'; php-general@lists.php.net
Subject: Re: [PHP] Redirecting to index.php from index.html
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: