cancel
Showing results for 
Search instead for 
Did you mean: 

support for POST, GETcommand - PHP scripts

N/A

support for POST, GETcommand - PHP scripts

At the moment I am coding php scripts for college and every time I send details to a email form to my email account I get: -

Method Not Allowed
The requested method POST is not allowed for the URL

Here are my html and PHP scripts: -

<HTML><HEAD>
<TITLE>Form to email test</TITLE>
</HEAD><BODY>
<FORM method=post action="sendmail.php">
Email: <INPUT name="email" type="text"><br>
Message: <br>
<TEXTAREA name="message">
</textarea><br>
<input type=submit>
</FORM></BODY></HTML>


<HTML><BODY>
<?
$message = $HTTP_POST_VARS["message"];
$email = $HTTP_POST_VARS["email"] ;
mail("","Testing mail",$message, "From: $email" );
?></BODY></HTML>

Already set permissions to 755 with no joy and tested on different email accountas

(The college servers are OK with these scripts)

Does Plus.net web server suppost for these types of commands (post and get). What can I do to get this type of script running perfectly

Thanks
5 REPLIES
shellsong
Grafter
Posts: 2,191
Registered: 03-08-2007

RE: support for POST, GETcommand - PHP scripts

Sorry, can't help you with your problem but I can give you a little tip.

You don't need this section of code:

$message = $HTTP_POST_VARS["message"];
$email = $HTTP_POST_VARS["email"] ;

PHP automatically puts the data from a post into a variable of the name from the form the post was in.


P.S.
The forum is really screwed! Replying to your post gives this:
http://mainframe39.mikeasoft.com/junk/screwypnetforums.png
N/A

RE: support for POST, GETcommand - PHP scripts

> PHP automatically puts the data from a post into
> a variable of the name from the form the post was
> in.

Doesn't that depend on registerglobals in php.ini?
N/A

RE: support for POST, GETcommand - PHP scripts

and the version of php. try your scripts without those line as it may not be support on +net version. You are correct doing it that way is the best way of doing it in later versions


> > PHP automatically puts the data from a post into
> > a variable of the name from the form the post was
> > in.
>
> Doesn't that depend on registerglobals in php.ini?

N/A

RE: support for POST, GETcommand - PHP scripts

I think you should really be using the new superglobal arrays e.g.

$_POST["email"]

instead of

$HTTP_POST_VARS["email"]
N/A

RE: support for POST, GETcommand - PHP scripts

Hi Guys,

I would say this thread was more appropriate for the CGI forum. PHP won't work on the normal webserver, but will be fine if you are using the CGI forum.

Regards,

Ian Wild
PlusNet Customer Support