Flash Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignFlash Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old October 22nd, 2002, 02:19 PM
loulou loulou is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 5 loulou User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #2  
Old October 22nd, 2002, 09:00 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
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?

Reply With Quote
  #3  
Old October 23rd, 2002, 11:34 AM
loulou loulou is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 5 loulou User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
  #4  
Old October 23rd, 2002, 08:23 PM
Ben Rowe
Guest
Dev Articles Newbie (0 - 499 posts)
 
Posts: n/a  
Time spent in forums:
Reputation Power:
Yes, you should be using loadvariablesnum

I would suggest reading my dynamic flash articles to get a better idea of how dynamic flash works.

Reply With Quote
  #5  
Old October 24th, 2002, 11:52 AM
loulou loulou is offline
Junior Member
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 5 loulou User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
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

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignFlash Development > server side script problem


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

Request Your Free Technology Downloads!
 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

Request Your Free Technology Downloads!
 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

Request Your Free Technology Downloads!
 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

Request Your Free Technology Downloads!
 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

Request Your Free Technology Downloads!
 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
For more Enterprise Application Development news, visit eWeek