I'm not sure what you need for the second request.
Do you want to display their name (and their visit number?)
i.e.
If so, heres something quick I made.
Index.php- PHP Code:
<!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" dir="ltr" lang="en">
<head>
<title>View your visitor place!</title>
</head>
<body>
<form action="place.php" method="get">
<input name="name" type="text" />
<br />
<input name="submit" type="submit" value="Submit" />
</form>
</body>
</html>
place.php PHP Code:
<?php
/**************IMPORTANT***************/
/*Make sure you CHMOD visit.txt to 777 or 766*/
/**************IMPORTANT***************/
if (isset($_GET['name']) {
$name = $_GET['name']);
$towrite = $name . "\n;";
//Attempts to grab the text file; if none is found, a new one is created
$openfile = fopen("visit.txt", "x+");
//writes the name in visit.txt
fwrite($fp, $towrite);
?>
<!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" dir="ltr" lang="en">
<head>
<title>View your visitor place!</title>
</head>
<body>
<?php
$count = 0;
$filecontent = file_get_contents("visit.txt");
$set = explode(';' , $filecontent);
//output the visits
while (isset($set[$count])) {
echo $count . ") " . $set[$count] . "<br />";
$count++;
}
echo "<br />Your visitor number... " . $count;
fclose($openfile);
?>
</body>
</html>
Just wrote this up quickly, so there might be some errors present.
If you need something else done just ask (if its small i'll do it for free, otherwise it'll cost a small fee to get it done).