Ho questo script a cui vorrei aggiungere la possibilità di visualizzare in fondo alla tabella l'ip e le altre info-server del visitatore, senza ovviamente toccare la pagina html.
Le ho provate in tanti modi...ma non ci riesco.
Spero che un esperto in php sia così gentile da aiutarmi.
<?
/**
* GC_Formmail 1.2
* Data creazione: 17/2/2005
* Data ultima modifica: 21/2/2005
* Author: Giuseppe Calbi <peppiniel@peppiniel.com>
* Website: http://www.giuseppecalbi.com
*
**/
// Non toccare NULLA in questo file
include "config.php";
$version = "1.2";
if ($act == 1)
{
echo getCredits();
return;
}
$key = array ();
$val = array ();
$output = "";
$senderNames = array ($senderNames);
foreach($_POST as $chiave=>$valore)
{
// <Input type=qualunque name=chiave value=valore>
array_push ($key, $chiave);
array_push ($val, eregi_replace("\\\\'", "'", $valore));
if (!empty($emailField))
{
if ($chiave == $emailField)
{
$emailMittente = $valore;
}
}
if (!empty($subjectField))
{
if ($chiave == $subjectField)
{
$subject = $valore;
}
}
if (!empty($senderNames))
{
for ($i = 0; $i < count ($senderNames); $i++)
{
if ($chiave == $senderNames[$i])
{
$nome .= $valore." ";
}
}
}
}
if (!empty($subject))
{
$oggetto .= " - ".$subject;
}
if ($html)
{
$output = getHtmlOutput ($key, $val);
$intestazioni = "MIME-Version: 1.0\r\n";
$intestazioni .= "Content-type: text/html; charset=iso-8859-1\r\n";
}
else
{
for ($i = 0; $i < count ($key); $i++)
{
$output .= $key[$i].": ".$val[$i]."\n";
}
$intestazioni = "";
}
if ( (!empty($emailMittente)) || (!empty($nome)) )
{
$intestazioni .= "From: ".$nome."<".$emailMittente."> \r\n";
}
else
{
$intestazioni .= "From: ".$mittente."\r\n";
}
if (!mail($destinatari, $oggetto, $output, $intestazioni))
{
echo "
".$messaggioErrore."
".getHtmlOutput($key, $val)."
".getCredits();
if (strlen($paginaErrore) < 5)
{
exit ();
}
else
{
echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=".$paginaErrore."\">";
}
}
echo "
".$messaggioConferma."
".getHtmlOutput($key, $val)."
".getCredits();
if (strlen($paginaConferma) < 5)
{
exit ();
}
else
{
echo "<META HTTP-EQUIV=Refresh CONTENT=\"0; URL=".$paginaConferma."\">";
}
function getHtmlOutput ($k, $v)
{
global $stripsHtml;
global $tagAllowed;
$return = "<center><div style=\"width: 322; height: 147; text-align: center\">";
$return .= "<fieldset style=\"font-family: Verdana; font-size: 10pt; color: #008080; font-weight: bold; border: 3px double #F3C65C; background-color: #F4F5FF\">";
$return .= "<legend align=center>Dati inseriti</legend>";
$return .= "<table border=0 cellpadding=3 style=\"border-collapse: collapse; font-family:Verdana; font-size:10pt; color:#4062EA\" bordercolor=#111111 cellspacing=5 width=300>";
$return .= "<colgroup span=1 style=\"text-align:right; font-weight: bold; background-color: #DDE8FF\"></colgroup>";
for ($i = 0; $i < count ($k); $i++)
{
$v[$i] = eregi_replace ("\n", "
", $v[$i]);
if ($stripsHtml)
{
$v[$i] = strip_tags ($v[$i], $tagAllowed);
}
$return .= "<tr><td width=\"30%\">".$k[$i].": </td><td>".$v[$i]."</td></tr>";
}
$return .= "</table></fieldset></div></center>";
return $return;
}
function getCredits ()
{
global $version;
$return = "
";
return $return;
}
?>