php-general Digest 22 Oct 2006 14:22:17 -0000 Issue 4415
Topics (messages 243430 through 243433):
IP Address
243430 by: Fred Moses
243431 by: Greg Maruszeczka
Re: Parsing serialized PHP arrays in "C"
243432 by: Rasmus Lerdorf
Screen Shots
243433 by: Mark McWhirter
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
Is there a function which returns the IP address of the requestor of the
current page?
--- End Message ---
--- Begin Message ---
On Sat, 21 Oct 2006 19:55:17 -0400
Fred Moses <[EMAIL PROTECTED]> wrote:
> Is there a function which returns the IP address of the requestor of the
> current page?
>
> --
Don't think so but there is a superglobal that contains it:
$_SERVER['REMOTE_ADDR']
--- End Message ---
--- Begin Message ---
Kevin Wilcox wrote:
I have a feeling this may be the wrong group to ask this question, but
I thought that if it is, someone can point me in the right direction.
I'm working on a application written in "C" that needs to parse and
understand php arrays that have been serialized and stored in a MySQL
table. I started writing the parser and realized its not a trivial
task. I'm wondering if there is any source code in C to do what I'm
looking for? I googled many different combinations of keywords and
nothing useful came up. I even looked at the code in
ext/standard/var_unserializer.c, and I don't think what will port to a
stand alone application without extensive modifications.
Why not? It is a rather simple re2c parser. Don't look at
var_unserializer.c, look at var_unserializer.re and read up on re2c.
http://re2c.org/
You would obviously want to replace the creation of internal PHP data
types with whatever you want to unserialize to in your app, but I don't
see how you would find any code somewhere else where you wouldn't need
to yank out the destination code from since that is going to be the
unique part in each implementation. And if you use the same re2c
grammar that PHP uses, it will be correct. Using any other
implementation likely wouldn't be.
Of course, I also wouldn't suggest using serialized PHP for a target
that wasn't PHP. Why don't you look at json or perhaps wddx instead?
-Rasmus
--- End Message ---
--- Begin Message ---
Is there any way that I can get a script to take a screen shot every minute
of all the users using my php website?
--- End Message ---