#Replace ".txt" extension of this file to ".php". Delete this note. #Also, replace [USERNAME] [PASSWORD] [DATABASENAME] and [TABLENAME] with your own values. Can't connect to database!

" ); exit(); } //Gather the data and define the database. $somedata = $_GET["somedata"]; $db = ("[DATABASENAME]"); //Formulate the SQL query for entering data in a table. $sql = "INSERT into [TABLENAME} values('".$somedata."') "; //Run the query $doit = mysql_db_query($db, $sql); //If the query does not run correctly, explain. If it does, congratulate! if (!$doit) { echo("It didn't work because of this: " .mysql_error()); } else echo ("Data entered!"); //Close database mysql_close($open); ?>