Email form without PHP

Is there a way of making an email form in flash WITHOUT the use of PHP, or even without the use of anything (except the .swf) serverside?

I take it you’re hosting with a free hosting company like Geocities or something that don’t support PHP!?

Simple answer is no. You need to use PHP or ASP or some other similar technology.

So if I have a separate server which does support PHP or ASP, can I use that?

yep:lol:

scotty(-:

Yes. You can send eMails without using server side technology. see this link.
http://www.webthang.co.uk/tuts/tuts_fmx/gfmx3/gfmx3_1.asp

Sorry, that isn’t the kind of solution i’m looking for.
This is for a childrens website, and I don’t know if they will have any mail programs set up.
This is the site at the moment: www.stickytv.co.nz It is a childrens website for a TV show on every weekday, and comparing it to this: [URL=http://www.squirt.tv]squirt.tv which from what i can gather, was made by someone who uses kirupa.com, and it is wonderful, I would be ecstatic if I could make one ot this quality.
Anyway, I am just a 15 year old, bored in the holidays, in NZ, and I decided it was pathetic, so i e-mailed the admin, and now I am redoing it.
If you have a look at the source of their Contact Us! page, you will see it uses a .pl extension to send an email from the form. Is it possible to use this to send from flash?
And Scotty, don’t laugh, i’m just a newbie at web design…

If you have a look at the source of their Contact Us! page, you will see it uses a .pl extension to send an email from the form. Is it possible to use this to send from flash?

Yes you can interface flash with a PERL script, I have done it and it is quite easy. This is still a server side technology though using the CGI standard. Why do you not want to use a server side technology?

Because I want a flash based email form

Because I want a flash based email form

Yeah I gathered that, but using flash with server side technology is how you make a flash based form.

Oops, read your question wrong :slight_smile:
I want to do it without server side because the server I am using doesn’t support it.
Can someone help me with using the .pl script on that server? I need to know how to integrate it with flash.

Here is a PERL (.pl) script I have used in place of PHP, copy and paste it into a plain text file and save as mail.pl, upload it to the server into your cgi-bin directory and be sure it is CHMODed to 755:


#!/usr/bin/perl

require "subparseform.lib";
&Parse_Form;

$Email = $formdata{'Email'};
$FirstName = $formdata{'FirstName'};
$ToComments = $formdata{'ToComments'};

$ToEmail = "aknatn411\@comcast.net";
$ToSubject = "Response from Smorgy Porf";

$EmailBody = "Sent By: $FirstName
Senders Email: $Email


Message Sent:
$ToComments
";

$EmailFooter = "
This message was sent by: $FirstName.  If you feel that you 
recieved this e-mail by accident please contact us at www.smorgyporf.com";

$Message = $EmailBody.$EmailFooter;

open (MAIL, "|/usr/sbin/sendmail -t") || &ErrorMessage;
print MAIL "To: $ToEmail 
From: $Email
";
print MAIL "Subject: $ToSubject
";
print MAIL "$Message
";
close (MAIL);

print "Content-type: text/html

";
print "_root.contact.contact_window.text.EmailStatus=Complete - Your communication has been sent";

sub ErrorMessage {
print "Content-type: text/html

";
print "_root.contact.contact_window.text.EmailStatus=Failed Please email info@smorgyporf.com";
exit; }

And here is the Action script, attach it to your submit button:


on (release) {
 if (!Email.length || Email.indexOf("@") == -1 || Email.indexOf(".") == -1) {
 EmailStatus = "Enter valid email";
 }
 else if (!FirstName.length) {
 EmailStatus = "Enter Name";
 }
 else if (!ToComments.length) {
 EmailStatus = "Please fill comments";
 }
 else {
 loadVariablesNum ("http://www.smorgyporf.com/cgi-bin/mail.pl", "0", "Post");
 EmailStatus = "Sending... Please be patient...";
 }
}

If you can’t figure out how to do the variables let me know and I’ll give you more instructions.

Thanks for all that, but I can’t use that, the question with the .pl script was could I use the one which was already there and being used, nd from what I can work out, these are the needed variables:

http://home.xtra.co.nz/cgi-bin/FormMail.pl
<input type=hidden name=“recipient” value=“stickytv@pickledpossum.co.nz”>
<input type=hidden name=“subject” value=“Sticky TV comments”>
<input type=hidden name=“redirect” value=“http://www.home.xtra.co.nz/hosts/stickytv/thanks-for-feedback.html”> <input type=text name=“realname” size=30>
<input type=text name=“email”>
<textarea name=“comments”>

That is not all the code there is, it’s just the bits I think are needed.

The user inputs would be, in their order, with examples:
realname : bob the builder
email : bob@thebuilder.com
comments : I can fix it!

If you’re using formmail (great ol’ mailscript), you can easily set it up to recieve variables from Flash. It even has built-in support for GET/POST, so you need not worry about that! (though it wouldn’t hurt to pay a bit of attention to it…).

Yes, it is FormMail, so could you please tell me how to code my file? Remember, I am a n00b at this sort of thing, maybe you could lead me to a tutorial?

I wasn’t making fun out of you, but laughing for my short answer…

scotty(-:

Ok, you’re confusing me big time here. You want to Mod formMail to use it with flash. You did not post any valuable part of the script, just the html side of the form, which is what you need to make in flash. The script itself is what you need to mod. That’s no sweat either, but really you will just end up with a more complicated version of the script I gave you. You have PERL abilitiy since you’re using formMail there, why not upload the easy one I sent you?

  1. The FormMail script is on the ISP’s server, but I figured the html thing may help as to what variables are needed.
  2. The account on the server I have access to does not support perl, PHP, or most other scripts.

I see, so your isp let’s you send email via THEIR formMail script as a remotely hosted cgi script.

Bottom line, you need to be able to modify the formMail script, which you do not have access to, so you can not modify.

So even if I get a copy of the script, I still have to edit it to make it compatible with flash?

like I said before

I don’t know of any other way, at least not and provide any feedback. You could theoretically be submitting the same variables via flash through the getURL method, but I don’t know for sure because the script does not reside locally on your server, so you got me there. Have you ried setting up the form in flash the same way you would setup the form in html and just submitting it tothe script? You have to test it after uploading it to your server for sure, I am pretty sure it would not work locally. Try that and see what happens.