<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[invio email al db]]></title><description><![CDATA[<p dir="auto">salve gente ho un problema che spero mi aiutiate a risolvere io voglio salvare le mail nel  database   io ho usato  due files  uno config e uno  mailform</p>
<p dir="auto">posto il  mail form.php</p>
<pre><code class="language-php">&lt;?  
include 'config.php';
$adminaddress = "info@actionscriptnews.com"; 
$siteaddress ="http://www.actionscriptnews.com"; 
$sitename = "actionscriptnews.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 "&lt;BR&gt;&lt;A HREF=\"http://www.marikweb.com/homeita/\"&gt;Ritorna alla registrazione&lt;/A&gt;"; 
} 
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 (name,cognome,email,telefono,oggetto,comments) VALUES('$name','$cognome','$email','$telefono','$oggetto','$comments')"; 
if (mysql_query($sql_insert))
{ 
echo "OK RIGA INSERITA &lt;br /&gt;";
} 
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;
} 

} 
?&gt;
</code></pre>
<pre><code class="language-php">&lt;?php
$CONFIG['host'] = "localhost";
$CONFIG['user'] = "rocco";
$CONFIG['pass'] = "maurizio";
$CONFIG['dbname'] = "user35512_7777";
$CONFIG['expire'] = 60;
$CONFIG['regexpire'] = 24; //in ore
$CONFIG['expire'] = 60;
$CONFIG['regexpire'] = 24; //in ore
$CONFIG['check_table'] = array(
"name" =&gt; "check_global",
"email" =&gt; "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");
 ?&gt;
 
tabella#################################
[CODE]      
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`)
)
 
[/CODE]
</code></pre>
]]></description><link>https://dev.connect.gt/topic/48484/invio-email-al-db</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 04:14:31 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/48484.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 27 Sep 2007 23:40:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to invio email al db on Fri, 28 Sep 2007 18:02:41 GMT]]></title><description><![CDATA[<p dir="auto">si c e un controllo nel config</p>
]]></description><link>https://dev.connect.gt/post/608805</link><guid isPermaLink="true">https://dev.connect.gt/post/608805</guid><dc:creator><![CDATA[rocco.mod]]></dc:creator><pubDate>Fri, 28 Sep 2007 18:02:41 GMT</pubDate></item><item><title><![CDATA[Reply to invio email al db on Fri, 28 Sep 2007 17:46:28 GMT]]></title><description><![CDATA[<p dir="auto">Per controllo ti riferisci alla funzione <strong>check_email</strong> giusto ?</p>
]]></description><link>https://dev.connect.gt/post/608801</link><guid isPermaLink="true">https://dev.connect.gt/post/608801</guid><dc:creator><![CDATA[mz]]></dc:creator><pubDate>Fri, 28 Sep 2007 17:46:28 GMT</pubDate></item><item><title><![CDATA[Reply to invio email al db on Fri, 28 Sep 2007 17:29:22 GMT]]></title><description><![CDATA[<p dir="auto">ciao ho risolto  comunque  era che  non avevo messo nel db   id aut increment  comunque  adesso ho un altro problema  togliere il controllo sull email cioe  se trova l email   adesso  non me la scrive perche c e   toglerlo questo controllo</p>
]]></description><link>https://dev.connect.gt/post/608807</link><guid isPermaLink="true">https://dev.connect.gt/post/608807</guid><dc:creator><![CDATA[rocco.mod]]></dc:creator><pubDate>Fri, 28 Sep 2007 17:29:22 GMT</pubDate></item><item><title><![CDATA[Reply to invio email al db on Fri, 28 Sep 2007 17:25:46 GMT]]></title><description><![CDATA[<p dir="auto">quali sono gli errori che hai utilizzando quei due file ?</p>
]]></description><link>https://dev.connect.gt/post/608800</link><guid isPermaLink="true">https://dev.connect.gt/post/608800</guid><dc:creator><![CDATA[mz]]></dc:creator><pubDate>Fri, 28 Sep 2007 17:25:46 GMT</pubDate></item></channel></rss>