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
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
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
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
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
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
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_
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','
> >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
> 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
> 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
> 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
> 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
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
> $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
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
> 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
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
> > 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
> 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
> 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
> 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
> 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);
>
> 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
> > 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
>
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
> 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
> 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
28 matches
Mail list logo