0

i don't know why my php code within the <html> doesn't work at all.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="xsoldier2006" content="xsoldier2006, 2006, xsoldier, henry li, veteran 2006" />
<link rel="stylesheet" type="text/css" href="css/text.css"/> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Xsoldier_Home</title>
</head>

<body bgcolor="#333333">
	<?php 
	$count = $_COOKIE[ 'visits' ];
    if( $count == "")
    {
    	$count = 1;
    }
    
    else
    {
    	$count++;
    }
    
    setcookie("visits", $count);
	echo "you are visitor number $count";
	?>
</body>
</html>

basically i tried just <?php echo "hi" ?> and it wouldn't work too. it gotta be something missing i guess.

thanks

3
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by katarey
0

yes, i saved it as index.php...this is weird. i just save a text doc with code below index.php

<?php
echo "hi";
?>

and it wouldn't work... i had done more php than this ,, i can't figure it out what happened.

0

hi,

which web server you are using ?
do you have installed IIS or Apache with PHP?

Rahul

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.