httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Taylor" <ch...@x-bb.org>
Subject Re: [users@httpd] Allow Redirect
Date Fri, 30 Aug 2002 10:50:08 GMT
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

That's your problem, the <?php has to be the FIRST thing is
encounters.

So, a quick restructure to:

 
<?php

$agent = $_SERVER['HTTP_USER_AGENT'];

if (stristr($agent,"MSIE")){

header ("Location: ie.php");

}

else {

header ("Location: other.php");

}


?>

<html>

<body>

</body>

</html>


Incidentally, given that your script seems to consist of a redirect
whatever happens, there's no need at all for the <html> etc below the
?>, it won't be parsed in any case.

Chris Taylor - chris@x-bb.org - The guy with the PS2 WebServer -
http://www.x-bb.org/chris.asc

- ----- Original Message ----- 
From: Luis Moreira 
To: users@httpd.apache.org 
Sent: Friday, August 30, 2002 11:46 AM
Subject: Re: [users@httpd] Allow Redirect


1) Line 5 contains simply "<?php" instructing Apache to go into PHP
mode.
I then just call this script from within the browser.

2) The string was and is at the beginning of the line, as Chris
suggested.

The whole script is 

/*
<html>

<body>

<?php

$agent = $_SERVER['HTTP_USER_AGENT'];

if (stristr($agent,"MSIE")){

header ("Location: ie.php");

}

else {

header ("Location: other.php");

}


?>

</body>

</html>

*/

- ----- Original Message ----- 
From: John Wards 
To: users@httpd.apache.org 
Sent: Friday, August 30, 2002 11:13 AM
Subject: Re: [users@httpd] Allow Redirect


whats on line 5 of printers.php? as thats your problem

Also this should be on a PHP list like php-general@lists.php.net

John Wards
SportNetwork.net
  
- ----- Original Message ----- 
From: Luis Moreira 
To: users@httpd.apache.org 
Sent: Friday, August 30, 2002 11:10 AM
Subject: [users@httpd] Allow Redirect


Hi

    I'm using Apache 1.3 with PHP and MySQL

    When using the PHP function "header"  to redirect a page, I keep
getting an error 

Warning: Cannot add header information - headers already sent by
(output started at c:\myweb\printers.php:5) in c:\myweb\printers.php
on line ...


    Any hints ?

    Thanks







- ----------------------------------------------------------------------
- ----------


- ---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server
Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org

-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 7.0.3 for non-commercial use <http://www.pgp.com>

iQA/AwUBPW9N3Sqf8lmE2RZkEQL1EgCgwHSomWz9mOo7rFdcrjb/7ej+l4kAoJNB
xLRhXHMY1uJWTy5/uSxWNaFc
=T9PM
-----END PGP SIGNATURE-----


Mime
View raw message