Weird.

I put the below lines in my perl script and ran it from the command prompt 
and from a web browser yet the results are telling me
that "You have started this script from the command prompt"

Why?

Is the HTTP_USER_AGENT check not correct?


>Date: Tue, 11 Jun 2002 18:35:16 +0200 (METDST)
>From: David vd Geer Inhuur tbv IPlib <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED], [EMAIL PROTECTED]
>Subject: Re: Checking environment variables...outputting to file
>
>
>Hi,
>
>There should be many ENV that would only be set if you are using a 
>browser, but
>one of them might be HTTP_USER_AGENT.
>Here is a tested example :
>
>#----
>if($ENV{'HTTP_USER_AGENT'}) {
>   print "Content-type: text/html\n\n";
>   print " You are using a browser";
>}
>else { print "You have started this script from the command prompt \n"; }
>#----
>
>Good luck !!
>
>Regs David
>-----------------
>
> > Hi,
> >
> > I thought of another way possibly...of doing this.
> >
> > Is there a way through environment variables (or someother way) to 
> check to
> > see if the perl script is being run via command prompt or from a browser
> > (web interface)?
> >
> > This way if someone runs the script from a command prompt I output it to
> > the screen using >CON: and if its run from a web browser then I 
> redirect it
> > to a file and then read that file to the browser after completion
> > using >output.txt".
> >
> > Please say yes...and how?
> >
> >
> >
> >
> > 
> 
>+-----------------------------------------------------------------------------------+ 
>
> >
> > Philip Humeniuk
> > [EMAIL PROTECTED]
> > [EMAIL PROTECTED]
> > 
> 
>+------------------------------------------------------------------------------------+
> >
> >
> >
> > --
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> >
> >


+-----------------------------------------------------------------------------------+ 

Philip Humeniuk
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+------------------------------------------------------------------------------------+



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to