<?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[Aiuto Gestione di un form iscrizione a numero chiuso]]></title><description><![CDATA[<p dir="auto">Ho la necissità di inserire in un sito un form per l'iscrizione a un percorso psicologico che prevede un massimo di 20 persone per volta.<br />
Il form che vorrei realizzare deve darmi la passibilità che al <a href="http://21.mo" rel="nofollow ugc">21.mo</a> iscritto al submit invece di inviarmi i dati alla mail aprisse una pagina info che riporta la data della successiva sottoscrizione. Il codice php che utilizzo è autogenerato da un WYSIWYG questo perchè di php ne sò poco o niente, comunque il codice è il seguente</p>
<p dir="auto">&lt;?php<br />
function ValidateEmail($email)<br />
{<br />
$pattern = '/^(<a href="%5B-.%5Cw%5D*%5B0-9a-z%5D">0-9a-z</a><em>@(([0-9a-z])+([-\w]</em>[0-9a-z])*.)+[a-z]{2,6})$/i';<br />
return preg_match($pattern, $email);<br />
}<br />
if($_SERVER['REQUEST_METHOD'] == 'POST')<br />
{<br />
$mailto = 'mymail';<br />
$mailfrom = isset($_POST['email']) ? $_POST['email'] : $mailto;<br />
$subject = 'Contact Information';<br />
$message = 'Values submitted from web site form:';<br />
$success_url = '';<br />
$error_url = '';<br />
$error = '';<br />
$autoresponder_from = 'mymail;<br />
$autoresponder_subject = 'grazie';<br />
$autoresponder_message = 'grazie grazie';<br />
$eol = "\n";<br />
$max_filesize = isset($_POST['filesize']) ? $_POST['filesize'] * 1024 : 1024000;<br />
$boundary = md5(uniqid(time()));<br />
$header  = 'From: '.$mailfrom.$eol;<br />
$header .= 'Reply-To: '.$mailfrom.$eol;<br />
$header .= 'MIME-Version: 1.0'.$eol;<br />
$header .= 'Content-Type: multipart/mixed; boundary="'.$boundary.'"'.$eol;<br />
$header .= 'X-Mailer: PHP v'.phpversion().$eol;<br />
if (!ValidateEmail($mailfrom))<br />
{<br />
$error .= "The specified email address is invalid!\n&lt;br&gt;";<br />
}<br />
if (!empty($error))<br />
{<br />
$errorcode = file_get_contents($error_url);<br />
$replace = "##error##";<br />
$errorcode = str_replace($replace, $error, $errorcode);<br />
echo $errorcode;<br />
exit;<br />
}<br />
$internalfields = array ("submit", "reset", "send", "captcha_code");<br />
$message .= $eol;<br />
$message .= "IP Address : ";<br />
$message .= $<em>SERVER['REMOTE_ADDR'];<br />
$message .= $eol;<br />
foreach ($<em>POST as $key =&gt; $value)<br />
{<br />
if (!in_array(strtolower($key), $internalfields))<br />
{<br />
if (!is_array($value))<br />
{<br />
$message .= ucwords(str_replace("</em>", " ", $key)) . " : " . $value . $eol;<br />
}<br />
else<br />
{<br />
$message .= ucwords(str_replace("</em>", " ", $key)) . " : " . implode(",", $value) . $eol;<br />
}<br />
}<br />
}<br />
$body  = 'This is a multi-part message in MIME format.'.$eol.$eol;<br />
$body .= '--'.$boundary.$eol;<br />
$body .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol;<br />
$body .= 'Content-Transfer-Encoding: 8bit'.$eol;<br />
$body .= $eol.stripslashes($message).$eol;<br />
if (!empty($_FILES))<br />
{<br />
foreach ($_FILES as $key =&gt; $value)<br />
{<br />
if ($_FILES[$key]['error'] == 0 &amp;&amp; $_FILES[$key]['size'] &lt;= $max_filesize)<br />
{<br />
$body .= '--'.$boundary.$eol;<br />
$body .= 'Content-Type: '.$_FILES[$key]['type'].'; name='.$_FILES[$key]['name'].$eol;<br />
$body .= 'Content-Transfer-Encoding: base64'.$eol;<br />
$body .= 'Content-Disposition: attachment; filename='.$_FILES[$key]['name'].$eol;<br />
$body .= $eol.chunk_split(base64_encode(file_get_contents($_FILES[$key]['tmp_name']))).$eol;<br />
}<br />
}<br />
}<br />
$body .= '--'.$boundary.'--'.$eol;<br />
mail($mailto, $subject, $body, $header);<br />
$autoresponder_header  = 'From: '.$autoresponder_from.$eol;<br />
$autoresponder_header .= 'Reply-To: '.$autoresponder_from.$eol;<br />
$autoresponder_header .= 'MIME-Version: 1.0'.$eol;<br />
$autoresponder_header .= 'Content-Type: text/plain; charset=ISO-8859-1'.$eol;<br />
$autoresponder_header .= 'Content-Transfer-Encoding: 8bit'.$eol;<br />
$autoresponder_header .= 'X-Mailer: PHP v'.phpversion().$eol;<br />
mail($mailfrom, $autoresponder_subject, $autoresponder_message, $autoresponder_header);<br />
header('Location: '.$success_url);<br />
exit;<br />
}<br />
?&gt;</p>
<p dir="auto">Non saprei veramente da dove cominciare per inserire e come inserire il numero chiuso, qualcuno può aiutarmi o indicarmi qualche script già pronto<br />
Grazie</p>
]]></description><link>https://dev.connect.gt/topic/174456/aiuto-gestione-di-un-form-iscrizione-a-numero-chiuso</link><generator>RSS for Node</generator><lastBuildDate>Wed, 25 Nov 2026 21:36:42 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/174456.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 17 Jul 2012 14:03:20 GMT</pubDate><ttl>60</ttl></channel></rss>