This is how it continues...
1.Create a MySQL database e.g "db_name".
2.Create a php-file with the name poll.php.
3.Fill in the proper "localhost","username","password","db_name"... things with your settings from the database.
Code: Select all
<?php
//connect to server and select database
$conn = mysql_connect("e;localhost"e;, "e;username"e;, "e;password"e;) or die(mysql_error());
mysql_select_db("e;db_name"e;,$conn) or die(mysql_error());
if (isset($_POSTї'browser']) && !empty($_POSTї'browser']))
mysql_query("e;UPDATE browser SET tally=tally+1 WHERE name='{$_POSTї'browser']}'"e;);
$result = mysql_query("e;SELECT name, tally FROM browser"e;) or die(mysql_error());
$num_rows = mysql_num_rows($result);
?>
<html>
<head>
<meta http-equiv="e;Content-Language"e; content="e;en-us"e;>
<title>Your Home-Page :: Poll</title>
<link rel="e;shortcut icon"e; href="e;interface/favicon.ico"e;>
<link href="e;/themes/modern/style.css"e; rel="e;stylesheet"e; type="e;text/css"e;>
</head>
<body>
<br>
<br>
<br>
<br>
<center>
<h2>Here are the results !!!</h2>
<h3>Number of browsers: <?PHP echo $num_rows; ?></h3>
<table width="e;300"e; border="e;1"e;>
<?PHP
while ($row = mysql_fetch_array($result)) {
?>
<tr>
<td width="e;80"e;>
<b><?PHP echo $rowї'name']; ?></b>
</td>
<td width="e;50"e;>
<b><?PHP echo $rowї'tally']; ?></b>
</td>
</tr>
<?PHP
}
?>
</table>
<br>
<a href="e;http://www.your-homepage.com"e;>Go back to <b>your-homepage.com</b></a>
</center>
</body>
</html>
...and it worked !!!
TODO : I will try
not to use a database (MySQL, MS-SQL or other !!!)
Any suggestions could be very helpful !