Ciao a tutti,
questo è un codice ph. che io ho inserito in una struttura grafica scritta in Html. Allora io nn sono un esperto di html ne tantomeno di php, però per un sito che ho fatto in precedenza ero riuscito a farmela funzionare. Ora vorrei riutilizzare lo stesso codice utilizzato in precedenza, cambiando solo la parte html. però ora nn mi funziona, nel senso che quando invio la form mi visualizza tuto il codice php, nn dandomi i diversi risultati se la form è compilata o meno..
mi potreste aiutare a capire perchè?
questo è il codice:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title></title>
<link href="strys.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
background-color: #ffffff;
}
.Stile2 {color: #acaead}
a:link {
color: #acaead;
text-decoration: none;
}
a:visited {
color: #999999;
text-decoration: none;
}
a:hover {
color: #333333;
text-decoration: none;
}
a:active {
text-decoration: none;
}
#apDiv10 {
left:154px;
top:566px;
width:420px;
height:100px;
z-index:1;
font-family: Helvetica, sans-serif, Verdana, Arial;
font-size: 10px;
color: #acaead;
padding-top: 15px;
font-weight: normal;
padding-right: 35px;
}
a:link#apDiv10{
color: #00CC33;
}
#apDiv10F {
left:154px;
top:128px;
width:195px;
height:435px;
float: left;
z-index:1;
font-family: Helvetica, sans-serif, Verdana, Arial;
font-size: 10px;
color: #acaead;
padding-top: 15px;
font-weight: normal;
padding-left: 15px;
padding-right: 35px;
}
a:link#apDiv10F{
color: #00CC33;
}
.Stile3 {
font-size: 12px;
font-family: Helvetica, sans-serif, Verdana, Arial;
margin-top: 20px;
margin-bottom: 20px;
}
#apDiv13 {
top:781px;
width:1000px;
height:150px;
z-index:1;
background-color: #000000;
}
#apDiv14 {
left:69px;
top:auto;
width:auto;
height:95px;
z-index:1;
}
.Stile4 {color: #999999; font-size: 14px; }
.Stile6 {font-size: 10px}
#apDiv15 {
left:181px;
top:19px;
width:225px;
height:63px;
z-index:1;
padding-top: 10px;
border-top-style: none;
}
.Stile7 {
font-size: 18px;
color: #225b97;
font-weight: bold;
}
.Stile8 {
color: #FF6600;
}
.Stile8_ {
color: #666666;
}
#apDiv16 {
width:826px;
height:252px;
margin-top: 0;
margin-right: auto;
margin-bottom: 0;
margin-left: auto;
padding-top: 10px;
}
#apDiv17 {
width:243px;
height:55px;
float: right;
background-image: url(from.jpg);
padding-top: 15px;
background-repeat: no-repeat;
padding-left: 18px;
padding-bottom: 0px;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 16px;
color: #FFFFFF;
text-transform: none;
font-weight: bold;
}
-->
</style>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>
<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-9977465-1']);
_gaq.push(['_trackPageview']);
(function() {
var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
</script>
</head>
<body>
<div id="apDiv1">
<div id="apDiv2"></div>
<div id="apDiv3">
<div id="apDiv8">
<div align="right"><span class="Stile2">Home | Prodotti | Servizi | Richiedi offerta | Contatti</span></div>
</div>
</div>
<div id="apDiv4">
<?php
$cRate = $_POST['cRate'];
$Nome = $_POST['Nome'];
$Email = $_POST['Email'];
$Azienda = $_POST['Azienda'];
$Codice_Pendrive = $_POST['Codice_Pendrive'];
$Quantitativo = $_POST['Quantitativo'];
foreach($_POST as $field => $value)
{
if (empty($value)) {
echo "<span style='font-family: arial'> Non hai inserito tutti i campi richiesti.</span></br>";
echo "<span style='font-size:14px'>torna alla pagina di invio</span>";
exit();
}
}
# Send to your email address
$sendTo = "";
# Subject line
$subject = "MESSAGGIO DAL SITO Ordine";
# Send from address
$sendFrom = "FROM: ";
# Body
$body = "Le informazioni sono: \n \n Nome e Cognome: " . stripslashes($_POST["Nome"]) . " \n Azienda: " . stripslashes($_POST["Azienda"]) . "\n Indirizzo E-MAIL: " . stripslashes($_POST["Email"]) . "\n Telefono: " . stripslashes($_POST["Telefono"]). "\n cod. #: " . stripslashes($_POST["Codice_Pendrive"]) . "\n Quantitativo: " . stripslashes($_POST["Quantitativo"]). "\n Memoria: " . stripslashes($_POST["cRate"]) . "\n Messaggio: " . stripslashes($_POST["Testo_Richiesta"]);
mail($sendTo, $subject, $body, $sendFrom);
?>
<p width="900" align="center"> La richiesta è andata a buon fine. Grazie per averci contattato</p>
  </p>
</div>
<div id="apDiv8B">
<div align="right"><span class="Stile2">Mappa del sito | Contatti
GSF Business Consultants srl
Viale di Villa Grazioli 1, 00198 Roma</p></span></div>
</div>
<div id="apDiv12">
<div align="left"></div>
<div id="apDiv10">
<div align="left">
</p>
</div>
</div>
</div>
</div>
<div align="center" class="Stile3">2009 | All right reserved privacy | int</div>
</body>
</html>