On 11/10/02 3:07 PM, "Gajo Csaba" <[EMAIL PROTECTED]> wrote:
> Hi, I'm troubled by something I guess is easy to solve.
>
> I have a web site form, with two edit boxed, the user
> should write in two numbers there and the result should be
> their sum. I wrote something like this
>
> sub sum
> {
> $result = $_[0] + $_[1];
> return $result;
> }
>
> The user types in 4 and 5. And when he presses the Submit
> button the result should be printed out. It does not print
> it out, however, but instead I get an option to open
> test.pl or save it to disk. When I save it to disk, I get a
> Web site that actually contains the "print 9" (because of
> 4+5) line, but I have to open it again from the explorer.
The error is not in this snippet of code. The error is in the portion where
you are trying to print your result. You're probably not sending the
"Content-type" header to the client, so the browser doesn't know what the
following data is, therefore it doesn't know what program should handle it
(IE? Realplayer? Quicktime Player? Some other app?) and does the default
action to data to disk.
Show us the rest of the code and we might be able to help.
> p.s. Sorry i couldn't post the entire code, I can't
> remember it right now...
When you have a coding question, it's best to cut-and-paste directly from
the script, so that you don't have any inadvertent typos that throw
potential helpers off track, and so you can include the pertinent parts of
the script.
- geoff
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]