2 Replies Latest reply on May 18, 2017 9:21 PM by BenPleysier

    "MethodNotAllowedError" / "POST is not allowed" - PHP woes

    thevisualedge1 Level 1

      Hey Dreamweaver geniuses--


      I've recently completed my first attempt at a "contact us" form using PHP.  When I test the form and click "submit",  I get this:


      {"code":"MethodNotAllowedError","message":"POST is not allowed"}


      My form code and PHP code are below.  Would appreciate any advice.  Oh--and does the webpage with the form need to be a PHP file?  Or can it be an HTML file that simply contains a form with a PHP action?  






      <div id="contactBox">

        <form action="mailscript.php" method="post" enctype="multipart/form-data" name="contactForm" id="contactForm" title="Contact Form">

           <p><em>*Required field </em></p>


             <input name="firstname" type="text" required class="label" id="firstname" placeholder="First Name*">


             <input name="lastname" type="text" required class="label" id="lastname" placeholder="Last Name*">


             <input name="email" type="email" required class="label" id="email" placeholder="Email address*">


             <input name="phone" type="text" required class="label" id="phone" placeholder="Phone*" />


             <select name="timezone" class="selectItem" id="timezone" title="Time Zone">

               <option>Time Zone</option>








             <select name="besttime" class="selectItem" id="besttime">

               <option>Best Time To Call</option>







             <select name="referral" required class="selectItem" id="referral">

               <option>How did you hear about us?</option>

               <option>Option 1</option>

               <option>Option 2</option>

               <option>Someone referred me</option>




            <input name="submit" type="submit" class="submitButton" id="submit" form="contactForm" formaction="mailscript.php" formenctype="multipart/form-data" formmethod="POST" title="Submit" value="Submit">








      CODE FOR "mailscript.php"















      mail ($email, $subject, "From:".$from)