php code within <html> not showing

Reply

Join Date: Nov 2007
Posts: 227
Reputation: k2k is an unknown quantity at this point 
Solved Threads: 0
k2k k2k is offline Offline
Posting Whiz in Training

php code within <html> not showing

 
0
  #1
Feb 5th, 2009
i don't know why my php code within the <html> doesn't work at all.
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta name="xsoldier2006" content="xsoldier2006, 2006, xsoldier, henry li, veteran 2006" />
  5. <link rel="stylesheet" type="text/css" href="css/text.css"/>
  6. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  7. <title>Xsoldier_Home</title>
  8. </head>
  9.  
  10. <body bgcolor="#333333">
  11. <?php
  12. $count = $_COOKIE[ 'visits' ];
  13. if( $count == "")
  14. {
  15. $count = 1;
  16. }
  17.  
  18. else
  19. {
  20. $count++;
  21. }
  22.  
  23. setcookie("visits", $count);
  24. echo "you are visitor number $count";
  25. ?>
  26. </body>
  27. </html>

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

thanks
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 1,227
Reputation: kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about kkeith29 has a spectacular aura about 
Solved Threads: 167
kkeith29's Avatar
kkeith29 kkeith29 is offline Offline
Nearly a Posting Virtuoso

Re: php code within <html> not showing

 
0
  #2
Feb 5th, 2009
did you save the page with a php extension? ex. page.php
Reply With Quote Quick reply to this message  
Join Date: Nov 2007
Posts: 227
Reputation: k2k is an unknown quantity at this point 
Solved Threads: 0
k2k k2k is offline Offline
Posting Whiz in Training

Re: php code within <html> not showing

 
0
  #3
Feb 5th, 2009
yes, i saved it as index.php...this is weird. i just save a text doc with code below index.php
  1. <?php
  2. echo "hi";
  3. ?>
and it wouldn't work... i had done more php than this ,, i can't figure it out what happened.
Reply With Quote Quick reply to this message  
Join Date: Jul 2005
Posts: 154
Reputation: katarey is an unknown quantity at this point 
Solved Threads: 20
katarey's Avatar
katarey katarey is offline Offline
Junior Poster

Re: php code within <html> not showing

 
0
  #4
Feb 5th, 2009
hi,

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

Rahul
Last edited by katarey; Feb 5th, 2009 at 4:32 pm.
Freelance Web Designer & Developer
Http//www.Katarey.com
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC