RSS Forums RSS
Please support our PHP advertiser: Lunarpages PHP Web Hosting

Simple PHP Question

Join Date: Nov 2004
Location: tiny island in indian ocean
Posts: 138
Reputation: anastacia is an unknown quantity at this point 
Rep Power: 5
Solved Threads: 1
anastacia's Avatar
anastacia anastacia is offline Offline
Junior Poster

Solution Re: Simple PHP Question

  #9  
Mar 18th, 2007
Originally Posted by jbennet View Post
Ok here is my code:

 
<html>
 
<head>
<title> PHP Test Page </title>
</head>
 
<body>
 
<?php
 
echo date("H:i");
echo gmdate("M d Y");
 
$counter_file = "count.dat";
 
if(!($fp = fopen($counter_file, "r"))) die ("Cannot open $counter_file.");
$counter = (int) fread($fp, 20);
fclose($fp);
 
$counter++;
 
echo "You're visitor No. $counter.";
$fp = fopen($counter_file, "w");
fwrite($fp, $counter);
fclose($fp);
 
?>
</body>
 
</html>
 

this makes output saying:

 
18:32Mar 12 2007You're visitor No. 5. 
 

how can i make it so that they are on different lines, e.g

 
18:32
Mar 12 2007
You're visitor No. 5. 
 




Just use a <br> tags within an echo. like this


echo' <br>';

after each output that you want to see
:lol: I am not one of those who wait for things to happen, :p but one of those who make things happen ;)
Reply With Quote  
Forums | Blogs | Tutorials | Code Snippets | Whitepapers | RSS Feeds | Advertising
All times are GMT -4. The time now is 1:17 pm.
Newsletter Archive - Sitemap - Privacy Statement - Contact Us
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC