Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: Forms Help

  1. #1
    bensbox is offline x10Hosting Member bensbox is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    20

    Forms Help

    hey
    im learning how to do web developing.
    i am using dreamweaver and used a simple pointless form which mailto my email
    but i get this message when i try to submit

    ---
    Method Not Allowed

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


    what does this mean, and how can i create a working for on x10hosting?
    please help!
    Many thanks.B
    Ben.

  2. #2
    conker87 is offline x10Hosting Member conker87 is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    UK
    Posts
    65

    Re: Forms Help

    Where are you submitting the form from? Your PC? Or the server? And if it's the server what's the url of the page on the server?

    Are you using CGI or PHP or w/e to mail this form?

  3. #3
    bensbox is offline x10Hosting Member bensbox is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    20

    Re: Forms Help

    Ok, well could you help me a bit
    im just basically learning forms.. i either wanna send the forms to email or to somewhere on the net, which i guess would be the server

    what have i got to do to make it do this
    and does this not work in a html page? i got to use a php page?
    sorry.. im not too familular with all this, as i said, im using this to teach myself the web
    thanks.

  4. #4
    Slothie's Avatar
    Slothie is offline Lord Of The Keys Slothie is an unknown quantity at this point
    Join Date
    Sep 2007
    Location
    Singapore
    Posts
    1,432

    Re: Forms Help

    HTML Code:
    <CENTER>
    <FORM METHOD=POST ACTION="mailto:someone@snailmail.com" ENCTYPE="text/plain">
    <INPUT TYPE="text" NAME="username"> : name <BR>
    <INPUT TYPE="text" NAME="email"> : email <BR>
    comments <BR>
    <TEXTAREA NAME="COMMENTS" ROWS="10" WRAP="hard">
    </TEXTAREA>
    <INPUT NAME="redirect" TYPE="hidden" VALUE="index.html">
    <INPUT NAME="NEXT_URL" TYPE="hidden" VALUE="index.html">
    <BR>
    <INPUT TYPE="submit" VALUE="Send">
    <INPUT TYPE="reset" VALUE="Clear">
    </FORM>
    </CENTER>
    <!-- END OF FORM -->
    Does your form resemble that?

    Easiest 70 points you'll make on x10

    Feel free to add my reputation by clicking on the if you found my post helpful to you :P


    If I am not responding to your PMs, that means I am ignoring you. Take a hint.



    09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0


  5. #5
    bensbox is offline x10Hosting Member bensbox is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    20

    Re: Forms Help

    Well this is the code

    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Untitled Document</title>
    </head>

    <body>
    <p>FORM test</p>
    <form id="form1" name="form1" method="post" action="">
    <label></label>
    <form action="mailto:ben_johnson1991@hotmail.co.uk" method="get" enctype="text/plain" name="INFOform" id="INFOform">
    <p>
    <label>First Name:
    <input type="text" name="Name" id="Name" />
    </label>
    </p>
    <p>
    <label>Surname:
    <input type="text" name="Surname" id="Surname" />
    </label>
    </p>
    <p>
    <label>Age
    <input type="text" name="Age" id="Age" />
    </label>
    </p>
    <p>&nbsp;</p>
    <p>
    <label for="Sub"></label>
    <input type="submit" name="Sub" id="Sub" value="Submit" />
    </p>
    </form>
    <p>&nbsp;</p>
    </body>
    </html>



    this is the page url
    http://www.bensbox.x10hosting.com/Page1.html

    what do i do?

  6. #6
    Join Date
    Aug 2007
    Location
    Gangstas Paradise
    Posts
    4,143

    Re: Forms Help

    First you have 2 forms in that code:
    eg: <form action="">

    I think it would be better for you to stick some php in there.

    here is a working example of what you want, it is 2 files:

    save me as anything.html
    HTML Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
    <title>Mail Form - DefecTalisman</title>
    <style type="text/css">
    <!--
    .style1 {font-size: 9px}
    -->
    </style>
    </head>
    <body>
    <p align="center">Basic Form and engine to work with it</p>
    <form method="post" action="engine.php">
      <table width="640" border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
    <td>Your Name  :</td>
        <td><input type="text" size="50" maxlength="100" name="usr_name" /> 
          * </td>
      </tr>
      <tr>
        <td>Your e-mail Address : </td>
        <td><input type="text" size="50" maxlength="100" name="usr_mail" />
    *</td>
      </tr>
      
      <tr>
        <td>Subject : </td>
        <td><input type="text" size="50" maxlength="100" name="subject" />
    *</td>
      </tr>
      
        <tr>
          <td>Type Of Message :      </td>
          <td><select name="msg_type">
            <option value='' ="selected">Please Select A Catagory</option>
            <option value="support">Support</option>
            <option value="c_care">Customer Care</option>
          </select>
    *</td>
        </tr>
        
      
        <tr>
        <td colspan="2"><div align="center">Comments *
          <br />
          <textarea rows="5" cols="50" name="comments" wrap="physical"></textarea>
        </div></td>
        </tr>
      
      <tr>
        <td colspan="2"><div align="center">
          <input type="submit" value="Preview" name="preview" />
          <input type="reset" value="Default" />
          <input type ="button" value="Back" name ="back" onclick="history.go(-1)" />
        </div></td>
        </tr>
    </table>
    </form>
    </body>
    </html>
    save me as "engine.php"
    PHP Code:
    <?php
    // Change to 1 to make it test itself
    $test 0;
    /*
     * This section is to require inputs from the form
     */
     
    $reqired_fields = array(
          
    'usr_name' => 'Your Name',
          
    'usr_mail' => 'Your e-mail Address',
          
    'subject' => 'Subject',
          
    'msg_type' => 'Type Of Message',
          
    'comments' => 'Comments'
          
    );
    $null_fields = array();
    foreach (
    $reqired_fields as $a => $z)
    {
     if (isset(
    $_POST["$a"]))
     {
      if (
    $_POST[$a] == FALSE) { array_push($null_fields,$z); }
     }
    }
    if (
    $null_fields == TRUE)
    {
     echo 
    'These fields are missing :<br>';
     foreach (
    $null_fields as $t) { echo '-'.$t.',<br>'; }
     echo 
    '<br>Please press back and fill them in.<br>';
     echo 
    '<input type ="button" name ="back" value="Go Back" onclick="history.go(-1)">';
    }
     

    /*
     * This is where the form gets procesed if it is seen as ok by the checker
     */
    if ($null_fields == FALSE)
    {
     
    $to 'XX e-mail-address here XX';
     
    $usr_name $_POST['usr_name'];
     
    $usr_add $_POST['usr_mail'];
     
    $type $_POST['msg_type'];
     
    $sub $_POST['subject'];
     
    $msg $_POST['comments'];
     echo 
    'All seems fine.<br>';
     echo 
    '<input type="submit" value="Send" name="submit" />';
    }
    ?>
    Last edited by DefecTalisman; 01-01-2008 at 05:32 AM.

    http://dev.x10hosting.com (this has nothing to do with x10hosting)

    ->All us helpful people here at x10hosting would like to reach our next user groups, "Community Paragon". Please click the +rep icon on the left hand side of a post if that post was helpfull.



  7. #7
    BlueJay is offline x10Hosting Member BlueJay is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    2

    Re: Forms Help

    Sorry I know I'm not involved in this discussion, but I can't help but ask. Why did he get the error message?

    Or more specifically why would someone with the example code that DefecTalisman was put up get an error message?

    Is it because post wasn't quoted?

    I was testing this out to see what was happening and I made it as far as the 'All is fine' page but upon clicking send it did nothing. Did I do something wrong or was this designed to not to send anything so it wouldn't spam the email address listed in there? I had changed the email address.
    Last edited by BlueJay; 11-20-2007 at 02:28 PM.

  8. #8
    bensbox is offline x10Hosting Member bensbox is an unknown quantity at this point
    Join Date
    Oct 2007
    Posts
    20

    Re: Forms Help

    I qish i knew what i was doing, i keep trying but nothing happens
    is it just x10hosting? do they only allow certain methods? or etc?
    Ben

  9. #9
    Join Date
    Aug 2007
    Location
    Gangstas Paradise
    Posts
    4,143

    Re: Forms Help

    The reason it wont work is it is missing the code to send the mail.

    All it will do at present is check the input fields to be true and then echo them back.

    http://dev.x10hosting.com (this has nothing to do with x10hosting)

    ->All us helpful people here at x10hosting would like to reach our next user groups, "Community Paragon". Please click the +rep icon on the left hand side of a post if that post was helpfull.



  10. #10
    epoclaen is offline x10Hosting Member epoclaen is an unknown quantity at this point
    Join Date
    Nov 2007
    Posts
    64

    Re: Forms Help

    To be 100% clear, the error is in the first 5 lines of the <body> tag.

    Code:
    1: <body>
    2: <p>FORM test</p>
    3: <form id="form1" name="form1" method="post" action="">
    4: <label></label>
    5: <form action="mailto:ben_johnson1991@hotmail.co.uk" method="get" enctype="text/plain" name="INFOform" id="INFOform">
    6: etc...
    Forms cannot be nested and require a closing </form> tag. So line #3 opens a form statement but then the code opens a second form statement on line 5 without closing the first one. And by "nested" I mean that you can't simply add a second closing </form> tag to the end of the code because one <form>...</form> statement would be inside the other which isn't allowed.

    Another issue in line #3 is that without anything in the "action" part of the opening <form> statement it doesn't know what to do when the form is submitted. The "action" part usually just tells the web page where to go when the user submits the form so a URL will do.

    The MAILTO: statement is a specific type of URL that opens up a new mail window in your default email client and includes the data provided such as the To:, Subject: and Body: data. So no, it won't actually send the mail for the user. The convenience of it is that it will at least open a new email for them and give the To: address for the user without them having to copy/paste it in.

    The URL can also take them to a PHP script that will process the form (as DefecTalisman said his example does in his last post) and yes, a PHP script can actually send the email for you. But this is a whole 'nother ball of wax that involves knowledge of PHP scripting and at least a good understanding of email headers. There are free PHP scripts out there that do most of this work for you but even then they need to be set up properly. You need to contact the admins to ask to be bumped up to the "Intermediate Free Hosting" plan too so that you can use the PHP mail() function.

Closed Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Tables and Forms
    By taekwondokid42 in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 11-04-2007, 09:22 AM
  2. Frontpage forms
    By rentphuk in forum Free Hosting
    Replies: 1
    Last Post: 10-10-2007, 09:49 AM
  3. Pre Modded Forms to Include the x10 ads
    By Chris S in forum Scripts & 3rd Party Apps
    Replies: 13
    Last Post: 09-06-2007, 08:14 AM
  4. php forms
    By TarinC in forum Scripts & 3rd Party Apps
    Replies: 7
    Last Post: 01-14-2006, 11:00 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers