|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
|
|
Free Web 2.0 Code Generator! Generate data entry and reporting .NET Web apps in minutes. Quickly create visually stunning, feature-rich apps that are easy to customize and ready to deploy. Download Now!
|
|
#1
|
|||
|
|||
|
server side script problem
i am new to Flash and i am redoing a site in Flash which is going Ok
On the old site I had three cgi scripts all in Perl which I am trying to use for flash forms one ws a poll the other an Email and the third is a news bulleten I am starting with the Email one script attached &parse; &mime; &get_date; &br; &prt; $ver = '2.1'; $mailprog =~ s/[{}]//ig; chomp($mailprog); $name = $FORM{name}; $email = $FORM{email}; $tel = $FORM{tel}; $number = $FORM{number}; $road = $FORM{road}; $postcode = $FORM{postcode}; chomp($name); chomp($email); chomp($tel); chomp($message); open(FL, "|$mailprog -t") || die "Can't open $mailprog! on $now because of $!.\n"; print FL "TO: $admin\n"; print FL "FROM: $email\n"; print FL "SUBJECT: $adminsubject\n\n"; print FL "DATE: $now\n\n"; print FL "You have received an e-mail from a visitor with the following message:\n"; print FL "-------------------------------------------------------------------------\n\n"; print FL "Name: $name\n\n"; print FL "E-mail: $email\n\n"; print FL "tel: $tel\n\n"; print FL "Message: $message\n\n"; print FL "Form Page: $ENV{'HTTP_REFERER'}\n\n"; close(FL); unless (!$autoresponder) { open(FL, "|$mailprog -t") || die "Can't open $mailprog! on $now because of $!.\n"; print FL "TO: $email\n"; print FL "FROM: $admin\n"; print FL "SUBJECT: $autosubject\n\n"; print FL "DATE: $now\n\n"; print FL "$automessage\n\n"; print FL "$br\n\n"; close(FL); } open(FL2,">>applybackup.txt"); print FL2 "Message received on $now:\n"; print FL2 "Name: $name\n"; print FL2 "E-mail: $email\n"; print FL2 "tel: $tel\n"; print FL2 "Message: $message\n\n"; close(FL2); sub br { $br=''; $br1= "----------------------------------------------------------------------------------------\n"; $br=$br1.'ApplyContact powered by www.ApplyTools.com!'; } sub get_date { @days = ('Sunday','Monday','Tuesday','Wednesday','Thursday ','Friday','Saturday'); @months = ('January','February','March','April','May','June' ,'July','August','September','October','November', 'December'); ($sec,$min,$hour,$mday,$mon,$year,$wday) = (localtime(time))[0,1,2,3,4,5,6]; $time = sprintf("%02d:%02d:%02d",$hour,$min,$sec); $year += 1900; $now = "$days[$wday], $months[$mon] $mday, $year"; } sub prt {print "<html><head><META HTTP-EQUIV=Refresh CONTENT=\"2; URL=$thankyou\"></head><body><img src = \"http://www.applytools.com/wb/af.pl\" height = 1 width = 1>";} sub parse {if ($ENV{"REQUEST_METHOD"} eq 'GET') {$buffer = $ENV{'QUERY_STRING'};} else {read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});}@pairs = split(/&/, $buffer);foreach $pair (@pairs) {($name, $value) = split(/=/, $pair);$value =~ tr/+/ /; $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;$FORM{$name} = $value;}}sub mime {print "Content-type: text/html\n\n";} how would I define the variable $FORM in flash because i think this is what is not working. I get the email back but none of the values typed into the Flash form are recorded. Please help as i have been all over the web searching and the talk is all about PHP not Pearl and I am fed up of learming new scripts Regards LouLou |
|
#2
|
|||
|
|||
|
ok, let me get this right, your using this script to send out the email? so you have a form in flash, and then you use LoadVariablesNum (i think thats it) to send the data to the perl script, and then thats to process and send the email?? is that right? because i actually dont know perl so im just guessing here.
Do you want the perl script to send any data back to flash? |
|
#3
|
|||
|
|||
|
Dear Ben
No its just a FormMail script The user types in their info and then thats sent back to us via email detailing all their info. There is also a bit about once they have filled in their info and press submit it defaults to a Thank you page. that all works using the Flash form iget an email back but it does not list the info typed in.so the form is accessing the script and running the script but just not passing the variables. this is the action i use for my submit button on (press) { } onClipEvent (load) { getURL("http://blah blah/cgi-script", "_self", "POST"); } should i be using load variablesnum? your help is greatly appreciated kind regards loulou |
|
#4
|
|||
|
|||
|
Yes, you should be using loadvariablesnum
I would suggest reading my dynamic flash articles to get a better idea of how dynamic flash works. |
|
#5
|
|||
|
|||
|
thank you for your help but as is always the way by trawling through the web I found the answer aswell
its to do with a sub routine which unravels flash into perl pairs. With html forms it is not required which is why my perl scripts work Ok but with flash the variables are not passed the same way. I don't really know that much about PERl but i found a great tutorial on Flash-DB which had this sub routine as a file so i am up and running. Of course using LoadVars is another thing I should have done. still you only need to learn once. Thank you for the time and trouble. Kind Regards LouLou |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Flash Development > server side script problem |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|