Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 19
  1. #1
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804

    creare i controlli di campo ad un form per l invio delle email

    ragazzi salve ho un problema mi potreste aiutare vi spiego dovrei inserire ad un form i controlli per i campi adesso c e solo il controllo della captka comunque ragazzi dovrebbe funzionare cosi il form controlla i campi se i campi sono vuoti da un messaggio che il campo nome tipo non puo essere lasciato vuoto ecc ecc ma questo deve avvenire come al controllo della captka che mi avviene nella pagina del form mi potreste aiutare posto i codici .php
    questo e il files contatti.php
    Codice PHP:
    <?php

    session_start
    ();
    include(
    'phpcaptcha/captchaCheck.php');
    include_once (
    "includes/include.php");
    $ip $_SERVER['REMOTE_ADDR'];
    $date date('Y-m-d H:i:s'); 

    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Documento senza titolo</title>
    <script type="text/javascript" src="script-javascript/flashobject.js"></script>
    <SCRIPT TYPE="text/javascript" SRC="script-javascript/content.js"></SCRIPT>
    <script src="script-javascript/AC_RunActiveContent.js" type="text/javascript"></script>
    <script type="text/javascript">
    _uacct = "UA-312115-1";
    </script>
    <script type="text/JavaScript" src="popup.js"> </script>
      <script type="text/JavaScript">
    <!--
    document.oncontextmenu = nocontextmenu; 
    document.onmousedown = norightclick; 
    if (window.Event) 
      document.captureEvents(Event.MOUSEUP); 

    function norightclick(e) 
    { if (window.Event) 
      { if (e.which == 2 || e.which == 3) 
        { return false; } 
      } 
      else 
      { if (event.button == 2 || event.button == 3) 
        { event.cancelBubble = true 
          event.returnValue = false; 
          return false; 
        } 
      } 

    function nocontextmenu() 
    { event.cancelBubble = true 
      event.returnValue = false; 
      return false; 

    //-->
    </script>
    <script type="text/javascript">
    <!--
    self.moveTo(0,0); 
    self.resizeTo(screen.availWidth,screen.availHeight);
    //-->
    </script>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link href="stili-css/marik.css" rel="stylesheet" type="text/css">
    <style  type="text/css" media="all"> 
    <!--
    html, body{
        width: 100% ;
      text-align: center; 
        margin:0;
        padding:15; 
        font-family: Arial, Helvetica, sans-serif;
        font-size: 12px;
    }

    #principale{
        background-color: #eeeeee;
        width:1024px;
        border: 3px solid #dddddd;     
        margin:0 auto;
      

        

        
    }
    </style>
    <script type="text/javascript">
    function resetta()
    {
        var obj=document.getElementById('captchaForm');
        var n=obj.elements.length;
        for(var i=0;i<n;i++){if(obj.elements[i].type == "text" || obj.elements[i].type == 'textarea'){obj.elements[i].value = ''}};
        return false;
    }
    </script>
    </head>
    <body <?php if(isset($error) && $error==1){echo 'onload="document.forms[0].scratch_submit.focus()"';} ?>>

    <div id = "principale" align="center" >
         
      <div id ="menu"  > 
        <script type="text/javascript">
                var fo = new FlashObject("flash/banner.swf", "Menu", "1024", "300", "false", "");
                fo.addParam("quality", "high");
                fo.addParam("menu", "false");
                fo.write("menu");
            </script>
      </div>
        <div class="content_form">
        
            <form id="captchaForm" name="captchaForm" method="post" action="">
             <?php if($error == 1){ ?>
                  <p class="error">il codice inserito non è corretto</p><?php ?>
                <div class="row">

                </div>
                <div class="row">
    </div>
                <div class="row">
    </div>
                <div class="row"><label for="name">Nome: </label><input name="name" type="text" id="name" size="30" value="<?php if(isset($_POST['name'])){echo $_POST['name'];} ?>" /></div>
                <div class="row"><label for="name">Cognome: </label><input name="surname" type="text" id="surname" size="30" value="<?php if(isset($_POST['surname'])){echo $_POST['surname'];} ?>" /></div>
                <div class="row"><label for="address">Telefono: </label><input name="telephone" type="text" id="telephone" size="30" value="<?php if(isset($_POST['telephone'])){echo $_POST['telephone'];} ?>" /></div>
                <div class="row"><label for="address">Oggetto: </label><input name="sub" type="text" id="sub" size="30" value="<?php if(isset($_POST['sub'])){echo $_POST['sub'];} ?>" /></div>
                <div class="row"><label for="email">Email: </label><input type="text" name="email" size="30" value="<?php if(isset($_POST['email'])){echo $_POST['email'];} ?>" /> </div>
                <div class="row"><label for="comments">Messaggio: </label><textarea name="comments" cols="23" rows="5" id="comments"><?php if(isset($_POST['comments'])){echo $_POST['comments'];} ?></textarea>
                <div id ="infoutente">
                <div class="row"><? echo "$ip";?></div>
                <div class ="row"><? echo "$date?></div>
          </div>
        </div>
                <div class="row">
    </div>
        
              <div class="clear"></div>
              

    </p>
                <div class="cpt">[img]phpcaptcha/captchaImage.php[/img]<input type="text" id="captcha_input" name="captcha_input" size="15" /></div>
                
             
                <div class="inp" style="text-align:center"><label for="submit"></label><input type="submit" name="scratch_submit" id="scratch_submit" value="Send Form" /><label for="reset"></label><input type="reset" name="Reset" id="Reset" value="Reset" onClick="return resetta()">
              </div>
            </form>
        </div>
          <div class ="power">
        <div><? echo _NOME_BOLD_ ?></div>
      </div> 
     <div class="separator">  
      <div id="footer">&copy; Copyright 2006-2007 By :[url="http://www.rcwebagency.it"]<span><? echo POWERED_BY ?></span>[/url]</div> 
    </div> 
    </div>
    <div align="center"></div>
    </body>
    </html>
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  2. #2
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    questo e il files result.php


    Codice PHP:
    <?
    session_start
    ();
    if(isset(
    $_SESSION['post'])){$post $_SESSION['post'];}else{$post=NULL;}


    if(isset(
    $post['name'])){$_name $post['name'];}else{$_name '';}
    if(isset(
    $post['surname'])){$_surname $post['surname'];}else{$_surname '';}
    if(isset(
    $post['telephone'])){$_telephone $post['telephone'];}else{$_telephone '';}
    if(isset(
    $post['sub'])){$_city $post['sub'];}else{$_city '';}
    if(isset(
    $post['email'])){$_email $post['email'];}else{$_email '';}
    if(isset(
    $post['comments'])){$_comments $post['comments'];}else{$_comments '';}

    echo 
    "Ok! You have inserted the correct captcha code. 

    "
    ;
    echo 
    "You information has been sent 

    "
    ;
    echo 
    "This is what you sent  

    "
    ;

    echo 
    "Your Name: \"" $_name "\" 
    "
    ;
    echo 
    "Your Surname: \"" $_surname "\" 
    "
    ;
    echo 
    "Your Telephone: \"" $_telephone "\" 
    "
    ;
    echo 
    "Your sub: \"" $_sub"\" 
    "
    ;
    echo 
    "Your email: \"" $_email "\" 
    "
    ;
    echo 
    "Your Comments: \"" $_comments "\" 
    "
    ;
                 
    echo 
    'messaggio inviato ';    

    // send form content to an email address
    $mailuser "yourName@yourDomainnNamee.com"// insert destination email address here

    $header "Return-Path: ".$mailuser."\r\n"
    $header .= "From: form with captcha <".$mailuser.">\r\n"
    $header .= "Content-Type: text/html;"
              
    $mail_body '
    The User: '
    $_company .' has sent his input.
    Your Name: '
    $_name '

    Your Surname: '
    $_surname '

    Your Telephone: '
    $_telephone '

    Your Zip: '
    $_sub '

    Your email: '
    $_email '

    Your Comments: '
    $_comments '
    '
    ;    
        
    mail ($mailuser'Form sent'$mail_body$header);
    ?>
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  3. #3
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    ragazzi mi date una mano ?
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  4. #4
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    ragazzi mi date una mano
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  5. #5
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    ragazzi mi date na mano
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  6. #6
    Utente di HTML.it L'avatar di dottwatson
    Registrato dal
    Feb 2007
    Messaggi
    3,012
    Originariamente inviato da rocco.mod
    questo e il files result.php


    Codice PHP:
    <?
    session_start
    ();
    if(isset(
    $_SESSION['post'])){$post $_SESSION['post'];}else{$post=NULL;}


    if(isset(
    $post['name'])){$_name $post['name'];}else{$_name '';}
    if(isset(
    $post['surname'])){$_surname $post['surname'];}else{$_surname '';}
    if(isset(
    $post['telephone'])){$_telephone $post['telephone'];}else{$_telephone '';}
    if(isset(
    $post['sub'])){$_city $post['sub'];}else{$_city '';}
    if(isset(
    $post['email'])){$_email $post['email'];}else{$_email '';}
    if(isset(
    $post['comments'])){$_comments $post['comments'];}else{$_comments '';}

    echo 
    "Ok! You have inserted the correct captcha code. 

    "
    ;
    echo 
    "You information has been sent 

    "
    ;
    echo 
    "This is what you sent  

    "
    ;

    echo 
    "Your Name: \"" $_name "\" 
    "
    ;
    echo 
    "Your Surname: \"" $_surname "\" 
    "
    ;
    echo 
    "Your Telephone: \"" $_telephone "\" 
    "
    ;
    echo 
    "Your sub: \"" $_sub"\" 
    "
    ;
    echo 
    "Your email: \"" $_email "\" 
    "
    ;
    echo 
    "Your Comments: \"" $_comments "\" 
    "
    ;
                 
    echo 
    'messaggio inviato ';    

    // send form content to an email address
    $mailuser "yourName@yourDomainnNamee.com"// insert destination email address here

    $header "Return-Path: ".$mailuser."\r\n"
    $header .= "From: form with captcha <".$mailuser.">\r\n"
    $header .= "Content-Type: text/html;"
              
    $mail_body '
    The User: '
    $_company .' has sent his input.
    Your Name: '
    $_name '

    Your Surname: '
    $_surname '

    Your Telephone: '
    $_telephone '

    Your Zip: '
    $_sub '

    Your email: '
    $_email '

    Your Comments: '
    $_comments '
    '
    ;    
        
    mail ($mailuser'Form sent'$mail_body$header);
    ?>
    Codice PHP:
    <?
    session_start
    ();
    if(isset(
    $_SESSION['post'])){$post $_SESSION['post'];}else{$post=$_POST;}
    nel form
    codice:
    <form id="captchaForm" name="captchaForm" method="post" action="result.php">
    prova così, ma non garantisco niente, in quanto non conosco la reale struttura da cui hai postato questo codice, e dubito che tu sia in grado di dirmi correttamente tutti i giri che fa....


    Non sempre essere l'ultimo è un male... almeno non devi guardarti le spalle

    il mio profilo su PHPClasses e il mio blog laboweb

  7. #7
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    ti faccio sapere grazie
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  8. #8
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    ma i controlli ai campi li fa ?
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  9. #9
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    L HO PROVATO ON LINE MA E VA LA POSTA ARRIVA MA COME POSSO FARE A FAR SI CHE FACCIA IL CONTROLLO DEI CAMPI TIPO SE NON SCRIVI IL NOME DA ERRORE E NON MANDA L EMAIL E CHE UNA VOLTA MANDATO DIA IL RISULTATO ALL INTERNO DELLA PAGINA CONTATTI SOPRA IL FORM TIPO MESSAGGIO INVIATO MI AIUTI HELP
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

  10. #10
    Utente di HTML.it
    Registrato dal
    May 2007
    Messaggi
    1,804
    ho risolto ho rinominato le variabili adesso il prob e chome dare il controllo nome cognome telefono messaggio e come fare a far si che i messaggi d errore apprissero nella paggina contatti dove c e il form
    Non è tanto importante saper fare,quanto ad avere voglia d imparare .

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.