I have two assumptions:
First, you understand HTTP (how browser and web server communicate) well.
And I say, your requirement is really rare. And perhaps you want to cheat a
browser, or someone. Yet it doesn't make sense to me.
Second, you don't understand HTTP (how browser and web server communicate)
well. And I say, I don't understand it very well either.
But let me tell you that the web server must always send (a proper, that
is, at least with valid header) output to the browser. That's how, simply
put, they work. The browser requests, the web server responds.
And that's why you get the 'friendly' 500 error message, you break the
rule, you don't respond nicely to the browser. And you see, even when
you make a mistake by running away from your duty, the web server still
try the last chance to communicate with the browser.
So there's no such silent ending (if I understand what you mean clearly by
that). You still have to say something to bring the communication back in
fluent. Redirecting to another location, as your current ending, is one
way. Is there a better way? Yes, of course :-) But the question is,
what do you really want?
Ok, Nigel just gave you a nice example. But if you really want no output
at all, just sent the status code 204 along with the header as someone else
previously posted.
s.a.n
--
Hasanuddin Tamir: [EMAIL PROTECTED] - Trabas: www.trabas.com
On Wed, 30 May 2001, Rodney Myers <[EMAIL PROTECTED]> wrote,
> Date: Wed, 30 May 2001 10:55:55 +0100
> From: Rodney Myers <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: Re: Silent Ending
>
> Thanks for the reply. Often a good idea, but in this case precisely NOT what
> is required.
>
> Rodney.
>
> -----Original Message-----
> From: Nigel G Romeril <[EMAIL PROTECTED]>
>
> Subject: Re: Silent Ending
>
>
> >Why not send him a acknowledgement, like so
> >
> ><HTML>
> >
> ><HEAD>
> >
> ><TITLE>Jersey Hotels - Acknowledgement</TITLE>
> ></HEAD>
> >
> ><BODY BGCOLOR="#FFFFFF">
> >
> ><CENTER>
> ><FONT SIZE=+3 COLOR="#FF0000">Jersey Hotels</FONT>
> ><FONT SIZE=+1><P>
> >Thank-you for your interest<BR>
> >Your entries have been submitted & will be dealt with promptly
> ></FONT>
> ><P>
> >
> >[ <A HREF=/jsyinfo/index.html">Jersey Information</A> ]<P>
> >
> ></CENTER>
> >
> ></BODY>
> >
> ></HTML>
> >
> >Rodney Myers wrote:
> >
> >> Hello,
> >>
> >> My script creates an email using sendmail.
> >> The script is not called directly from the browser but from another
> server
> >> as as the indirect result of a submit to that server.
> >>
> >> So there is no need to write anything to the browser, nor to redirect the
> >> browser. But I seem to a get a server 500 error unless I do one of those
> >> things.
> >>
> >> This is my current ending:
> >>
> >> print MAIL "blah\n";
> >> print MAIL "more blah\n";
> >> close (MAIL);
> >> $url="http:\/\/www.somedomain";
> >> print "Location: $url\n\n";
> >> exit;
> >>
> >> I suspect there is a better way....?
> >>
> >> TIA
> >>
> >> Rodney
> >> Oxford, England.
> >
> >
>