cancel
Showing results for 
Search instead for 
Did you mean: 

php email form working from swish, but not once uploaded to my webspace?

rectro
Dabbler
Posts: 14
Registered: ‎01-05-2008

php email form working from swish, but not once uploaded to my webspace?

Iv built my website based in fash using Swish Max 3.  I made a email form for my site which uses a php script.  In swish I can test the form without having to upload it, and it works.
I upload the working site to my htdocs, the site loads fine, however the email form does not work.
When directing the submit button to send emails iv directed the full url to the php files located in the main dir of the CGI space.  e.g http://ccgi.user.plus.com/contact.php
Any idears why this would work fine before trying to use it once on my webspace?
Thanks.
7 REPLIES 7
jelv
Community Veteran
Posts: 26,786
Thanks: 990
Fixes: 10
Registered: ‎10-04-2007

Re: php email form working from swish, but not once uploaded to my webspace?

Have you made the php script executable?
jelv (a.k.a Spoon Whittler)
   Why I have left Plusnet (warning: long post!)   
Broadband: Andrews & Arnold Home::1 (FTTC 80/20)
Line rental: Pulse 8 Home Line Rental (£14.40/month)
Mobile: iD mobile (£4/month)
rectro
Dabbler
Posts: 14
Registered: ‎01-05-2008

Re: php email form working from swish, but not once uploaded to my webspace?

I asume so,  is there somthing I have to do specialy to make it executable.  Only thing iv done is from my ftp client software made shure its permission sis set to 775.  Basicly im running the website from htdocs the default location, and the php is in my CGI domain.  The submit button is pointing to the CGI domain and the php file itself.
Here is the php script.

<?php
$name = $HTTP_POST_VARS['Name'];
$email = $HTTP_POST_VARS['Email'];
$message = $HTTP_POST_VARS['Message'];
$message = stripslashes($message);
$sendTo = "admin@cgdreams.co.uk";
$subject = "Message from Contact Form";
$msg_body = "Name: $name\n";
$msg_body .= "E-Mail: $email\n";
$msg_body .= "Comments: $message\n";
$header_info = "From: ".$name." <".$email.">";
mail($sendTo, $subject, $msg_body, $header_info);
echo "&errormessage=Email has been sent&";
?>
jelv
Community Veteran
Posts: 26,786
Thanks: 990
Fixes: 10
Registered: ‎10-04-2007

Re: php email form working from swish, but not once uploaded to my webspace?

Edit: Scrap that I'd just read you first sentence and assumed the worst - now taking a closer look!
jelv (a.k.a Spoon Whittler)
   Why I have left Plusnet (warning: long post!)   
Broadband: Andrews & Arnold Home::1 (FTTC 80/20)
Line rental: Pulse 8 Home Line Rental (£14.40/month)
Mobile: iD mobile (£4/month)
rectro
Dabbler
Posts: 14
Registered: ‎01-05-2008

Re: php email form working from swish, but not once uploaded to my webspace?

Quote from: jelv
Edit: Scrap that I'd just read you first sentence and assumed the worst - now taking a closer look!

I have set the permissions to code 775 which allows the script to be executedand read by the owner, group, and public.  Only write is unticked for group and public.
jelv
Community Veteran
Posts: 26,786
Thanks: 990
Fixes: 10
Registered: ‎10-04-2007

Re: php email form working from swish, but not once uploaded to my webspace?

See the PM I've just sent you with a copy of my own test script - I've checked that is still working. It also displays which of the four ccgi servers it is running on in case it is a problem with a specific server.
jelv (a.k.a Spoon Whittler)
   Why I have left Plusnet (warning: long post!)   
Broadband: Andrews & Arnold Home::1 (FTTC 80/20)
Line rental: Pulse 8 Home Line Rental (£14.40/month)
Mobile: iD mobile (£4/month)
rectro
Dabbler
Posts: 14
Registered: ‎01-05-2008

Re: php email form working from swish, but not once uploaded to my webspace?

Quote from: jelv
See the PM I've just sent you with a copy of my own test script - I've checked that is still working. It also displays which of the four ccgi servers it is running on in case it is a problem with a specific server.

Thankyou for your help, I received the email and am checking that script now.
Im not a programer, and dont understand a fraction of what im doing to be honnest.  Im setting up a website for my business, and havent got time to learn another language like php when I dont even know basic HTML.
Im using Swish which prety much does most stuff for me.  Iv followed a tutorial on how to make a contact form so it works with a pre made php script which all iv done is added my email address to it, then uploaded it to my CGI site.
What I need to understand I think, is how comes I can type the cgi url directing to my php script and it works, I can test the web page in swish and it works, while the uploaded site on my htdocs does not work only for the contact form?
rectro
Dabbler
Posts: 14
Registered: ‎01-05-2008

Re: php email form working from swish, but not once uploaded to my webspace?

Another thing that is odd is in Swish iv addewd a command that gets executed after the release of the button to go back to the main site.  This means that when I press submit it has to go through the press button command which is to execute the script located at my CGI site.  Now if I was to upload the contact webpage into my cgi space and goto that url, the contact form shows and works.  So there seems to be a problem with the htdocs not having access to the cgi webspace.  If The site is hoasted from my PC the contact form works, if hosted from my HTDocs web space it dont work?
Here is the Swish commands to the submit button on my contact form.
on (press) {
  Name = userName.text;                               "this grabs the user name in the filled input box"
  Email = userEmail.text;                                "this grabs the user email in the filled input box"
  Message = userMessage.text;                   "this grabs the message typed in the filled input box"
this.loadVariables("http://ccgi.username.plus.com/contact.php",'POST');  "this send the typed in text to the php script"
}
on (release) {
   getURL("http://www.cgdreams.co.uk/", "_top");  "this then take you to the main home page"
   
}