I am making a website with different directories for each member. personal directory of each member contains stats file (m_stats.txt) in php format (<?php ?>)
here is one:
These are the stats when the user registers.
Here is the directory where such files are kept.
$a means the user's personal id. Each user have own directory with personal id.
Now when i print this file with the following code, it produces no error but the output contains just <html</html>
This code is kept outside of the 'sitename' directory, ie ../
Please help me displaying such data. (Data is, as shown in code 1, a php array).
Thanks
here is one:
| Code: |
|
<?php $m_stats[206][time][]="1208842123"; $m_stats[206][ip][]="127.0.0.1"; $m_stats[206][iip][]=""; $m_stats[206][agent][]="Opera/9.26 (Windows NT 5.1; U; en)"; $m_stats[206][port][]="4162"; $m_stats[206][via][]=""; $m_stats[206][ref][]="http://localhost/sitename/login.php"; ?> |
These are the stats when the user registers.
Here is the directory where such files are kept.
| Code: |
| "sitename/members/$a/m_stats.txt"; |
$a means the user's personal id. Each user have own directory with personal id.
Now when i print this file with the following code, it produces no error but the output contains just <html</html>
| Code: |
| echo "<table>";
for($a=205;$a<231;$a++) { $file="sitename/members/$a/m_stats.txt"; if(is_file($file)) include($file); //else echo "File: $file does not exist."; for($count=0;$count<count($m_stats[$a][time]);$count++) { //echo $m_stats[$a][ip][$count]; echo "<tr><td>".$m_stats[$a][ip][$count]. "</td><td>".$m_stats[$a][iip][$count]."</td><td>".$m_stats[$a][agent][$count]. "</td><td>".$m_stats[$a][port][$count]."</td><td>".$m_stats[$a][via][$count]. "</td><td>".$m_stats[$a][ref][$count]."</td><td>".strftime('%B %d, %Y, %A %I:%M:%S %p',$m_stats[$a][time][$count])."</td></tr>"; } } echo "</table>"; |
This code is kept outside of the 'sitename' directory, ie ../
Please help me displaying such data. (Data is, as shown in code 1, a php array).
Thanks
