Will an email form in flash work via PHP on my site?
- 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
- :
- Will an email form in flash work via PHP on my sit...
Re: Will an email form in flash work via PHP on my site?
30-01-2008 2:27 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Will an email form in flash work via PHP on my site?
30-01-2008 2:40 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I've just tried setting up a connection via Dreamweaver and it all appears to fine, showing a remote folder "cgi-bin" within a root folder "/"
So I think all is well.
Thanks again for your help.
EDIT:
Erm. Another problem now (sorry)
I have put the test php file up which I can now access via my browser but it fails to run giving me the error below. Any ideas? The test php was:
<?
mail("yourname@yourdomain","test","Ok, it works");
?>
The error is:
CCGI Error: Execution of this script not permitted
Execution of (emailtest.php) is not permitted for the following reason:
Script is not executable. Issue 'chmod 755 filename'
Server Data:
Server Administrator/Contact: support@plus.net
Server Name: ccgi.xxxx.plus.com
Server Port: 80
Server Protocol: HTTP/1.1
Virtual Host: ccgi.xxxx.plus.com
Request Data:
User Agent/Browser: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11
Request Method: GET
Remote Address: xx.xxx.xxx.xx
Remote Port: 52750
Re: Will an email form in flash work via PHP on my site?
30-01-2008 3:08 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
A quick google for the procedure in Dreamweaver gave me this link
You need to set the permissions to 755
Hope that helps!
B.
Re: Will an email form in flash work via PHP on my site?
30-01-2008 3:34 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I couldn't get DW to update the permissions it as I'm using an older version, but I've managed to update the permissions with a FTP client and the test script works. I've just received the test email back.
Cheers.
Re: Will an email form in flash work via PHP on my site?
30-01-2008 11:01 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
function sendForm () {
my_lv = new LoadVars ();
my_lv.fName = first_name_txt.text;
my_lv.lName = first_name_txt.text;
my_lv.email = email_txt.text;
my_lv.the_message = message_txt.text;
my_lv.recipient = "jan@janwright.co.uk";
my_lv.subject = "flash test";
my_lv.send ("http://homepages.plus.net/cgi-bin/form", "POST");
nextFrame ();
}
send_btn.onRelease = function () {
if (first_name_txt.text == "" || first_name_txt.text == "" || email_txt == "" || message_txt.text == "") {
status_txt.text = "Please complete the entire form ...";
} else {
status_txt.text = "";
sendForm ();
}
};
Re: Will an email form in flash work via PHP on my site?
31-01-2008 9:59 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
The actionscript for the submit button in the root timeline is:
send_mc.sendicon_mc.onRelease = function() {
form.loadVariables ("http://ccgi.myaccountname.plus.com/email.php", "POST");
}
The variables are sent to the PHP file which is:
<?php
$sendTo = "myemailaddress@yahoo.co.uk";
$subject = "Website response";
$headers = "From: " . $_POST["name"];
$headers .= "<" . $_POST["email"];
$message = $_POST["comments"];
mail($sendTo, $subject, $message, $headers);
?>
The movieclip of the form has this action attached to it which I believe moves a frame forward once the data has been sent:
onClipEvent(data){
_root.nextFrame();
}
Does this seem like good practice or would you advise a different approach? It appears to work fine so far. If you don't mind, I'll try to incorporate your feedback response to the send button though just in case the form isn't fully filled out. Thanks
Re: Will an email form in flash work via PHP on my site?
31-01-2008 7:36 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Quote from: Barry Plusnet webspace is split in to two halves.
The main Homepages server provides a method of serving up 'static' content. These are generally basic HTML pages or images.
The CCGI server handles serving up 'active' content, such as PHP.
I thought that it was split 3 ways. Homepages, CCGI and Frontpage servers.
Would it not be possible to use the freely available webmail script that +net provide?, even though they are perl scripts. http://www.plus.net/support/webspace/cgi_php/cgi_scripts.shtml. Or has this facility been withdrawn. I know that the counter script still works.
Question to support
As an aside what version are these 2 scripts and when where they last updated?. how about updating and possibly offering alternative mail and counter scripts. e.g. a perl and a PHP version of each.
Re: Will an email form in flash work via PHP on my site?
01-02-2008 12:01 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Will an email form in flash work via PHP on my site?
02-02-2008 12:49 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
My CGI space is available, I've uploaded the script and changed the permissions to 755. All is well. When I test publish the flash file direct on my computer and submit the mail, it comes in to my mail box which is exactly what I wanted. The only thing is, when I upload the same flash file to my webspace to test the email function, it won't send the data to the PHP file, as if the send button doesn't work. After pressing the send button, at the bottom of my Firefox browser it says "Waiting for ccgi.username.plus.com..."
In addition to this, when I try to access my cgi page directly via my browser with http://ccgi.username.plus.com/, I get the message "Forbidden. You don't have permission to access / on this server." This was working fine when the CGI was first set up.
If I test-publish the same flash file again, direct on my Mac the email works fine again and it communicates with the CGI script fine.
Any ideas what's going on? Am I doing something blatantly wrong here or could there something up with the CGI space? Ta.
EDIT: I've noticed on the support pages the following:
e. Directory permissions The base permissions you need on a directory is chmod 750.
Additionally, a special bit is set on the group permission that ensures all files you create in the directory are group-owned by the group nogroup. If this special bit is removed, files under that directory will be owned by the wrong group and you won't be able to access the contents via a web browser.
Due to a security restriction which protects the system from published hacking attempts, you will NOT be able to add this bit back by yourself.
Could I have done something to this "special bit" whatever that is?
I'm going to deactivate my CGI and reactivate tomorrow. Maybe this might help.
Also, does anyone know how to change my CGI password with a Mac as the instructions seem to be Windows biased using telnet.
Re: Will an email form in flash work via PHP on my site?
05-02-2008 10:08 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Address
http://ccgi.username.plus.com/crossdomain.xml ; (not found)
http://www.username.plus.com/my_swf_file.swf ; (67.1KB)
http://www.username.plus.com/favicon.ico ; (not found)
http://www.username.plus.com/index2.html ; (1.2KB)
So what is this "crossdomain.xml"?
I'm assuming it should be up in my ccgi space. Any ideas about it's purpose or how it might be affecting my forms ability to access the script once online?
My thanks.
Re: Will an email form in flash work via PHP on my site?
05-02-2008 10:14 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Will an email form in flash work via PHP on my site?
06-02-2008 12:19 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I have just tried uploading such an XML file and whilst it now prevents the error in Safari, the problem still exists and the data doesn't seem to send to the php file
Oh well. I'm going to sleep on it. Cheers anyway.
I still can't access my cgi space via my browser though. Any thoughts on why, as I can't help feeling that it's part of the same problem?
Re: Will an email form in flash work via PHP on my site?
06-02-2008 11:53 AM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
Re: Will an email form in flash work via PHP on my site?
06-02-2008 12:19 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
I've tried Samuria's help too, trying to use the PlusNet CGI email script and whilst the test files he so kindly sent me, tell me that the mail is sent, all that happens is that my browser opens up the page (http://homepages.plus.net/cgi-bin/form) but fails to deliver the test mail to the appended recipient (me at a plusnet address).
I'm getting quite despondent here but the fact that I can't access the ccgi space of mine via my browser suggests there may some sort of problem and that it may be this that's causing these hiccups.
Thanks again for you help, I really appreciate it.
EDIT:
I've been desperately trying to sort this now to no avail, so I thought I'd try a different php script. I went direct to the source and downloaded a form file and php file from Adobe's site:
http://www.adobe.com/cfusion/exchange/index.cfm?event=extensionDetail&extid=1047892
So, I modified the actionscript in flash to refer to my cgi space but changed nothing else:
stop();
send_btn.onRelease = function() {
my_vars = new LoadVars();
my_vars.sender = email_box.text;
my_vars.subject = subject_box.text;
my_vars.message = message_box.text;
if (my_vars.sender != "" and my_vars.subject != "" and my_vars.message != "") {
my_vars.sendAndLoad("http://ccgi.username.plus.com/mailer.php", my_vars, "POST");
gotoAndStop(2);
} else {
error_clip.gotoAndPlay(2);
}
my_vars.onLoad = function() {
gotoAndStop(3);
};
};
email_box.onSetFocus = subject_box.onSetFocus=message_box.onSetFocus=function () {
if (error_clip._currentframe != 1) {
error_clip.gotoAndPlay(6);
}
};
Then I modified the Adobe PHP and changed nothing else but the email return path:
<?php
/* ---------------------------
php and flash contact form.
by www.MacromediaHelp.com
---------------------------
Note: most servers require that one of the emails (sender or receiver) to be an email hosted by same server,
so make sure your email (on last line of this file) is one hosted on same server.
--------------------------- */
// read the variables form the string, (this is not needed with some servers).
$subject = $_REQUEST["subject"];
$message = $_REQUEST["message"];
$sender = $_REQUEST["sender"];
// include sender IP in the message.
$full_message = $_SERVER['REMOTE_ADDR'] . "\\n\\n" . $message;
$message= $full_message;
// remove the backslashes that normally appears when entering " or '
$message = stripslashes($message);
$subject = stripslashes($subject);
$sender = stripslashes($sender);
// add a prefix in the subject line so that you know the email was sent by online form
$subject = "Contact form ". $subject;
// send the email, make sure you replace email@yourserver.com with your email address
if(isset($message) and isset($subject) and isset($sender)){
mail("website@username.plus.com", $subject, $message, "From: $sender");
}
?>
I then uploaded the slightly modified PHP and SWF files to my space. The same ruddy problem occurs! If I test locally, it all works swell and I get the email back but if I try it online, nada. So a local SWF file will communicate fine to the external PHP but the same SWF online won't. I'm tearing my hair out here :'(.
I'm sorry for repeating myself, I'm just trying to get to the bottom of it. Is there any way a staff member could please check my CGI area to see if there's anything odd that might be causing this, maybe some kind of permissions or something?
I've come to the end of me tether now but I'm loathe to fall back on the mailto: way of doing it but feel I have no choice. Thank you to everyone who's tried to help so far.
Re: Will an email form in flash work via PHP on my site?
06-02-2008 10:53 PM
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Report to Moderator
if the error says something like
If you are attempting to configure FormMail to run with this form, you need to add the following to @referers, explained in detail in the README file.
Add 'community.plus.net' to your @referers array.
get onto plus net and ask them to add you then try again and mine will work
What is your web URL so we can look for ourselves
- 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
- :
- Will an email form in flash work via PHP on my sit...