[PHP] Re: Cache Question

2003-08-17 Thread Josh Whiting
ntil then. its very weird. i am doing this just by using a fread() to a file handle and echoing the result. any explanations, or enlightened thoughts on 1) why this happens, and 2) how it could impact the differece between a direct .mp3 embed and a .php embed? josh whiting Ivo Fokkema wr

[PHP] warning & question about mysql sessions & concurrency

2005-03-05 Thread Josh Whiting
cenario be warned! I'm surprised so much bad code is going around for this task... Many thanks in advance, Josh Whiting -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-06 Thread Josh Whiting
On Sun, Mar 06, 2005 at 02:27:53PM +, Chris Smith wrote: > Josh Whiting wrote: > >I've been trying to switch to MySQL-based session storage instead of the > >native PHP session storage. In doing so, I've run into a lot of code on > >the web that exhibits a se

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-08 Thread Josh Whiting
On Tue, Mar 08, 2005 at 10:38:28AM -0800, Richard Lynch wrote: > Josh Whiting wrote: > > SO, does anyone have some code that uses MySQL to replace PHP's native > > session storage that also correctly handles this concurrency problem? > > Create your MySQL session tabl

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-10 Thread Josh Whiting
On Wed, Mar 09, 2005 at 02:52:52PM -0800, Richard Lynch wrote: > > Agreed, initially I thought of that but I also need to use transactions > > in my business logic and MySQL doesn't support nested transactions, so > > I'd have to open a separate connection to the DB to handle the session > > transa

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-12 Thread Josh Whiting
On Fri, Mar 11, 2005 at 09:57:46AM -0800, Richard Lynch wrote: > > well the trouble is not in the writing at the end of the request, which > > would likely only be a single query and therefore not need a transaction > > in itself. the trouble is the lack of locking out other requests from > > readi

Re: [PHP] warning & question about mysql sessions & concurrency

2005-03-16 Thread Josh Whiting
On Wed, Mar 16, 2005 at 06:59:43PM +0100, Marek Kilimajer wrote: > >SO, does anyone have some code that uses MySQL to replace PHP's native > >session storage that also correctly handles this concurrency problem? > >Ideally I'd like to see just a set of functions that can be used with > >sessions_

Re: [PHP] Different approach?

2005-03-21 Thread Josh Whiting
On Thu, Mar 17, 2005 at 11:01:44AM -0500, John Taylor-Johnston wrote: > Hi, > > I've read: > > > http://dev.mysql.com/doc/mysql/en/create-table.html > > Would anyone code/approach this differently? [...] > $sql = "INSERT INTO $table > (StudentNumber,Exercise1,Exercise2) values > ('$StudentNumber','

Re: [PHP] Passing Arrays between pages

2005-03-22 Thread Josh Whiting
> >Please can someone tell me how you pass arrays between PHP pages. > > $var = serialize($testArray); > echo ""; > > Then unserialize the variable on the receiving page. To this you might also add an MD5 hash to check for authenticity, depending on what you're doing with that incoming data that

Re: [PHP] OR statement

