corgen
08-09-2015, 12:12
Salve, non riesco a effettuare il controllo dei due campi nel form che segue.
L'obiettivo è quello di impedire lo script se i campi "Nome e cognome" e "Commento" sono vuoti.
Potreste aiutarmi?
}else if(isset($_GET['sign'])){
if(isset($_POST['sign']) && !$_SESSION['xmlGuestbook_check_spam']){
$this->sign();
$_SESSION['xmlGuestbook_check_spam'] = (($this->allowspam) ? false:true);
}else if($_SESSION['xmlGuestbook_check_spam']){
echo "<h2 style=\"text-decoration: underline;\">It seems that you've recently signed our guestbook. Thank You!</h2>";
}else{
echo '<div class="div">Nome e cognome</br>
<form name="sign" method="post" action="#">
<input type="text" name="name" class="div" style="width: 100%;">Commento</br>
<div style="float: center; padding-right: 0px;">
<textarea cols=100% rows=7 name="comments" class="div" style="width: 100%;"></textarea>';
echo '</div>
<p style="clear: both">
<input type="submit" name="sign" value="Invia commento" class="div" style="background-color: #FFCC33; width: 100%; cursor: pointer;">
</form><p style="font-size: 11px; color: gray;">
</p>
</div>';
}
L'obiettivo è quello di impedire lo script se i campi "Nome e cognome" e "Commento" sono vuoti.
Potreste aiutarmi?
}else if(isset($_GET['sign'])){
if(isset($_POST['sign']) && !$_SESSION['xmlGuestbook_check_spam']){
$this->sign();
$_SESSION['xmlGuestbook_check_spam'] = (($this->allowspam) ? false:true);
}else if($_SESSION['xmlGuestbook_check_spam']){
echo "<h2 style=\"text-decoration: underline;\">It seems that you've recently signed our guestbook. Thank You!</h2>";
}else{
echo '<div class="div">Nome e cognome</br>
<form name="sign" method="post" action="#">
<input type="text" name="name" class="div" style="width: 100%;">Commento</br>
<div style="float: center; padding-right: 0px;">
<textarea cols=100% rows=7 name="comments" class="div" style="width: 100%;"></textarea>';
echo '</div>
<p style="clear: both">
<input type="submit" name="sign" value="Invia commento" class="div" style="background-color: #FFCC33; width: 100%; cursor: pointer;">
</form><p style="font-size: 11px; color: gray;">
</p>
</div>';
}