Visualizzazione risultati 1 fino 2 di 2

Discussione: form invio in php

  1. #1
    Guest

    Predefinito form invio in php

    Ciao ragazzi,
    non essendo un programmatore ho tentato di fare un form in php smanettando su google ed anche su quest oforum,la mia necessita e' di inviare pe posta diversi campi tra cui anche una foto,il form sara' utilizzato quasi per il 90% dai cellulari o tablet.cosi ho creato la mia pagina
    Codice PHP:
    <!DOCTYPE html>
    <
    html>
    <
    head>
    <
    meta charset="UTF-8">
    <
    title>Portale Messina </title>
    <
    meta name="viewport" content="width=device-width,initial-scale=1.0">
    <
    link href="css/style.css" rel="stylesheet">
    </
    head>

    <
    body>

    <
    div class="wrapper">
    <
    div id="main" style="padding:50px 0 0 0;">

    <!--
    Form -->
    <
    form id="contact-form" action="formmail.php" method="POST" enctype="multipart/form-data">
    <
    input type="hidden" name="destinatario" value="pieroaiello13180@gmail.com">

    <
    h3>Titolo</h3>
    <
    h4>Fill in the form below, and we'll get back to you within 24 hours.</h4>
    <div>
    <label>
    <span>Name: (required)</span>
    <input placeholder="Please enter your name" type="text" name="mittente" tabindex="1" required autofocus>
    </label>
    </div>
    <div>
    <label>
    <span>Email: (required)</span>
    <input placeholder="Please enter your email address" type="email" name="email" tabindex="2" required>
    </label>
    </div>
    <div>
    <label>
    <span>foto: (required)</span>
    <input type="file" name="allegato" />
    </label>
    </div>
    <div>
    <label>
    <span>Telephone: (required)</span>
    <input placeholder="Please enter your number" type="tel" name="telefono" tabindex="3" required>
    </label>
    </div>
    <div>
    <label>
    <span>Oggetto: (required)</span>
    <input placeholder="Begin with http://" type="url" name="oggetto" tabindex="4" required>
    </label>
    </div>
    <div>
    <label>
    <span>Message: (required)</span>
    <textarea placeholder="Include all the details you can" name="messaggio" tabindex="5" required></textarea>
    </label>
    </div>
    <div>
    <button name="submit" type="submit" id="contact-submit">Send Email</button>
    </div>
    </form>
    <!-- /Form -->

    </div>
    </div>

    <script src="js/scripts.js"></script>

    </body>
    </html>

    di seguito il formail.php
    Codice PHP:
    <!DOCTYPE html>
    <
    html>
    <
    head>
    <
    meta charset="UTF-8">
    <
    title>Portale Messina </title>
    <
    meta name="viewport" content="width=device-width,initial-scale=1.0">
    <
    link href="css/style.css" rel="stylesheet">
    </
    head>

    <
    body>

    <
    div class="wrapper">
    <
    div id="main" style="padding:50px 0 0 0;">

    <!--
    Form -->
    <
    form id="contact-form" action="formmail.php" method="POST" enctype="multipart/form-data">
    <
    input type="hidden" name="destinatario" value="pieroaiello13180@gmail.com">

    <
    h3>Titolo</h3>
    <
    h4>Fill in the form below, and we'll get back to you within 24 hours.</h4>
    <div>
    <label>
    <span>Name: (required)</span>
    <input placeholder="Please enter your name" type="text" name="mittente" tabindex="1" required autofocus>
    </label>
    </div>
    <div>
    <label>
    <span>Email: (required)</span>
    <input placeholder="Please enter your email address" type="email" name="email" tabindex="2" required>
    </label>
    </div>
    <div>
    <label>
    <span>foto: (required)</span>
    <input type="file" name="allegato" />
    </label>
    </div>
    <div>
    <label>
    <span>Telephone: (required)</span>
    <input placeholder="Please enter your number" type="tel" name="telefono" tabindex="3" required>
    </label>
    </div>
    <div>
    <label>
    <span>Oggetto: (required)</span>
    <input placeholder="Begin with http://" type="url" name="oggetto" tabindex="4" required>
    </label>
    </div>
    <div>
    <label>
    <span>Message: (required)</span>
    <textarea placeholder="Include all the details you can" name="messaggio" tabindex="5" required></textarea>
    </label>
    </div>
    <div>
    <button name="submit" type="submit" id="contact-submit">Send Email</button>
    </div>
    </form>
    <!-- /Form -->

    </div>
    </div>

    <script src="js/scripts.js"></script>

    </body>
    </html>
    Nel formail.php non ho richiamato tutte le variabili ma solo $mittente,$oggetto,$messaggio,$email tanto pe fare una prova,ma non vedo solo il campo oggetto , la foto ed il campo messaggio..come posso inserire gli altri field?
    Piero
    Ultima modifica di libertaeformazione : 25-02-2014 alle ore 13.35.49

  2. #2
    Guest

    Predefinito

    ok risolto ho implentato la
    $msg .= $messaggio . "\n\n";
    $msg .= $email . "\n\n";

Regole di scrittura

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