2005-03-24 Thread Josh Whiting
> This work fine, however, I would like to add to the criteria above. I would > like to say: > > if ($audio == "Cool" or "junk" or "funky"){ > > ... > if (in_array($audio,array("Cool","junk","funky"))) { ... } not the most elegant looking but it gets the job done. /josh w -- PHP General Ma

Re: [PHP] Re: Getting the process ID

2005-03-24 Thread Josh Whiting
> The problem I am having is that people are double-submitting certain > transactions. My first attempt to prevent this was to store a flag in the > session record indicating whether or not certain transactions had been > completed, but this turned out to be insufficient at times because users

Re: [PHP] Meta HTTP refresh problem

2005-03-25 Thread Josh Whiting
> Recently, during a rewrite of my login page, the Meta Refresh I am using > suddenly stopped working. I've tried using it by echoing it with php and > by just using it in HTML. I've also tried using a javascript redirect > with no luck either. Any thoughts on how to debug and what might be > h

Re: [PHP] header("Location: page.php target=_parent")?????

2005-03-25 Thread Josh Whiting
> How should I formulate the header function to replace the current frameset > page with a new one? I have tried a combination of header("Location: > page.php target=_parent"); but I get an error message saying the page does > not exist. > > Also, can I save a frameset page with a .php extensio

[PHP] Persistent PHP web application?

2005-01-03 Thread Josh Whiting
Dear list, My web application (an online classifieds server) requires a set of fairly large global arrays which contain vital information that most all the page scripts rely upon for information such as the category list, which fields belong to each category, and so on. Additionally, there are a l

Re: [PHP] Total Server Sessions

2005-01-03 Thread Josh Whiting
> $num_sessions = count(glob(session_save_path() . '/sess_*')); > echo "There are about {$num_sessions} active sessions."; > > It will be fairly active so long as your garbage collection is triggered > fairly often. it is worth noting that this doesn't work if you are using the recursive directo

Re: [PHP] Persistent PHP web application?

2005-01-04 Thread Josh Whiting
Wow thanks for the helpful breakdown. > PHP's model is to be completely sandboxed such that every request is > completely separate from every other. Having a persistent interpreter > as you describe would break that rule and break the infinite horizontal > scalability model of PHP. Understood

Re: [PHP] Re: Persistent PHP web application?

2005-01-04 Thread Josh Whiting
> Why don't you just create a daemon started from the command line > (shell/DOS) and have it accept socket connections from your Web server > PHP scripts and provide a SOA (Services Oriented API) to the code that > accesses your data structures pre-loaded in memory? Setting up a separate persis

Re: [PHP] Persistent PHP web application?

2005-01-04 Thread Josh Whiting
Thanks for taking the time for your comprehensive repsonse! > However, given your programming philosophy so far, and the fact that you > are worried about 7ms and that you specifically requested some kind of > shared memory space in PHP, you should Read This: > http://us4.php.net/manual/en/ref.sem

Re: [PHP] Re: Persistent PHP web application?

2005-01-04 Thread Josh Whiting
> > However, would a single process PHP server daemon be able to > > appropriately handle the incoming load from Apache, which will be > > running multiple processes handling concurrent incoming requests? > > I don't think you've quite got the right picture here... > > When you write your single pr

Re: [PHP] apache 1 vs 2 w/php

2005-01-05 Thread Josh Whiting
> I am undecided whether to upgrade to apache 2 (currently running 1.3.33) > I've heard some bad stuff (some good maybe) about using apache 2 with php.. > does anyone have an opinions? a somewhat interesting discussion on the subject was recently on slashdot, i suggest reading at least the blog en

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Josh Whiting
> Anything you do in the MINIT hook is basically free, so it would be > trivial to load the data for the array from somewhere. Like a database, > an xml file, etc. So you wouldn't need to hardcode a complex array > structure in your MINIT hook, just have this generic little extension > that c

Re: [PHP] Persistent PHP web application?

2005-01-06 Thread Josh Whiting
> I think I understand where you're coming from. I've had a similar > problem and the best solution I've found is eAccelerator (previously > known as Turck MMCache). What EA does is keep the bytecodes PHP compiles > inshared memory so next time you need that script PHP doesn't need to > recompi

Re: [PHP] Re: [suspicious - maybe spam] [PHP] [suspicious - maybe spam] SELECT probrem

2005-01-06 Thread Josh Whiting
> Hello Phpu, > > Thursday, January 6, 2005, 10:42:15 AM, you wrote: > > P> I have an array, for ex: $products=array(1, 2, 5 , 7) > P> I want to select all products from the database that has the ids of > products. > P> I use this but doesn't work: > > $product_ids = implode(',', $products); >

Re: [PHP] On large application organization [long and possibly boring]

2005-01-07 Thread Josh Whiting
> If I have a large app what is the difference, other than having a very > large file, of doing this > > switch($action){ > /* several dozen cases to follow */ > case "foo": > writing out all of the code > break; > } > > and this > > switch($action){ > /* se

Re: [PHP] Persistent PHP web application?

2005-01-07 Thread Josh Whiting
> > Call me crazy or ignorant, i'm both, but would it be possible to build > > an extension that, in its MINIT hook as you suggest, actually runs a > > separate PHP script that contains global definitions, then makes those > > definitions available to later scripts? this is basically my original >

Re: [PHP] Persistent PHP web application?

2005-01-08 Thread Josh Whiting
On Thu, Jan 06, 2005 at 08:41:57PM -0500, Jason Barnett wrote: > >Does "not up to date" mean the code isn't working with current releases > >of php 4 or 5? I'd be interested in giving it a try. > > I believe this is the case. AFAIK the APC library doesn't support PHP5 > or at least it didn't when

Re: [PHP] On large application organization [long and possibly boring]

2005-01-08 Thread Josh Whiting
> Josh, I am interested in what you mean by "but there may be a better > overall approach." (which was in reference to my original question which was: why are you using a big switch?) The reason I say that is because, though I'm no expert on application design, in my own code I've found that whe

Re: [PHP] Preventing execution without inclusion

2005-01-14 Thread Josh Whiting
> as per PHP5 example > > 1 (the preferred way): user accesses > http://www.example.org/index.php?function=Join, this loads the class > NewUser and begins its implementation. Because of the __autoload, it > includes class.join.php, in order to utilize the class. > > 2 (the wrong way): user acc