cancel
Showing results for 
Search instead for 
Did you mean: 

Using PHP to send mail on plusnet

netman
Grafter
Posts: 27
Registered: 10-08-2007

Using PHP to send mail on plusnet

I am trying to post to a PHP page on my plusnet website so it send me an email when the form has been filled out. The only issue is that I keep getting 
Method Not Allowed
The requested method POST is not allowed for the URL...
How can I get this to work on Plusnet as I use my webspace to develope sites that I play with....
Anyone know?
Pete
6 REPLIES
prichardson
Grafter
Posts: 1,503
Registered: 05-04-2007

Re: Using PHP to send mail on plusnet

Based on the error you are receiving, the file has either been uploaded to, or your are calling the file on our Homepsages serverv.
Any PHP you have needs to be uploaded to our CCGI service, which is a seperate address.
A guide to using our CGI service can be found on the following pages.
http://www.plus.net/support/webspace/cgi_php/cgi_guide.shtml
netman
Grafter
Posts: 27
Registered: 10-08-2007

Re: Using PHP to send mail on plusnet

Hi
Thanks for getting back so quickly.
I have followed ALL the rules for the ccgi and I get dispalyed 'The Webpage cannot be found'. I have ccgi activated and I am using the post action of http://ccgi.username.plus.com/sendmail.php
Any ideas please
Pete
netman
Grafter
Posts: 27
Registered: 10-08-2007

Re: Using PHP to send mail on plusnet

OK!
I can get to the php file now... shame I can't spell!!!  Undecided
anyway...
Now I get
Execution of (cgi-bin/sendmail.php) is not permitted for the following reason:

Script is not executable. Issue 'chmod 755 filename'

I just want the PHP to send me posted info as an email. The code I have is:
<?php
//--------------------------Set these paramaters--------------------------
// Subject of email sent to you.
$subject = 'Results from Contact form';
// Your email address. This is where the form information will be sent.
$emailadd = 'me@myplusnetmail.plus.com';
// Where to redirect after form is processed.
$url = thankyou.htm;
// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req = '0';
// --------------------------Do not edit below this line--------------------------
$text = "Results from form:\n\n";
$space = ' ';
$line = '
';
foreach ($_POST as $key => $value)
{
if ($req == '0')
{
if ($value == '')
{echo "$key is empty";die;}
}
$j = strlen($key);
if ($j >= 20)
{echo "Name of form element $key cannot be longer than 20 characters";die;}
$j = 20 - $j;
for ($i = 1; $i <= $j; $i++)
{$space .= ' ';}
$value = str_replace('\n', "$line", $value);
$conc = "{$key}:$space{$value}$line";
$text .= $conc;
$space = ' ';
}
mail($emailadd, $subject, $text, 'From: '.$emailadd.'');
echo '<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>
prichardson
Grafter
Posts: 1,503
Registered: 05-04-2007

Re: Using PHP to send mail on plusnet

A hint is in the bit you have included in bold.
You need to ensure your PHP files has the correct permissions.
netman
Grafter
Posts: 27
Registered: 10-08-2007

Re: Using PHP to send mail on plusnet

P Richardson
Cool    FANTASTIC !!!!! It's working and I am well happy with the results..
AND SO QUICK TOO
Pete
prichardson
Grafter
Posts: 1,503
Registered: 05-04-2007

Re: Using PHP to send mail on plusnet

Happy to help.