CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Beginner:
Stop Response

 



desmondo
Deleted

Jan 20, 2000, 4:28 AM

Post #1 of 9 (1925 views)
Stop Response Can't Post

How do I stop a script from responding.
I have a flash file that sends variables to a cgi perl script. The flash file carries on and prints the thank you. The script writes these variables to a database (which is fine) - but then returns a page to the browser which overwrites my flash page. - Can I stop this


Borderline
Deleted

Jan 20, 2000, 4:32 AM

Post #2 of 9 (1924 views)
Re: Stop Response [In reply to] Can't Post

Hi,

Do you have access to the Perl program that does this? If so can you post the relevant parts from the script here?

Scott


desmondo
Deleted

Jan 20, 2000, 4:38 AM

Post #3 of 9 (1924 views)
Re: Stop Response [In reply to] Can't Post

Thanks Scott here it is!

#!/usr/bin/perl




$logfile ="../holdata/potential.txt";

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;
$in{$name} = $value;
}


# Print the http header
print "Content-type: text/html\n\n";


# Open the log
open(LOG,">>$logfile") | | die "I can't open $logfile \n";

print LOG "$in{'email'}:$in{'forename'}:$in{'surname'}\n";

close(LOG);


Borderline
Deleted

Jan 20, 2000, 4:45 AM

Post #4 of 9 (1924 views)
Re: Stop Response [In reply to] Can't Post

Sorry but I do not know flash at all. How is this being executed?
Is it like an SSI call or as an image src or are you just redirecting the browser to it?

Scott


desmondo
Deleted

Jan 20, 2000, 5:12 AM

Post #5 of 9 (1924 views)
Re: Stop Response [In reply to] Can't Post

Hi Scott
This is exactly the same as a submit button on a normal html form -it sends the variables to the script - which writes the database(potential.txt)except the flash submit button also displays a thank you from within the flash movie.
Which is why I don't need another return page from the script.


Borderline
Deleted

Jan 20, 2000, 5:18 AM

Post #6 of 9 (1924 views)
Re: Stop Response [In reply to] Can't Post

When you submit a form to anything it moves the browsers location to what you submited to. I have a couple of suggestions for you on this.
1) You can call the script with an SSI call or IMG tag.
2) You could submit to a hidden frame.

Let me know if this helps and if you need me to expand on one of these methods
Scott


desmondo
Deleted

Jan 20, 2000, 5:41 AM

Post #7 of 9 (1924 views)
Re: Stop Response [In reply to] Can't Post

Yea sounds like the solution can you expand?
Thanks


Borderline
Deleted

Jan 20, 2000, 6:05 AM

Post #8 of 9 (1924 views)
Re: Stop Response [In reply to] Can't Post

From the looks of what you are logging I am thinking the user filled out a form or something in your Flash thingy Smile.
So that would rule out the SSI call or the IMG tag.
Here is how you would submit to a hidden frame.
First the frame html <BLOCKQUOTE><font size="1" face="Arial,Helvetica,sans serif">code:</font><HR>


<HTML>
<HEAD>
<TITLE>My Cool Flash</TITLE>
</HEAD>
<FRAMESET ROWS="100%,*">
<FRAME NAME="main" SRC="yourflashthingy.html" SCROLLING="yes">
<FRAME NAME="hidden" SCROLLING="no">
</FRAMESET>
<NOFRAMES>
<H1>Sorry you must have a Frames browser to see this.</H1>
</NOFRAMES>
</HTML>
</pre><HR></BLOCKQUOTE>
Here is the form tag
<FORM action=soemcgi.cgi method=post target=hidden>

Note the target specifies the name of the hidden frame.
Like I said I am not familiar with flash so I am not sure how that form tag relates.

Scott


desmondo
Deleted

Jan 24, 2000, 8:42 AM

Post #9 of 9 (1924 views)
Re: Stop Response [In reply to] Can't Post

Thanks Scott that seems to have worked! Well done

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives