Getting user's time from web revlet?

Michael Kann mikekann at yahoo.com
Tue Jan 19 09:58:13 EST 2010


Jim,

You've rekindled my interest in using the Revolution engine for cgi on the server. If you keep at it I might even upload a stack or two. 

From your informative post I glommed onto one statement:

"I wonder about the  $_SERVER variables differences."

I have wondered about that also, so I did a little experiment. The summary is that the differences are practically nil.

-----------------
IREV script
goes in public_html folder
-----------------
<HTML>
<?rev

repeat for each key k in $_SERVER
put k & "<br \>" & cr after v
end repeat
sort v
put v

?>
</HTML>

-----------------
Output:

DOCUMENT_ROOT
GATEWAY_INTERFACE
HTTP_ACCEPT
HTTP_ACCEPT_CHARSET
HTTP_ACCEPT_ENCODING
HTTP_ACCEPT_LANGUAGE
HTTP_CACHE_CONTROL  -- only in IREV
HTTP_CONNECTION
HTTP_HOST
HTTP_KEEP_ALIVE
HTTP_USER_AGENT
PATH_INFO          -- called PATH in Rev engine output
PATH_TRANSLATED    -- only in IREV
QUERY_STRING
REMOTE_ADDR
REMOTE_PORT
REQUEST_METHOD
REQUEST_URI
SCRIPT_FILENAME
SCRIPT_NAME
SERVER_ADDR
SERVER_ADMIN
SERVER_NAME
SERVER_PORT
SERVER_PROTOCOL
SERVER_SIGNATURE
SERVER_SOFTWARE

-----------------
REVOLUTION engine
-- script goes in cgi-bin directory
-----------------
#!revolution -ui

on startup

put "Content-Type: text/plain" & cr & cr

put the globals into v
replace comma with return in v
replace "$" with empty in v
sort v
put v

end startup
------------------
OUTPUT:
-- I took off the "$"s 



#                     -- not server variable
0                     -- not server variable
DOCUMENT_ROOT
GATEWAY_INTERFACE
HTTP_ACCEPT
HTTP_ACCEPT_CHARSET
HTTP_ACCEPT_ENCODING
HTTP_ACCEPT_LANGUAGE
HTTP_CONNECTION
HTTP_HOST
HTTP_KEEP_ALIVE
HTTP_USER_AGENT
msg                    -- not server variable
PATH                   -- called PATH_INFO by IREV
QUERY_STRING
REMOTE_ADDR
REMOTE_PORT
REQUEST_METHOD
REQUEST_URI
SCRIPT_FILENAME
SCRIPT_NAME
SERVER_ADDR
SERVER_ADMIN
SERVER_NAME
SERVER_PORT
SERVER_PROTOCOL
SERVER_SIGNATURE
SERVER_SOFTWARE





--- On Tue, 1/19/10, Jim Ault <jimaultwins at yahoo.com> wrote:

> From: Jim Ault <jimaultwins at yahoo.com>
> Subject: Re: Getting user's time from web revlet?
> To: "How to use Revolution" <use-revolution at lists.runrev.com>
> Date: Tuesday, January 19, 2010, 4:48 AM
> Another reason for using Rev CGI for
> the OnRev server.  I am using both.
> The irev scripting is nice, but it is in beta, so changes
> are sure to be made.
> 
> With CGI, you can install an engine (eg. Linux 3.5) and use
> that one forever, thus no shifting conditions.
> Andre's auto-installer works great.
> 
> I also believe that all the  $_SERVER variables are
> available including custom HTTP headers that a web page
> programmer or Rev programmer might want to use for security
> or special conditions.
> 
> Of course, I also like custom properties and arrays, so
> uploading a stack that contains all the parameters in props
> is good for me.  Very fast and reliable.
> 
> Hope this helps this thread.
> I wonder about the  $_SERVER variables differences.
> 
> Jim Ault
> Las Vegas
> 
> 
> On Jan 18, 2010, at 4:07 PM, Andre Garzia wrote:
> 
> > AAAAARRRGGGHHHHH!!!!!
> > 
> > okay, it is down to this... browsers send the date
> header to the server, it
> > is mandatory but the date header is not being passed
> to the $_SERVER
> > variable, which means they are not passing all the
> headers as they should.
> > 
> > they are just passing some of the http headers, they
> should simply loop all
> > sent headers and pass them to the $_SERVER variable.
> > 
> > Damn!!! When I checked, I used firebug to see what my
> browser is sending,
> > and the date header is there as expected, it is just
> not being parsed by the
> > revserver engine.
> > 
> > On Mon, Jan 18, 2010 at 9:59 PM, Sarah Reichelt <sarah.reichelt at gmail.com>wrote:
> > 
> >>> As for getting the clients time using
> RevServer files check out the
> >> variable
> >>> $_SERVER["Date"], it will contain a timestamp
> from the browser
> >> perspective.
> >>> Hope this helps.
> >> 
> >> I can't get $_SERVER["Date"] to return anything,
> although that would
> >> be really useful.
> >> 
> >> I have a test page that lists all the elements of
> the $_SERVER array
> >> that it can find:
> >> <http://www.troz.net/onrev/samples/test.irev>
> >> but it doesn't include a DATE entry.
> >> 
> >> I would imagine that since On-Rev is server-side
> scripting, it would
> >> have no way of getting the time & date from
> the calling browser. I
> >> would expect that this would need to use
> JavaScript (client-side
> >> scripting) which interacts more directly with the
> browser.
> >> 
> >> Cheers,
> >> Sarah
> 
> 
> 
> 
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 


      



More information about the use-livecode mailing list