Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

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 = xxx@xxx.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>



Report this thread to moderator Post Follow-up to this message
Old Post
Dave
06-03-05 08:56 PM


Re: Why this form script doesnt work?
Dave wrote:

> 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?

[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]

>
>
> 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">

??? use.. '<?php'

>     $email = $HTTP_POST_VARS[email];
>     $mailto = xxx@xxx.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>

??? use.. '?>'

--
www.iuz-lab.info

Report this thread to moderator Post Follow-up to this message
Old Post
iuz
06-03-05 08:56 PM


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" <me@privacy.net> wrote in message
news:1117799674.19522.0@nnrp-t71-03.news.uk.clara.net...
> 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 = xxx@xxx.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>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Daedalus.OS
06-03-05 08:56 PM


Re: Why this form script doesnt work?
 
>
> ??? use.. '<?php'
> 
>
> ??? use.. '?>'
>
> --
> www.iuz-lab.info



Didn't work.  Anyone else?




Report this thread to moderator Post Follow-up to this message
Old Post
Dave
06-03-05 08:56 PM


Re: Why this form script doesnt work?
just use

$_POST['formname']



Report this thread to moderator Post Follow-up to this message
Old Post
bebbet
06-03-05 08:56 PM


Re: Why this form script doesnt work?
Dave wrote:

> 
[..]
>
> Didn't work.  Anyone else?

[self quoting]
[quoting http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html]
10.4.6 405 Method Not Allowed
 Â_TheÂ_methodÂ_specifiedÂ_inÂ_theÂ_Reque
st-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]
[/self quoting]

--
www.iuz-lab.info

Report this thread to moderator Post Follow-up to this message
Old Post
iuz
06-03-05 08:56 PM


Re: Why this form script doesnt work?
Dave wrote:

> 
[..]
>
> Didn't work.  Anyone else?

[self quoting]
[quoting http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html]
10.4.6 405 Method Not Allowed
 Â_TheÂ_methodÂ_specifiedÂ_inÂ_theÂ_Reque
st-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]
[/self quoting]

--
www.iuz-lab.info

Report this thread to moderator Post Follow-up to this message
Old Post
iuz
06-03-05 08:56 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Language archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 06:46 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.