Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for
php email form working from swish, but not once uploaded to my webspace?
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- php email form working from swish, but not once up...
php email form working from swish, but not once uploaded to my webspace?
07-10-2009 9:30 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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.
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.
Message 1 of 8
(3,000 Views)
7 REPLIES 7
Re: php email form working from swish, but not once uploaded to my webspace?
07-10-2009 10:26 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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) |
Message 2 of 8
(791 Views)
Re: php email form working from swish, but not once uploaded to my webspace?
07-10-2009 10:28 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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&";
?>
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&";
?>
Message 3 of 8
(791 Views)
Re: php email form working from swish, but not once uploaded to my webspace?
07-10-2009 10:47 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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) |
Message 4 of 8
(791 Views)
Re: php email form working from swish, but not once uploaded to my webspace?
07-10-2009 10:52 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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.
Message 5 of 8
(791 Views)
Re: php email form working from swish, but not once uploaded to my webspace?
07-10-2009 11:13 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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) |
Message 6 of 8
(791 Views)
Re: php email form working from swish, but not once uploaded to my webspace?
07-10-2009 11:14 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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?
Message 7 of 8
(791 Views)
Re: php email form working from swish, but not once uploaded to my webspace?
07-10-2009 11:33 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
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"
}
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"
}
Message 8 of 8
(791 Views)
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Plusnet Community
- :
- Forum
- :
- Help with my Plusnet services
- :
- Everything else
- :
- php email form working from swish, but not once up...