Welcome to WebmasterWorld Guest from 54.167.175.107

Forum Moderators: coopster & jatar k

PHP ready?

   
2:42 pm on Jul 31, 2001 (gmt 0)

10+ Year Member



How can you tell if your site will handle php?

I tried <?php echo $HTTP_USER_AGENT; ?>
but I didn't get an "answer" just the string <?php echo $HTTP_USER_AGENT; ?>

2:50 pm on Jul 31, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you had this in a file.php then it shows that your site isn't set up for PHP :(
3:31 pm on Jul 31, 2001 (gmt 0)

10+ Year Member



Try this:

<?
$browser = getenv("HTTP_USER_AGENT");
if ($browser) {
echo ("Browser: $browser\n");
} else {
echo ("Sorry, no can do!");
}
?>

Of course if PHP is not available you won't get the "no can do line" anyway but,...
Why not just ask your ISP? ;)

3:39 pm on Jul 31, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If the host hasn't set the server up for PHP, it's 99% certain that any files with a .php extension would be treated as text files - ie the <?php echo $HTTP_USER_AGENT; ?> will actually be output by your browser as plain text.
3:43 pm on Jul 31, 2001 (gmt 0)

10+ Year Member



Thanks, guess they don't have it set up for php because when I go to the page, it tries to download itself.

: (

4:13 pm on Jul 31, 2001 (gmt 0)

10+ Year Member



You might try, as one last test, a .php extension, then again with a .php3 extension. Version 4.x accepts the former; version 3.x the latter.
4:13 pm on Jul 31, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



chmod the file to 666 and it should work.
 

Featured Threads

Hot Threads This Week

Hot Threads This Month