Professional Web Applications Themes

Why this form script doesnt work? - PHP Development

can anyone tell me why this doesnt work. i have a form page a php script but it doesnt work. i just get a page 405 error when i click send form Any ideas? form.php <form method="POST" action="thanks.php"> Name: <input type="TEXT" name="name"> Email: <input type="TEXT" name="email"> <input type="SUBMIT" name="Submit" value="ok"> </form> thanks.php <SCRIPT LANGUAGE="php"> $email = $HTTP_POST_VARS[email]; $mailto = com; $mailsubj = "Form submission"; $mailhead = "From: $email\n"; reset ($HTTP_POST_VARS); $mailbody = "Values submitted from web site form:\n"; while (list ($key, $val) = each ($HTTP_POST_VARS)) { $mailbody .= "$key : $val\n"; } mail($mailto, $mailsubj, $mailbody, $mailhead); </SCRIPT>...

  1. #1

    Default Why this form script doesnt work?

    can anyone tell me why this doesnt work.

    i have a form page a php script but it doesnt work. i just get a page 405
    error when i click send form

    Any ideas?


    form.php

    <form method="POST" action="thanks.php">
    Name: <input type="TEXT" name="name">
    Email: <input type="TEXT" name="email">
    <input type="SUBMIT" name="Submit" value="ok">
    </form>



    thanks.php

    <SCRIPT LANGUAGE="php">
    $email = $HTTP_POST_VARS[email];
    $mailto = com;
    $mailsubj = "Form submission";
    $mailhead = "From: $email\n";
    reset ($HTTP_POST_VARS);
    $mailbody = "Values submitted from web site form:\n";
    while (list ($key, $val) = each ($HTTP_POST_VARS)) {
    $mailbody .= "$key : $val\n"; }
    mail($mailto, $mailsubj, $mailbody, $mailhead);
    </SCRIPT>


    Dave Guest

  2. #2

    Default Re: Why this form script doesnt work?

    Dave wrote:
     

    [quoting http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html]
    10.4.6 405 Method Not Allowed
    The method specified in the Request-Line is not allowed for the resource
    identified by the Request-URI. The response MUST include an Allow header
    containing a list of valid methods for the requested resource.
    [/quoting http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html]
     

    ??? use.. '<?php'
     

    ??? use.. '?>'

    --
    www.iuz-lab.info
    iuz Guest

  3. #3

    Default Re: Why this form script doesnt work?

     
    >
    > ??? use.. '<?php'

    >
    > ??? use.. '?>'
    >
    > --
    > www.iuz-lab.info[/ref]



    Didn't work. Anyone else?



    Dave Guest

  4. #4

    Default Re: Why this form script doesnt work?

    just use

    $_POST['formname']


    bebbet Guest

  5. #5

    Default Re: Why this form script doesnt work?

    Dave wrote:
     
    >>
    >> ??? use.. '<?php'
    >> [/ref][/ref]
    [..] 

    [self quoting]
    [quoting http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html]
    10.4.6 405 Method Not Allowed
    ThemethodspecifiedintheRequest-Lineisnotallowedfortheresource
    identified by the Request-URI. The response MUST include an Allow header
    containing a list of valid methods for the requested resource.
    [/quoting http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html]
    [/self quoting]

    --
    www.iuz-lab.info
    iuz Guest

  6. #6

    Default Re: Why this form script doesnt work?

    Dave wrote:
     
    >>
    >> ??? use.. '<?php'
    >> [/ref][/ref]
    [..] 

    [self quoting]
    [quoting http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html]
    10.4.6 405 Method Not Allowed
    ThemethodspecifiedintheRequest-Lineisnotallowedfortheresource
    identified by the Request-URI. The response MUST include an Allow header
    containing a list of valid methods for the requested resource.
    [/quoting http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html]
    [/self quoting]

    --
    www.iuz-lab.info
    iuz Guest

  7. #7

    Default Re: Why this form script doesnt work?

    This mean that php is not allowed to receive POSTed data... What is your
    server ? IIS?

    Dae


    "Dave" <net> wrote in message
    news:news.uk.clara.net... 


    Daedalus.OS Guest

Similar Threads

  1. flash app doesnt work
    By zardon222 in forum Macromedia Flash Player
    Replies: 0
    Last Post: December 2nd, 11:56 PM
  2. Shockwave doesnt work
    By bills150 in forum Macromedia Shockwave
    Replies: 0
    Last Post: November 16th, 12:33 PM
  3. a simple php script doesnt run on IIS-windows XP
    By Asher Golan in forum PHP Development
    Replies: 4
    Last Post: February 8th, 01:34 AM
  4. Script doesnt work under wait command
    By Bodhisattvan webforumsuser@macromedia.com in forum Macromedia Director Basics
    Replies: 5
    Last Post: January 12th, 04:01 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139