Visualizzazione risultati 1 fino 10 di 10

Discussione: ...::: PHP: Cercasi Aiuto :::...

  1. #1
    Guest

    Red face ...::: PHP: Cercasi Aiuto :::...

    Salve ragazzi,vi scrivo per il form mail fatto in php che grazie al vostro come sempre prezioso aiuto sono riuscito a modificare per adattare alle mie esigenze, resta sempre il fatto che di php non ci capisco una mazza :grin: . Cmq, bando alle ciance, vi scrivo, per chiedervi l'ennesimo aiuto, devo dare gli ultimi ritocchi a questo form mail, se qualcuno e' interessato ad aiutarmi si faccia vivo, anticipo che non chiedo nulla di complesso per voi, cose facili che in htla o flash saprei inserire anche io , ma trattandosi di php mi trovo spiazzato.

    Se volete posso inserre qui tutto il codice e dirvi di cosa ho bisogno, Fatemi sapere voi. Ciao

  2. #2
    Guest

    Predefinito

    Se volete posso inserre qui tutto il codice e dirvi di cosa ho bisogno
    Sinceramente non ho ben compreso quello che tu vuoi sapere!
    Vorresti modificare la grafica o lo script?
    Spiegati un po' meglio...

  3. #3
    Guest

    Predefinito

    posta il codice del form mail e spiega ciò di cui hai bisogno ...

  4. #4
    Guest

    Predefinito

    Questo e' il codice



    <?


    /////////////////////////////Name Your Form
    $name_form = "Contact Form";
    $Comp_Name = "10Tons";
    $email_address = "talgi@email.it";
    $home_url = "http://www.giovaniin.altervista.org/";

    /////////////////Table and Font Set Up///////////
    $table_width = "510";
    $font_face = "Arial";
    $size = "2";

    ////////////////////////Input 1(yes=1, no=0)
    $add_input1 = "1";
    $check_input1 = "1";
    $input1_name = "Nome e Cognome";

    ////////////////////////Input 2(yes=1, no=0)
    $add_input2 = "0";
    $check_input2 = "0";
    $input2_name = "Cognome";


    /////////////////////////Input 5(yes=1, no=0)
    $add_input5 = "0";
    $check_input5 = "0";
    $input5_name = "Input5";
    ////////Do you want radio Buttons(yes=1, no=0)
    $radio = "0";
    ////////If yes Define Variables here///////////
    $radio1 = "Web Site";
    $radio2 = "Training";
    $radio3 = "Help";
    //////////////Do you want a select(yes=1, no=0)
    $select = "0";
    ////////If yes Define Variables here///////////
    $opt1 = "Design";
    $opt2 = "Development";
    $opt3 = "Banners";
    $opt4 = "Logos";
    $opt5 = "Question On Site";
    $opt6 = "Help Please";
    $opt7 = "Hosting";
    $opt8 = "image/thanks.gif";
    ///////////////////Do you want a comment box(yes=1, no=0)?///////////////////////
    $comment = "1";
    ///////////////////////////Tracking Number///////////////////////////
    $unique = uniqid(1234567890);
    $id = substr("$unique", 18);

    ////////////////////////////////Start the Form Building////////////////////////
    if ($add_input1 == "1"){
    $form_input1 = "
    <tr>
    <td align=\"right\"><font face=\"$font_face\" size=
    \"$size\"><strong>$input1_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input1\">
    </font></td>
    </tr>";
    }
    if ($add_input2 == "1"){
    $form_input2 = "
    <tr>
    <td align=\"right\"><font face=\"$font_face\" size=
    \"$size\"><strong>$input2_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input2\">
    </font></td>
    </tr>";
    }
    if ($add_input3 == "1"){
    $form_input3 = "
    <tr>
    <td align=\"right\"><font face=\"$font_face\" size=
    \"$size\"><strong>$input3_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input3\">
    </font></td>
    </tr>";
    }
    if ($add_input4 == "1"){
    $form_input4 = "
    <tr>
    <td align=\"right\"><font face=\"$font_face\" size=
    \"$size\"><strong>$input4_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input4\">
    </font></td>
    </tr>";
    }
    if ($add_input5 == "1"){
    $form_input5 = "
    <tr>
    <td align=\"right\"><font face=\"$font_face\"size=
    \"$size\"><strong>$input5_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input5\">
    </font></td>
    </tr>";
    }
    //THis is your Radio Buttons//
    if ($radio == "0" && $select == "0"){
    $radio_head = "";
    }else{
    $radio_head = "
    <tr>
    <td align=\"right\"><font face=\"$font_face\" size=\"$size\"></td>
    <td align=\"left\"><strong>Info requested on?</strong></font></td>
    </tr>";
    }
    if ($radio == "1"){
    $form_radio = "<br>
    <td align=\"right\"><font face=\"$font_face\" size=\"$size\"></td>
    <td align=\"left\"><input type=\"radio\" name=\"MessageType\" value=\"$radio1\" checked>
    $radio1
    <input type=\"radio\" name=\"MessageType\" value=\"$radio2\">
    $radio2</font>
    <input type=\"radio\" name=\"MessageType\" value=\"$radio2\">
    $radio3</font></td>
    </tr>";
    }
    if ($select == "1"){
    $form_select = "
    <td align=\"right\"><font face=\"$font_face\" size=\"$size\"></td>
    <td align=\"left\">
    <select name=\"Subject\" size=\"1\">
    <option selected value=\"General\">General</option>
    <option value=\"$opt1\">$opt1</option>
    <option value=\"$opt2\">$opt2</option>
    <option value=\"$opt3\">$opt3</option>
    <option value=\"$opt4\">$opt4</option>
    <option value=\"$opt5\">$opt5</option>
    <option value=\"$opt6\">$opt6</option>
    <option value=\"$opt7\">$opt7</option>
    <option value=\"$opt7\">$opt7</option>
    </select>
    Other:
    <input type=\"text\" size=\"10\" maxlength=\"256\" name=\"SubjectOther\"></td>
    </tr>";
    }
    if ($comment == "1"){
    $form_comment = "<td align=\"right\"><font face=\"$font_face\" size=\"$size\"></td>
    <td align=\"left\"><strong>Inserire qui il testo del messaggio:</strong><br>
    <textarea name=\"Comments\" rows=\"5\" cols=\"35\"></textarea>
    </font></td>
    </tr>";
    }

    ///////////////////////////Form Build/////////////////////////////
    $form_block = "

    <FORM method=\"POST\" action=\"$PHP_SELF\">
    <table width=\"$table_width\">
    $form_input1
    <tr>
    <td align=\"right\"><font face=\"$font_face\" size=\"$size\"><strong>Email</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"email\">
    </font></td>
    </tr>
    $form_email
    $form_input2
    $form_input3
    $form_input4
    $form_input5
    $radio_head
    $form_radio
    $form_select
    $form_comment
    <tr>
    </td></tr><td align=\"right\"></td><td align=\"left\">
    <font face=\"$font_face\" size=\"$size\">
    <INPUT type=\"hidden\" name=\"op\" value=\"ds\">
    <INPUT type=\"submit\" value=\"Invia\">
    <input type=\"reset\">
    </td></tr></form>
    Affinché possiate essere rintracciati e presi in considerazione, vi preghiamo di compilare tutti i campi.</table>";
    /////////////////////////////Begin Checking the form/////////////////////////////
    if ($op != "ds") {

    echo "$form_block";
    } else if ($op == "ds") {
    $send = "yes";
    if ($check_input1=="1" && $input1=="") {
    $input1_err = "
    <font color=red>Il campo $input1_name è vuoto, riempilo.</font><br>
    ";
    $send = "no";
    }
    if(!ereg("^([0-9,a-z,A-Z]+)([.,_]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[
    .]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$",$email)) {
    $email_err = "
    <font color=red>Inserisci una Email valida, in modo da essere contattabile per un eventuale risposta.(Esempio:prova@email.it)!</font><br>
    ";
    $send = "no";
    }
    if ($check_input2=="1" && $input2=="") {
    $input2_err = "
    <font color=red>Il campo $input2_name è vuoto, riempilo.</font><br>
    ";
    $send = "no";
    }
    if ($check_input3=="1" && $input3=="") {
    $input3_err = "
    <font color=red>$input3_name Is blank.</font><br>
    ";
    $send = "no";
    }
    if ($check_input4=="1" && $input4=="") {
    $input4_err = "
    <font color=red>$input4_name Is blank.</font><br>
    ";
    $send = "no";
    }
    if ($check_input5=="1" && $input5== "") {
    $input5_err = "
    <font color=red>$input5_name Is blank.</font><br>
    ";
    $send = "no";
    }
    $mail_body = "($email)\n";
    $mail_body .= "Tracking Number = $id \n";
    $mail_body .= "===============Personal Info===================== \n";
    $mail_body .= "$input1_name = $input1 \n";
    $mail_body .= "$input2_name = $input2 \n";
    $mail_body .= "$input3_name = $input3 \n";
    $mail_body .= "$input4_name = $input4 \n";
    $mail_body .= "$input5_name = $input5 \n";
    $mail_body .= "Comments\n";
    $mail_body .= "------------\n";
    $mail_body .= "$Comments\n";
    $mail_body .= "Mailing List = $mailing_list, Contact Me = $ContactRequested\n";
    $mail_body .= "===============Personal Info===================== \n";
    $mail_body .= "ip is ($REMOTE_ADDR)";

    if ($send == "yes") {
    $headers = "From: \"$Name\" <$email>\n";
    mail("$email_address", "$name_form", $mail_body, $headers);
    $headers = "From: \"$Comp_Name\" <$Comp_email>\n";
    echo "<center><img src=\"$logo\"></center><br>";
    echo "<center><font face=\"Arial, Helvetica, sans-serif\" size=\"3\">Your Email Tracking Number is = ";
    echo "(<b><font size=3 color=red>$Comp_Name-$id</font></b>)";
    echo "</font><br>";
    } else if ($send == "no") {

    echo "<blockquote><blockquote>$input1_err";
    echo "$email_err";
    echo "$input2_err";
    echo "$input3_err";
    echo "$input4_err";
    echo "$input5_err";
    echo "Clicca <a href=\"javascript:history.back(1)\">qui</a> per tornare indietro e compilare i campi mancanti</blockquote></blockquote>";

    }


    }

    ?>

  5. #5
    Guest

    Predefinito

    Su quel codice devo fare le seguenti modifiche, sotto il box dove inserire il messaggio devo scrivere il testo "Affinché possiate essere rintracciati e presi in considerazione, vi preghiamo di compilare tutti i campi." separata sia dal box hce dai tasti sottostant da 1 spazio, poi il tasto che mi fa tornare indietro nel caso alcuni dati non siano inseriti correttamente non funziona, ancora vorrei mettere un colore di bordo per i vari spazi di inserimento, il colore e' azzurrino, ancora vorrei mettere il nome di ogni campo sopra il relativo box di inserimento e non accanto come si trovano adesso.


    Spero di non imenticare nulla, PS: chi mi vuole aiutare, potrebbe modificare come detto sopra il codice e scriverlo nel nuovo mess, in modo da poter copiare e provare subito.

  6. #6
    Guest

    Predefinito

    Codice PHP:
    <?


    /////////////////////////////Name Your Form
    $name_form = "Contact Form";
    $Comp_Name = "10Tons";
    $email_address = "talgi@email.it";
    $home_url = "http://www.giovaniin.altervista.org/";

    /////////////////Table and Font Set Up///////////
    $table_width = "510";
    $font_face = "Arial";
    $size = "2";

    ////////////////////////Input 1(yes=1, no=0)
    $add_input1 = "1";
    $check_input1 = "1";
    $input1_name = "Nome e Cognome";

    ////////////////////////Input 2(yes=1, no=0)
    $add_input2 = "0";
    $check_input2 = "0";
    $input2_name = "Cognome";


    /////////////////////////Input 5(yes=1, no=0)
    $add_input5 = "0";
    $check_input5 = "0";
    $input5_name = "Input5";
    ////////Do you want radio Buttons(yes=1, no=0)
    $radio = "0";
    ////////If yes Define Variables here///////////
    $radio1 = "Web Site";
    $radio2 = "Training";
    $radio3 = "Help";
    //////////////Do you want a select(yes=1, no=0)
    $select = "0";
    ////////If yes Define Variables here///////////
    $opt1 = "Design";
    $opt2 = "Development";
    $opt3 = "Banners";
    $opt4 = "Logos";
    $opt5 = "Question On Site";
    $opt6 = "Help Please";
    $opt7 = "Hosting";
    $opt8 = "image/thanks.gif";
    ///////////////////Do you want a comment box(yes=1, no=0)?///////////////////////
    $comment = "1";
    ///////////////////////////Tracking Number///////////////////////////
    $unique = uniqid(1234567890);
    $id = substr("$unique", 18);

    ////////////////////////////////Start the Form Building////////////////////////
    if ($add_input1 == "1"){
    $form_input1 = "
    <tr>
    <td colspan=\"2\"><font face=\"
    $font_face\" size=
    \"
    $size\"><strong>$input1_name</strong></td></tr>
    <tr><td colspan=\"2\" align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input1\">
    </font></td>
    </tr>"
    ;
    }
    if (
    $add_input2 == "1"){
    $form_input2 = "
    <tr>
    <td align=\"right\"><font face=\"
    $font_face\" size=
    \"
    $size\"><strong>$input2_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input2\">
    </font></td>
    </tr>"
    ;
    }
    if (
    $add_input3 == "1"){
    $form_input3 = "
    <tr>
    <td align=\"right\"><font face=\"
    $font_face\" size=
    \"
    $size\"><strong>$input3_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input3\">
    </font></td>
    </tr>"
    ;
    }
    if (
    $add_input4 == "1"){
    $form_input4 = "
    <tr>
    <td align=\"right\"><font face=\"
    $font_face\" size=
    \"
    $size\"><strong>$input4_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input4\">
    </font></td>
    </tr>"
    ;
    }
    if (
    $add_input5 == "1"){
    $form_input5 = "
    <tr>
    <td align=\"left\"><font face=\"
    $font_face\"size=
    \"
    $size\"><strong>$input5_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input5\">
    </font></td>
    </tr>"
    ;
    }
    //THis is your Radio Buttons//
    if ($radio == "0" && $select == "0"){
    $radio_head = "";
    }else{
    $radio_head = "
    <tr>
    <td align=\"right\"><font face=\"
    $font_face\" size=\"$size\"></td>
    <td align=\"left\"><strong>Info requested on?</strong></font></td>
    </tr>"
    ;
    }
    if (
    $radio == "1"){
    $form_radio = "<br>
    <td align=\"right\"><font face=\"
    $font_face\" size=\"$size\"></td>
    <td align=\"left\"><input type=\"radio\" name=\"MessageType\" value=\"
    $radio1\" checked>
    $radio1
    <input type=\"radio\" name=\"MessageType\" value=\"
    $radio2\">
    $radio2</font>
    <input type=\"radio\" name=\"MessageType\" value=\"
    $radio2\">
    $radio3</font></td>
    </tr>"
    ;
    }
    if (
    $select == "1"){
    $form_select = "
    <td align=\"right\"><font face=\"
    $font_face\" size=\"$size\"></td>
    <td align=\"left\">
    <select name=\"Subject\" size=\"1\">
    <option selected value=\"General\">General</option>
    <option value=\"
    $opt1\">$opt1</option>
    <option value=\"
    $opt2\">$opt2</option>
    <option value=\"
    $opt3\">$opt3</option>
    <option value=\"
    $opt4\">$opt4</option>
    <option value=\"
    $opt5\">$opt5</option>
    <option value=\"
    $opt6\">$opt6</option>
    <option value=\"
    $opt7\">$opt7</option>
    <option value=\"
    $opt7\">$opt7</option>
    </select>
    Other:
    <input type=\"text\" size=\"10\" maxlength=\"256\" name=\"SubjectOther\"></td>
    </tr>"
    ;
    }
    if (
    $comment == "1"){
    $form_comment = "<td align=\"right\"><font face=\"$font_face\" size=\"$size\"></td>
    <td align=\"left\"><strong>Inserire qui il testo del messaggio:</strong><br>
    <textarea name=\"Comments\" rows=\"5\" cols=\"35\"></textarea>
    </font></td>
    </tr>"
    ;
    }

    ///////////////////////////Form Build/////////////////////////////
    $form_block = "

    <FORM method=\"POST\" action=\"
    $PHP_SELF\">
    <table width=\"
    $table_width\">
    $form_input1
    <tr>
    <td colspan=\"2\" align=\"left\"><font face=\"
    $font_face\" size=\"$size\"><strong>Email</strong></td></tr>
    <tr><td colspan=\"2\" align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"email\">
    </font></td>
    </tr>
    $form_email
    $form_input2
    $form_input3
    $form_input4
    $form_input5
    $radio_head
    $form_radio
    $form_select
    $form_comment
    <tr>
    </td></tr>
    <tr><td colspan=\"2\">Affinché possiate essere rintracciati e presi in considerazione, vi preghiamo di compilare tutti i campi.</td></tr>
    <td align=\"right\"></td><td align=\"left\">
    <font face=\"
    $font_face\" size=\"$size\">
    <INPUT type=\"hidden\" name=\"op\" value=\"ds\">
    <INPUT type=\"submit\" value=\"Invia\">
    <input type=\"reset\">
    </td></tr></form>
    </table>"
    ;
    /////////////////////////////Begin Checking the form/////////////////////////////
    if ($op != "ds") {

    echo
    "$form_block";
    } else if (
    $op == "ds") {
    $send = "yes";
    if (
    $check_input1=="1" && $input1=="") {
    $input1_err = "
    <font color=red>Il campo
    $input1_name è vuoto, riempilo.</font><br>
    "
    ;
    $send = "no";
    }
    if(!
    ereg("^([0-9,a-z,A-Z]+)([.,_]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[
    .]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$"
    ,$email)) {
    $email_err = "
    <font color=red>Inserisci una Email valida, in modo da essere contattabile per un eventuale risposta.(Esempio:prova@email.it)!</font><br>
    "
    ;
    $send = "no";
    }
    if (
    $check_input2=="1" && $input2=="") {
    $input2_err = "
    <font color=red>Il campo
    $input2_name è vuoto, riempilo.</font><br>
    "
    ;
    $send = "no";
    }
    if (
    $check_input3=="1" && $input3=="") {
    $input3_err = "
    <font color=red>
    $input3_name Is blank.</font><br>
    "
    ;
    $send = "no";
    }
    if (
    $check_input4=="1" && $input4=="") {
    $input4_err = "
    <font color=red>
    $input4_name Is blank.</font><br>
    "
    ;
    $send = "no";
    }
    if (
    $check_input5=="1" && $input5== "") {
    $input5_err = "
    <font color=red>
    $input5_name Is blank.</font><br>
    "
    ;
    $send = "no";
    }
    $mail_body = "($email)\n";
    $mail_body .= "Tracking Number = $id \n";
    $mail_body .= "===============Personal Info===================== \n";
    $mail_body .= "$input1_name = $input1 \n";
    $mail_body .= "$input2_name = $input2 \n";
    $mail_body .= "$input3_name = $input3 \n";
    $mail_body .= "$input4_name = $input4 \n";
    $mail_body .= "$input5_name = $input5 \n";
    $mail_body .= "Comments\n";
    $mail_body .= "------------\n";
    $mail_body .= "$Comments\n";
    $mail_body .= "Mailing List = $mailing_list, Contact Me = $ContactRequested\n";
    $mail_body .= "===============Personal Info===================== \n";
    $mail_body .= "ip is ($REMOTE_ADDR)";

    if (
    $send == "yes") {
    $headers = "From: \"$Name\" <$email>\n";
    mail("$email_address", "$name_form", $mail_body, $headers);
    $headers = "From: \"$Comp_Name\" <$Comp_email>\n";
    echo
    "<center><img src=\"$logo\"></center><br>";
    echo
    "<center><font face=\"Arial, Helvetica, sans-serif\" size=\"3\">Your Email Tracking Number is = ";
    echo
    "(<b><font size=3 color=red>$Comp_Name-$id</font></b>)";
    echo
    "</font><br>";
    } else if (
    $send == "no") {

    echo
    "<blockquote><blockquote>$input1_err";
    echo
    "$email_err";
    echo
    "$input2_err";
    echo
    "$input3_err";
    echo
    "$input4_err";
    echo
    "$input5_err";
    echo
    "Clicca <a href=\"javascript:history.back(1)\">qui</a> per tornare indietro e compilare i campi mancanti</blockquote></blockquote>";

    }


    }

    ?>
    così dovrebbe essere impaginato come hai chiesto, solo che nn ho capito la parte del colore....

  7. #7
    Guest

    Predefinito

    Ottimo, resta una cosa, dovrei mettere tutto al centro della pagina, e poi dovrei centrare il testo su ogni box.
    Poi ho notato una cosa, il tasto per tornare indietro quando non inserisci tutti i dati, continua a non funzionare.
    Ultima modifica di giovaniin : 21-11-2004 alle ore 18.07.32

  8. #8
    Guest

    Predefinito

    Codice PHP:
    <?


    /////////////////////////////Name Your Form
    $name_form = "Contact Form";
    $Comp_Name = "10Tons";
    $email_address = "talgi@email.it";
    $home_url = "http://www.giovaniin.altervista.org/";

    /////////////////Table and Font Set Up///////////
    $table_width = "510";
    $font_face = "Arial";
    $size = "2";

    ////////////////////////Input 1(yes=1, no=0)
    $add_input1 = "1";
    $check_input1 = "1";
    $input1_name = "Nome e Cognome";

    ////////////////////////Input 2(yes=1, no=0)
    $add_input2 = "0";
    $check_input2 = "0";
    $input2_name = "Cognome";


    /////////////////////////Input 5(yes=1, no=0)
    $add_input5 = "0";
    $check_input5 = "0";
    $input5_name = "Input5";
    ////////Do you want radio Buttons(yes=1, no=0)
    $radio = "0";
    ////////If yes Define Variables here///////////
    $radio1 = "Web Site";
    $radio2 = "Training";
    $radio3 = "Help";
    //////////////Do you want a select(yes=1, no=0)
    $select = "0";
    ////////If yes Define Variables here///////////
    $opt1 = "Design";
    $opt2 = "Development";
    $opt3 = "Banners";
    $opt4 = "Logos";
    $opt5 = "Question On Site";
    $opt6 = "Help Please";
    $opt7 = "Hosting";
    $opt8 = "image/thanks.gif";
    ///////////////////Do you want a comment box(yes=1, no=0)?///////////////////////
    $comment = "1";
    ///////////////////////////Tracking Number///////////////////////////
    $unique = uniqid(1234567890);
    $id = substr("$unique", 18);

    ////////////////////////////////Start the Form Building////////////////////////
    if ($add_input1 == "1"){
    $form_input1 = "
    <tr>
    <td colspan=\"2\" align=\"center\"><font face=\"
    $font_face\" size=
    \"
    $size\"><strong>$input1_name</strong></td></tr>
    <tr><td colspan=\"2\" align=\"center\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input1\">
    </font></td>
    </tr>"
    ;
    }
    if (
    $add_input2 == "1"){
    $form_input2 = "
    <tr>
    <td align=\"right\"><font face=\"
    $font_face\" size=
    \"
    $size\"><strong>$input2_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input2\">
    </font></td>
    </tr>"
    ;
    }
    if (
    $add_input3 == "1"){
    $form_input3 = "
    <tr>
    <td align=\"right\"><font face=\"
    $font_face\" size=
    \"
    $size\"><strong>$input3_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input3\">
    </font></td>
    </tr>"
    ;
    }
    if (
    $add_input4 == "1"){
    $form_input4 = "
    <tr>
    <td align=\"right\"><font face=\"
    $font_face\" size=
    \"
    $size\"><strong>$input4_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input4\">
    </font></td>
    </tr>"
    ;
    }
    if (
    $add_input5 == "1"){
    $form_input5 = "
    <tr>
    <td align=\"left\"><font face=\"
    $font_face\"size=
    \"
    $size\"><strong>$input5_name</strong></td>
    <td align=\"left\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"input5\">
    </font></td>
    </tr>"
    ;
    }
    //THis is your Radio Buttons//
    if ($radio == "0" && $select == "0"){
    $radio_head = "";
    }else{
    $radio_head = "
    <tr>
    <td align=\"right\"><font face=\"
    $font_face\" size=\"$size\"></td>
    <td align=\"left\"><strong>Info requested on?</strong></font></td>
    </tr>"
    ;
    }
    if (
    $radio == "1"){
    $form_radio = "<br>
    <td align=\"right\"><font face=\"
    $font_face\" size=\"$size\"></td>
    <td align=\"left\"><input type=\"radio\" name=\"MessageType\" value=\"
    $radio1\" checked>
    $radio1
    <input type=\"radio\" name=\"MessageType\" value=\"
    $radio2\">
    $radio2</font>
    <input type=\"radio\" name=\"MessageType\" value=\"
    $radio2\">
    $radio3</font></td>
    </tr>"
    ;
    }
    if (
    $select == "1"){
    $form_select = "
    <td align=\"right\"><font face=\"
    $font_face\" size=\"$size\"></td>
    <td align=\"left\">
    <select name=\"Subject\" size=\"1\">
    <option selected value=\"General\">General</option>
    <option value=\"
    $opt1\">$opt1</option>
    <option value=\"
    $opt2\">$opt2</option>
    <option value=\"
    $opt3\">$opt3</option>
    <option value=\"
    $opt4\">$opt4</option>
    <option value=\"
    $opt5\">$opt5</option>
    <option value=\"
    $opt6\">$opt6</option>
    <option value=\"
    $opt7\">$opt7</option>
    <option value=\"
    $opt7\">$opt7</option>
    </select>
    Other:
    <input type=\"text\" size=\"10\" maxlength=\"256\" name=\"SubjectOther\"></td>
    </tr>"
    ;
    }
    if (
    $comment == "1"){
    $form_comment = "<td align=\"right\"><font face=\"$font_face\" size=\"$size\"></td>
    <td align=\"center\"><strong>Inserire qui il testo del messaggio:</strong><br>
    <textarea name=\"Comments\" rows=\"5\" cols=\"35\"></textarea>
    </font></td>
    </tr>"
    ;
    }

    ///////////////////////////Form Build/////////////////////////////
    $form_block = "

    <FORM method=\"POST\" action=\"
    $PHP_SELF\">
    <center><table width=\"
    $table_width\">
    $form_input1
    <tr>
    <td colspan=\"2\" align=\"center\"><font face=\"
    $font_face\" size=\"$size\"><strong>Email</strong></td></tr>
    <tr><td colspan=\"2\" align=\"center\">
    <input type=\"text\" size=\"35\" maxlength=\"256\" name=\"email\">
    </font></td>
    </tr>
    $form_email
    $form_input2
    $form_input3
    $form_input4
    $form_input5
    $radio_head
    $form_radio
    $form_select
    $form_comment
    <tr>
    </td></tr>
    <tr><td align=\"center\" colspan=\"2\">Affinché possiate essere rintracciati e presi in considerazione, vi preghiamo di compilare tutti i campi.</td></tr>
    <td align=\"right\"></td><td align=\"left\">
    <font face=\"
    $font_face\" size=\"$size\">
    <INPUT type=\"hidden\" name=\"op\" value=\"ds\">
    <INPUT type=\"submit\" value=\"Invia\">
    <input type=\"reset\">
    </td></tr></form>
    </table></center>"
    ;
    /////////////////////////////Begin Checking the form/////////////////////////////
    if ($op != "ds") {

    echo
    "$form_block";
    } else if (
    $op == "ds") {
    $send = "yes";
    if (
    $check_input1=="1" && $input1=="") {
    $input1_err = "
    <font color=red>Il campo
    $input1_name è vuoto, riempilo.</font><br>
    "
    ;
    $send = "no";
    }
    if(!
    ereg("^([0-9,a-z,A-Z]+)([.,_]([0-9,a-z,A-Z]+))*[@]([0-9,a-z,A-Z]+)([.,_,-]([0-9,a-z,A-Z]+))*[
    .]([0-9,a-z,A-Z]){2}([0-9,a-z,A-Z])?$"
    ,$email)) {
    $email_err = "
    <font color=red>Inserisci una Email valida, in modo da essere contattabile per un eventuale risposta.(Esempio:prova@email.it)!</font><br>
    "
    ;
    $send = "no";
    }
    if (
    $check_input2=="1" && $input2=="") {
    $input2_err = "
    <font color=red>Il campo
    $input2_name è vuoto, riempilo.</font><br>
    "
    ;
    $send = "no";
    }
    if (
    $check_input3=="1" && $input3=="") {
    $input3_err = "
    <font color=red>
    $input3_name Is blank.</font><br>
    "
    ;
    $send = "no";
    }
    if (
    $check_input4=="1" && $input4=="") {
    $input4_err = "
    <font color=red>
    $input4_name Is blank.</font><br>
    "
    ;
    $send = "no";
    }
    if (
    $check_input5=="1" && $input5== "") {
    $input5_err = "
    <font color=red>
    $input5_name Is blank.</font><br>
    "
    ;
    $send = "no";
    }
    $mail_body = "($email)\n";
    $mail_body .= "Tracking Number = $id \n";
    $mail_body .= "===============Personal Info===================== \n";
    $mail_body .= "$input1_name = $input1 \n";
    $mail_body .= "$input2_name = $input2 \n";
    $mail_body .= "$input3_name = $input3 \n";
    $mail_body .= "$input4_name = $input4 \n";
    $mail_body .= "$input5_name = $input5 \n";
    $mail_body .= "Comments\n";
    $mail_body .= "------------\n";
    $mail_body .= "$Comments\n";
    $mail_body .= "Mailing List = $mailing_list, Contact Me = $ContactRequested\n";
    $mail_body .= "===============Personal Info===================== \n";
    $mail_body .= "ip is ($REMOTE_ADDR)";

    if (
    $send == "yes") {
    $headers = "From: \"$Name\" <$email>\n";
    mail("$email_address", "$name_form", $mail_body, $headers);
    $headers = "From: \"$Comp_Name\" <$Comp_email>\n";
    echo
    "<center><img src=\"$logo\"></center><br>";
    echo
    "<center><font face=\"Arial, Helvetica, sans-serif\" size=\"3\">Your Email Tracking Number is = ";
    echo
    "(<b><font size=3 color=red>$Comp_Name-$id</font></b>)";
    echo
    "</font><br>";
    } else if (
    $send == "no") {

    echo
    "<blockquote><blockquote>$input1_err";
    echo
    "$email_err";
    echo
    "$input2_err";
    echo
    "$input3_err";
    echo
    "$input4_err";
    echo
    "$input5_err";
    echo
    "Clicca <a href=\"javascript:history.back(1)\">qui</a> per tornare indietro e compilare i campi mancanti</blockquote></blockquote>";

    }


    }

    ?>
    prova ora...
    il tasto per tornare indietro a me fuziona perfettamente, e il codice javascript mi pare corretto..

  9. #9
    Guest

    Predefinito

    Ottimo, dovresti solo fare due ultime modifiche, centrare anche i pulsanti di invio e vancella dati, e infine mettere con carattere Arial grandezza 8 pt il testo che hai inserito tra i pulsanti e il box per lasciare il messaggio.

    PS: GRAZIE ancora della collaborazione
    Ultima modifica di giovaniin : 27-11-2004 alle ore 19.35.55

  10. #10
    Guest

    Predefinito

    Dimenticavo ... a me il tasto per tornare indietro continua a non funzionare :/

Regole di scrittura

  • Non puoi creare nuove discussioni
  • Non puoi rispondere ai messaggi
  • Non puoi inserire allegati.
  • Non puoi modificare i tuoi messaggi
  •