Hello....
[Beginning PHP5]
I don't know if i did something wrong or the program really doesn't work
i type the code written on the book... so far so good to the other programs.. but when i reach to the sample program name "Count Page Accesses Page 118 Chapter 3" there is this always an error saying
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\practise\sessions.php on line 15
here is the code i've been working out
Code:
<?php
session_register('view1count');
session_register('view2count');
session_register('view3count');
session_register('view4count');
?>
<?php
echo "<html><head><title>Web Page Hit Counter </title></head><body>";
if(isset($_GET['whichpage'])){
echo "<b> You are currently on page $_GET[whichpage].</b><br><br>\n";
$_SESSION["view".$_GET['whichpage']."count"]++;
}
for ($i=1;$i<=4;$i++){
if(isset($_GET['whichpage'])==$i){
echo "<b><a href=\ "sessions.php?".session_id()."&whichpage=$i">Page $i</a></b>";
}
else{
echo "<a href=\ "sessions.php?".session_id()."&whichpage=$i">Page $i</a>";
}
echo ",which you have chosen ".$_SESSION["view".$i."count"]."times.<br>\n";
}
echo "\n\n<br><br>\n\n";
echo "</body></html>";
?>
THIS IS THE LINE 15 THE BROWSER IS MENTIONING
echo "<b><a href=\ "sessions.php?".session_id()."&whichpage=$i">P age $i</a></b>";
Please Help Out Here..
Thank you very much