Help - Search - Member List - Calendar
Full Version: Why this form script doesnt work?
WorkTheWeb Forums > Webmaster Resources > PHP Help
Support our Sponsors!
Dave
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 = [Email Removed];
$mailsubj = "Form submission";
$mailhead = "From: $emailn";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$mailbody .= "$key : $valn"; }
mail($mailto, $mailsubj, $mailbody, $mailhead);
</SCRIPT>

iuz
Dave wrote:

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

QUOTE


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'

QUOTE
$email = $HTTP_POST_VARS[email];
$mailto = [Email Removed];
$mailsubj = "Form submission";
$mailhead = "From: $emailn";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$mailbody .= "$key : $valn"; }
mail($mailto, $mailsubj, $mailbody, $mailhead);
</SCRIPT

??? use.. '?>'

--
www.iuz-lab.info

Dave
QUOTE
thanks.php

<SCRIPT LANGUAGE="php"

??? use.. '<?php'

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

??? use.. '?>'

--
www.iuz-lab.info



Didn't work. Anyone else?

bebbet
just use

$_POST['formname']

iuz
Dave wrote:

QUOTE

thanks.php

<SCRIPT LANGUAGE="php"

??? use.. '<?php'

$email = $HTTP_POST_VARS[email];
$mailto = [Email Removed];
$mailsubj = "Form submission";
$mailhead = "From: $emailn";
reset ($HTTP_POST_VARS);
[..]

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 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]
[/self quoting]

--
www.iuz-lab.info

iuz
Dave wrote:

QUOTE

thanks.php

<SCRIPT LANGUAGE="php"

??? use.. '<?php'

$email = $HTTP_POST_VARS[email];
$mailto = [Email Removed];
$mailsubj = "Form submission";
$mailhead = "From: $emailn";
reset ($HTTP_POST_VARS);
[..]

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 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]
[/self quoting]

--
www.iuz-lab.info

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

Dae


"Dave" <[Email Removed]> wrote in message
news:[Email Removed]...
QUOTE
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 = [Email Removed];
$mailsubj = "Form submission";
$mailhead = "From: $emailn";
reset ($HTTP_POST_VARS);
$mailbody = "Values submitted from web site form:n";
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$mailbody .= "$key : $valn"; }
mail($mailto, $mailsubj, $mailbody, $mailhead);
</SCRIPT




PHP Help | Linux Help | Web Hosting | Reseller Hosting | SSL Hosting
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2006 Invision Power Services, Inc.