Please help me look at the code... anything wrong with it? I get no error message, but the data are just not getting to the database...
CONFIG.PHP
<?php
############ DATABASE CONFIGURATION ############
$host = "localhost"; // HOST OF THE DATABASE OFTEN localhost
$user = "dragons_mysql"; // YOUR USERNAME FOR THE DB
$pass = ""; // YOUR PASSWORD FOR THE DB
$data = "dragons_dragon"; // YOUR TABLE IN THE DB FOR THE APPLICATION
############ DATABASE CONNECTION ############
IF ($link = @mysql_connect($host, $user, $pass))
{
IF (!@mysql_select_db($data))
{
echo " <P>This script could not connect to the Table you have suggested please examine
this in the config.php page.";
exit();
}
}
ELSE
{
echo " <P>Please make sure you have edited the Database Configuration elements on the config.php
Document correctly. As this script cannot connect to your Database.
<P>The elements that need changing are:
<P>User<BR>
Pass<BR>
Host";
exit();
}
Function DBquery($sql)
{
global $link;
$query = mysql_query($sql);
return $query;
}
?>
POST.PHP
<?php
require("config.php");
//echo "From posted script ";
//echo "Winner :".$winner;
//echo "e_mail :".$e_mail;
$date_now = date('Ymd');
$result = DBquery("INSERT INTO contest1 (winner, e_mail,firstname,lastname,age,country,phone,fav_league,fav_team,ref_email1,ref_email2,newsletter,lang,reg_date)
VALUES ('".$winner."', '".$e_mail."','".$firstname."','".$lastname."','".$age."','".$country."','".$phone."','".$fav_league."','".$fav_team."','".$ref_email1."','".$ref_email2."','".$newsletter."','".$lang."','".$date_now."')");
header("Location: http://en.dragonslot.com");
?>