cancel
Showing results for 
Search instead for 
Did you mean: 

Will an email form in flash work via PHP on my site?

Chris
Legend
Posts: 17,724
Thanks: 600
Fixes: 169
Registered: ‎05-04-2007

Re: Will an email form in flash work via PHP on my site?

Can you try and log in now, the username and password are your normal details and the address to FTP to is ccgi.plus.net
Former Plusnet Staff member. Posts after 31st Jan 2020 are not on behalf of Plusnet.
Beetroot_Bertie
Grafter
Posts: 80
Registered: ‎31-07-2007

Re: Will an email form in flash work via PHP on my site?

Hi Chris,
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
zubel
Community Veteran
Posts: 3,793
Thanks: 4
Registered: ‎08-06-2007

Re: Will an email form in flash work via PHP on my site?

You need to make the script "executable"
A quick google for the procedure in Dreamweaver gave me this link
You need to set the permissions to 755
Hope that helps!
B.
Beetroot_Bertie
Grafter
Posts: 80
Registered: ‎31-07-2007

Re: Will an email form in flash work via PHP on my site?

Nice one! Thanks for that Barry.
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.
samuria
Grafter
Posts: 1,581
Thanks: 3
Registered: ‎13-04-2007

Re: Will an email form in flash work via PHP on my site?

If you just want to use flash here is the AS If you email me I can send you the FLA
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 ();
}
};
Beetroot_Bertie
Grafter
Posts: 80
Registered: ‎31-07-2007

Re: Will an email form in flash work via PHP on my site?

Thanks Samuria. I have to admit I'm winging it with ActionScript and learning as I go. My form script seems a bit different. I found a tutorial on the interweb which told me to create the form fields (I used 3: Name, Email and Comments), give them each a 'variable' name and then I used the following:
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
glyndev
Grafter
Posts: 620
Registered: ‎31-07-2007

Re: Will an email form in flash work via PHP on my site?

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.
samuria
Grafter
Posts: 1,581
Thanks: 3
Registered: ‎13-04-2007

Re: Will an email form in flash work via PHP on my site?

I should have pointed out my AS script doesnt need CGI, PHP it runs straight from the website using Plus net mail form. As I said if you email me I will send the FLA file and you can use that.
Beetroot_Bertie
Grafter
Posts: 80
Registered: ‎31-07-2007

Re: Will an email form in flash work via PHP on my site?

OK folks. Hopefully this will be my last problem related to this PHP script.
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.
Beetroot_Bertie
Grafter
Posts: 80
Registered: ‎31-07-2007

Re: Will an email form in flash work via PHP on my site?

My apologies for double posting but I've found out a bit more about the problem and I'm hoping someone might tell me what this means. I decided to test the form in Safari (I'd previously used Firefox and Camino) which offered the following response via its activity window. I've put the status response in brackets:
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.
Colin
Grafter
Posts: 1,264
Registered: ‎04-04-2007

Re: Will an email form in flash work via PHP on my site?

A quick google reveals http://www.crossdomainxml.org/ which talks about crossdomain.xml and what it's used for.
Beetroot_Bertie
Grafter
Posts: 80
Registered: ‎31-07-2007

Re: Will an email form in flash work via PHP on my site?

Thanks Colin.
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 Embarrassed
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?
Colin
Grafter
Posts: 1,264
Registered: ‎04-04-2007

Re: Will an email form in flash work via PHP on my site?

If you've recently activated it, DNS may not be active yet...
Beetroot_Bertie
Grafter
Posts: 80
Registered: ‎31-07-2007

Re: Will an email form in flash work via PHP on my site?

It's been active since monday morning. I deactivated it over the weekend then reactivated it hoping a "clean sheet" might help if I'd inadvertently affected something. Do you think deactivating and reactivating again may help, or how long should it take for the DNS to work?
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.
samuria
Grafter
Posts: 1,581
Thanks: 3
Registered: ‎13-04-2007

Re: Will an email form in flash work via PHP on my site?

When you use my AS form I sent what error do you get as it may be that all that is needed is for your site to be added to the refers file by plusnet. If its not in the file the form wont work but with it its 100% guaranteed to work as I have used it for years.
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