I want to record the whios requests people do, not the whois output, in
a MySQL database. Somebody helped me with the code here below, but I get
a parse error when I test it.
Parse error: parse error, unexpected $ in
/home/moo/public_html/whois/index.php on line 32
What can help me out?
<?php
if(!$name) {
print("
<form name=\"\" action=\"$PHP_SELF\" method=\"post\">
<input type=\"text\" name=\"name\">
</form>");
$db_name='databasename';
$db_user='user';
$db_password='password';
$table='whoistracker';
// Connect to the database
$db_conn = mysql_connect("localhost",$db_user,$db_password);
if (!$db_conn)
{
die ("ERROR: Cannot connect to the database.");
//exit();
}
$ip = $REMOTE_ADDR;
$insert="INSERT INTO $table (name,ipaddress) VALUES ('$name','$ip')";
$db_query=mysql_db_query($db_name,$insert);
if($name) {
if($dbquery) { print("Done."); } ELSE { print("Didn't work."); }
?>
--IS
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php