• User

    Contact Form Non Funziona

    Salve dinuovo a tutti 🙂
    Questa volta ho un problemino sulla mia contact form html.
    Dandomi il seguente errore :

    Method Not Allowed

    The requested method POST is not allowed for the URL /contacts.html.

    Ora non so precisamente cosa ho sbagliato, ho provato a cambiare di tutto , vi lascio il codice sperando in un vostro aiuto come sempre .

    [html]<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="author" content="[email protected]"/>
    <meta name="description" content="Web Design, by Jackless Productions."/>
    <meta name="keywords" content="Jackless Web Design"/>
    <meta name="language" content="english"/>
    <title>Contact Me</title>
    <!-- stile -->
    <link href="css/reset.css" rel="stylesheet" type="text/css" />
    <link href="css/jScrollPane.css" rel="stylesheet" type="text/css" />
    <link href="css/nivo-slider.css" rel="stylesheet" type="text/css" />
    <link href="css/default.css" rel="stylesheet" type="text/css" />
    <!-- jQuery framework and utilities -->
    <script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
    <script type="text/javascript" src="js/jquery.easing.1.1.1.js"></script>
    <script type="text/javascript" src="js/jquery.mousewheel.js"></script>
    <!-- slide-->
    <script type="text/javascript" src="js/jquery.nivo.slider.pack.js"></script>
    <script type="text/javascript">
    // initialize slideshow
    $(window).load(function() {
    $('#slider').nivoSlider({
    effect:'random', //Specify sets like: 'fold,fade,sliceDown'
    slices:15,
    animSpeed:500,
    pauseTime:3000,
    startSlide:0, //Set starting Slide (0 index)
    directionNav:false, //Next and Prev
    directionNavHide:true, //Only show on hover
    controlNav:false, //1,2,3...
    controlNavThumbs:false, //Use thumbnails for Control Nav
    controlNavThumbsFromRel:false, //Use image rel for thumbs
    controlNavThumbsSearch: '.jpg', //Replace this with...
    controlNavThumbsReplace: '_thumb.jpg', //...this in thumb Image src
    keyboardNav:true, //Use left and right arrows
    pauseOnHover:false, //Stop animation while hovering
    manualAdvance:false, //Force manual transitions
    captionOpacity:0.8, //Universal caption opacity
    beforeChange: function(){},
    afterChange: function(){},
    slideshowEnd: function(){}
    });
    });
    </script>
    <!-- etichette -->
    <script type="text/javascript" src="js/jquery.overlabel.min.js"></script>
    <script type="text/javascript">
    $(document).ready(function() {
    $("label.overlabel").overlabel();
    });
    </script>
    <!-- form script -->
    <script src="js/jquery.validate.min.js" type="text/javascript"></script>
    <script type="text/javascript">

    $(document).ready(function() {
        $("#form").validate();
    });
    

    </script>
    <!-- font -->
    <script src="js/cufon-yui.js" type="text/javascript"></script>
    <script src="js/times.font.js" type="text/javascript"></script>
    <script type="text/javascript">
    Cufon.replace('h1');
    Cufon('.menu ul li a', {
    hover: {
    color: '#ee0081'
    }});
    Cufon('button', {
    hover: {
    color: '#ee0081'
    },
    hoverables: { button:true }
    });
    </script>
    <!-- scrollB -->
    <script type="text/javascript" src="js/jScrollPane.js"></script>
    <script type="text/javascript">
    $(function()
    {
    $('#pane1, #pane2').jScrollPane({showArrows:true});
    $('#pane1,').jScrollPane({scrollbarWidth:5});
    });
    </script>

        <script type="text/javascript" src="js/pngFix.min.js"></script>
        <script type="text/javascript"> 
            $(document).ready(function(){ 
                $(document.body).supersleight();
            }); 
        </script> 
    

    <!-->
    <!--[if lt IE 7]><link href="css/only-ie6.css" rel="stylesheet" type="text/css"><![endif]-->
    <!--[if lt IE 8]><link href="css/only-ie7.css" rel="stylesheet" type="text/css"><![endif]-->
    <!--[if lt IE 9]><link href="css/only-ie8.css" rel="stylesheet" type="text/css"><![endif]-->

    <!-- load pagina -->
    <script type="text/javascript" src="js/onLoad.js"></script>
    </head>
    <body class="wrapper">
    <div id="container">
    <div id="header">
    <div class="logo"><a href="index.html"><img src="images/logo.png" width="254" height="41" border="0" alt=""/></a></div>
    <div class="menu">
    <ul>
    <li><a href="index.html"><span class="small">Back to</span><span>Home</span></a></li>
    <li><a href="portfolio.html"><span class="small">house of pixel</span><span>Portfolio</span></a></li>
    <li><a href="testimonials.html"><span class="small">Jackless</span><span>info</span></a></li>
    <li><a href="contacts.html"><span class="small">Us Via Site</span><span>Contact</span></a></li>
    </ul>
    </div>
    <!-- fine header -->
    </div>
    <div id="mainContent">
    <div class="bigImage">
    <div class="slideshow" id="slider"> <img src="images/slideshow/slide-1.jpg" width="851" height="338" alt="" /> <img src="images/slideshow/slide-2.jpg" width="851" height="338" alt="" /> <img src="images/slideshow/slide-3.jpg" width="851" height="338" alt="" /> <img src="images/slideshow/slide-4.jpg" width="851" height="338" alt="" /> <img src="images/slideshow/slide-5.jpg" width="851" height="338" alt="" /> </div>
    </div>
    <div class="holder" style="margin-right:10px;">
    <h1>My <span class="color">Address</span></h1>
    <div id="pane1">
    <p><strong class="color">For any question, suggestion and a Free Quote:</strong><br />
    you can keep in touch with Jacopo Spina Trough this contact form or his Social Networks:</p>
    <p><a href="vvvfacebook.c/Jacopo.Phelps">Facebook Page</a> | <a href="vvvyoutube.c/user/JacklessDesign?feature=mhum">Youtube Page</a> | <a href="twitter.com/#!/HouseOfPixel">Twitter Page</a></p>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="color2">
    <tr>
    <td height="20"><strong>Aprilia | Italy</strong></td>
    <td><strong>IT Phone: +39-346-215-6722</strong></td>
    </tr>
    <tr>
    <td height="20"><strong>04011 Tiberio 18</strong></td>
    <td><strong>UK Phone: +0044<span id="internal-source-marker_0.35861451924750487">-774-7108495</span></strong></td>
    </tr>
    <tr>
    <td height="20"><strong>House Of Pixel, Jackless Design</strong></td>
    <td><strong>Email: <a href="mailto:[email protected]" class="color2">[email protected]</a></strong></td>
    </tr>
    </table>
    </div>
    </div>
    <div class="holder text10px">
    <h1>Contact <span class="color">Me</span></h1>
    <div id="pane2">
    <!-- contact form -->
    <form class="cmxform" id="form" method="post" action="#">
    <div style="float:right; width:258px;">
    <label for="ContactMessage" class="overlabel">Message</label>
    <textarea id="ContactMessage" name="ContactMessage" class="textInput" rows="10" cols="4"></textarea>
    </div>
    <div>
    <label for="ContactName" class="overlabel">Name</label>
    <input id="ContactName" name="ContactName" class="textInput required" />
    </div>
    <div>
    <label for="ContactEmail" class="overlabel">Email</label>
    <input id="ContactEmail" name="ContactEmail" class="textInput required email" />
    </div>
    <div class="fix1">
    <label for="ContactComments" class="overlabel">Comments</label>
    <input id="ContactComments" name="ContactComments" class="textInput comments" />
    </div>
    <div class="clear"></div>
    <div style="float:right" class="fix1">
    <button type="submit" class="btn bSend">Send</button>
    <button type="submit" class="btn bClear" onclick="document.getElementById('form').reset();">Clear</button>
    </div>
    </form>
    </div>
    </div>
    <div class="clear"></div>
    <!-- fine main cont -->
    </div>
    <div id="footer">
    <p><span class="color">Design Studio</span> 2009 ? Copyright | All rights reserved</p>
    <!-- fine foot -->
    </div>
    <!-- fine container -->
    </div>
    </body>
    </html>[/html]


  • User Attivo

    Ciao Jackless,

    ti consiglio di usare php per inviare email, e l'action del form dev'essere la pagina php in cui usi lo script che invia le email (la funzione mail() di php).

    Se non sai creare lo script php che invia le email, dai un'occhiata alla documentazione di mail(), e se qualcosa non ti è chiaro, chiedi pure 😉

    Jeeves


  • User Attivo

    Ciao Jackless,

    ti consiglio di usare php per inviare email, e l'action del form dev'essere la pagina php in cui usi lo script che invia le email (la funzione mail() di php).

    Se non sai creare lo script php che invia le email, dai un'occhiata alla documentazione di mail(), e se qualcosa non ti è chiaro, chiedi pure 😉

    Jeeves


  • User

    Grazie per la tua risposta 🙂
    Magari se puoi potresti aiutarmi a scrivere il codice che sono un po impacciato che l'ho scoperto da poco il php.
    Grazie in anticipo


  • User Attivo

    Allora, ti ho un po' aggiustato il codice del form:

    [HTML]<form class="cmxform" id="form" method="post" action="pagina-invio.php">
    <div style="float:right; width:258px;">
    <label for="ContactMessage" class="overlabel">Message</label>
    <textarea id="ContactMessage" name="messaggio" class="textInput" rows="10" cols="4"></textarea>
    </div>
    <div>
    <label for="ContactName" class="overlabel">Name</label>
    <input id="ContactName" name="nome" class="textInput required" />
    </div>
    <div>
    <label for="ContactEmail" class="overlabel">Email</label>
    <input id="ContactEmail" name="email" class="textInput required email" />
    </div>
    <div class="fix1">
    <label for="ContactComments" class="overlabel">Comments</label>
    <input id="ContactComments" name="commenti" class="textInput comments" />
    </div>
    <div class="clear"></div>
    <div style="float:right" class="fix1">
    <button type="submit" class="btn bSend">Send</button>
    <button type="reset" class="btn bClear">Clear</button>
    </div>
    </form>[/HTML]

    E questa è pagina-invio.php

    [PHP]<?php
    $nome = $_POST['nome'];
    $email = $_POST['email'];
    $msg = $_POST['messaggio'];
    $comm = $_POST['commenti'];

    // Qui puoi fare una cosa semplice come questa:
    mail("tua@email", "Oggetto mail", "Contenuto", "Eventuali headers");

    ?>[/PHP]
    Ovvio che non so come vuoi strutturare la mail da inviare, ma se non riesci a impostarlo da solo, chiedi pure 😉

    Jeeves


  • User

    Grazie 1000 , sei stato gentilissimo e anche completo 🙂
    ho risolto alla fine grazie ancora jeeves