PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
woren
Forum Newbie
Posts: 4 Joined: Wed Jul 21, 2004 5:37 am
Post
by woren » Wed Jul 21, 2004 5:37 am
Hello to all
I'm looking for way to make global array in php+(apache) under windows ,
I need to send data between users (for make counter) on server side for example.
Now I using file or database but it isn't nice or good way.
Hope you have any other way.
And wetting for yours suggestion.
Thanks
Oren wisman
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Jul 21, 2004 5:40 am
If this state need to be saved, you can't really do it other ways.. There's shared memory operations and things, search php.net's documentation for those..
woren
Forum Newbie
Posts: 4 Joined: Wed Jul 21, 2004 5:37 am
Post
by woren » Wed Jul 21, 2004 5:45 am
feyd wrote: If this state need to be saved, you can't really do it other ways.. There's shared memory operations and things, search php.net's documentation for those..
but shared memory is only for linux !!
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Jul 21, 2004 5:45 am
it's actually possible to do it with windows.. although you won't be able to use native php for it..
woren
Forum Newbie
Posts: 4 Joined: Wed Jul 21, 2004 5:37 am
Post
by woren » Wed Jul 21, 2004 5:51 am
feyd wrote: it's actually possible to do it with windows.. although you won't be able to use native php for it..
ok how ??
can you upload an example to the forum ??
thanks
OREN
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Jul 21, 2004 5:56 am
there are 2 ways that I know of, using the w32api, which stinks. Or writing your own extension.
I'd use the database though, which you're against for some reason..
John Cartwright
Site Admin
Posts: 11470 Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:
Post
by John Cartwright » Wed Jul 21, 2004 10:34 am
why not do
Code: Select all
<?
$_SESSION["var"] = array("1","2","3");
?>
then to access the array
Code: Select all
<?
echo $_SESSION["var"][0];
//outputs 1 on any page
?>
evilmonkey
Forum Regular
Posts: 823 Joined: Sun Oct 06, 2002 1:24 pm
Location: Toronto, Canada
Post
by evilmonkey » Wed Jul 21, 2004 10:55 am
How about the array through the adress bar? Append it to your links...not sure if it works for arrays, but I don't see why it shouldn't.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Wed Jul 21, 2004 12:18 pm
sessions and get params doesn't help sending data to other users on the site all that well..
JAM
DevNet Resident
Posts: 2101 Joined: Fri Aug 08, 2003 6:53 pm
Location: Sweden
Contact:
Post
by JAM » Wed Jul 21, 2004 6:12 pm
feyd wrote: I'd use the database though, which you're against for some reason..
I'm also abit startled by this. Database 'seems' to be the way to go and likely abit easier than any alternative approach.
I find the topic overall interesting, so I'd also like to know how come this solution isn't working as wanted.