homepage Welcome to WebmasterWorld Guest from 54.196.195.158
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
PHP ready?
Acternaweb




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

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; ?>

 

sugarkane




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

If you had this in a file.php then it shows that your site isn't set up for PHP :(

toadhall




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

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? ;)

sugarkane




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

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.

Acternaweb




msg:1310830
 3:43 pm on Jul 31, 2001 (gmt 0)

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

: (

toadhall




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

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.

toolman




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

chmod the file to 666 and it should work.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved