buona sera vorrei salvare lemail dentro un db adesso ho preso due files uno config l ho chiamato e l altro mail form pero non arrivo a capire perche non mi salva i dati dentro il db ho creato una tabella
chiamata contact mi aguro che qualcuno mi aiuti dov e l errore secndo voi?
codice:
CREATE TABLE `contact` (
  `id` int(40) NOT NULL default '0',
  `date` datetime NOT NULL default '0000-00-00 00:00:00',
  `name` varchar(50) NOT NULL default '',
  `cognome` varchar(50) NOT NULL default '',
  `email` varchar(100) NOT NULL default '',
  `telefono` varchar(50) NOT NULL default '',
  `oggetto` varchar(100) NOT NULL default '',
  `comments` text NOT NULL,
  `ip` varchar(15) NOT NULL default '',
  PRIMARY KEY  (`id`)
)
e questi sono i files mailform
Codice PHP:
<?  
$adminaddress 
"info@xxxxxxxxxxxxxxx.com"
$siteaddress ="http://www.xxxxxxxxxxxxxxxxxxxx.com"
$sitename "xxxxxxxxxxxxxxxx.com"


//No need to change anything below ... 
// Gets the date and time from your server
$date date("m/d/Y H:i:s");

// Gets the IP Address
if ($REMOTE_ADDR == ""$ip "no ip";
else 
$ip getHostByAddr($REMOTE_ADDR);

// Gets the POST Headers - the Flash variables
$action $HTTP_POST_VARS['action'] ;
$email $HTTP_POST_VARS['email'] ;
$name $HTTP_POST_VARS['name'] ;
$cognome $HTTP_POST_VARS['cognome'] ;
$comments $HTTP_POST_VARS['comments'] ;
$telefono $HTTP_POST_VARS['telefono'] ;
$oggetto $HTTP_POST_VARS['oggetto'] ;

//Process the form data!
// and send the information collected in the Flash form to Your nominated email address

if ($action == "send"

//Innanzitutto controlliamo la var.le name: 
$controllo check_email($email); 

if (
$controllo != "OK"

echo 
$controllo

//Qui potresti anche far visualizzare una cosa del genere: 
echo "
<A HREF=\"http://www.marikweb.com/homeita/\">Ritorna alla registrazione</A>"


else 

//Ora inseriamo i dati nel DB. 
//Ovviamente devi creare una tabella in cui inserire i dati ke passi con il post. 


$link_db mysql_connect($CONFIG['host'],$CONFIG['user'],$CONFIG['pass']); 
mysql_select_db($CONFIG['dbname']); 
$sql_insert "INSERT INTO contact (id,date,name,cognome,email,telefono,oggetto,comments,ip) VALUES ('$date','$name','$cognome','$email','$telefono','$oggetto','$comments','$ip')"

if (
mysql_query($sql_insert))

echo 
"OK RIGA INSERITA 
"
;

else
{
die(
mysql_error());


mysql_close($link_db); 



    
//
    
mail ("$adminaddress","informazioni",
    
"Il visitatore ha lasciato le seguenti informazioni \n
    Name: 
$name 
    Email: 
$email\n
    Telefono: 
$telefono 
    Messaggio:
    ------------------------------
    
$comments
    
    Logged Info :
    ------------------------------
    Using: 
$HTTP_USER_AGENT
    Hostname: 
$ip
    IP address: 
$REMOTE_ADDR
    Date/Time:  
$date","FROM:$email) ; 
    
    
//This sends a confirmation to your visitor
    
mail ("$email","Re:"
    
"Salve $name,\n
abbiamo ricevuto il suo messaggio e presto sarà contattato.\n
     Saluti dallo Staff di 
$sitename 
    By
    
$siteaddress","FROM:$adminaddress ") ; 
    
    
//Confirmation is sent back to the Flash form that the process is complete
    
$sendresult "Thank you. You will receive a confirmation email shortly.";
    
$send_answer "answer=";
    
$send_answer .= rawurlencode($sendresult);
    echo 
$send_answer;
//


?>
e questo e il config
Codice PHP:
<?php
$CONFIG
['host'] = "localhost";
$CONFIG['user'] = "root";
$CONFIG['pass'] = "";
$CONFIG['dbname'] = "3333";

$CONFIG['expire'] = 60;
$CONFIG['regexpire'] = 24//in ore
$CONFIG['expire'] = 60;
$CONFIG['regexpire'] = 24//in ore

$CONFIG['check_table'] = array(
"name" => "check_global",
"email" => "check_global"
);
function 
check_email($value)
{
global 
$CONFIG;

$value trim($value);

if ((
$value == ""))
{
echo
"Il campo non può essere lasciato vuoto";
}
else{
$query = @mysql_query("SELECT id FROM contact WHERE email='$value'")or die("Errore nella query");


if (@
mysql_num_rows($query) != 0) return "Email già utilizzata";
else return
"OK";
}
}
//--------------
define('AUTH_LOGGED'99);
define('AUTH_NOT_LOGGED'100);

define('AUTH_USE_COOKIE'101);
define('AUTH_USE_LINK'103);
define('AUTH_INVALID_PARAMS'104);
define('AUTH_LOGEDD_IN'105);
define('AUTH_FAILED'106);

define('REG_ERRORS'107);
define('REG_SUCCESS'108);
define('REG_FAILED'109);

$conn = @mysql_connect($CONFIG['host'], $CONFIG['user'], $CONFIG['pass']) or die('Impossibile stabilire una connessione');
@
mysql_select_db($CONFIG['dbname']) or die("Errore nel DB");
 
?>