Re: [PHP] error message
Let's not open an error report just yet... there are already too many "bugs" in the database! A snippet of the relevant code would be nice though. Perhaps your odbc_errormsg($conn) is being echo'd to stdout? Or you are using those fun Exception beasts? On 4/26/06, chris smith <[EMAIL PROTECTED]> wrote: > > On 4/27/06, cybermalandro cybermalandro <[EMAIL PROTECTED]> wrote: > > I have set in display_errors = off on my php.ini but I can still see > ODBC > > related error messages when I try to duplicate an ODBC error. Am I > missing > > something to turn this off? > > Can you produce a small test case? Maybe post a bug report: > http://bugs.php.net > > -- > Postgresql & php tutorials > http://www.designmagick.com/ > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] trying to figure out the best/efficient way to tell whoisloggedinto a site..
On 9/14/05, bruce <[EMAIL PROTECTED]> wrote: > > ben... > > i understand what you've stated, but i was under the impression that a > number of sites (etrade, etc...) can/do track who is/is not logged into > their sites.. and not just by some crude 'timeout' function... This might be possible to do with some client-side javascript. I think that eTrade and all of those sites are using an AJAX paradigm and so the client is periodically pushing requests onto the server (but just for the information that needs to be updated). Among other things I'm sure that users would be submitting the session ID that they have and eTrade can track if the browser session is still alive by doing this. However, all of this would be something to ask on a JS list instead of here. :-) Also remember that not all users will enable JS so you need to have backup functionality (i.e. rely on the timeout) so you will never have 100% accuracy, but the method described above will improve your accuracy (at the cost of extra HTTP connections) ... by your statements, you're pretty much saying that the only approach one has > to this issue is to utilize some sort of timeout function, and if you > don't > detect user activity after your timeout, then mark the user as no longer > being active, and proceed accordingly. this apporach doesn't allow an app > to > immediately know when a user has killed the browser. > > so, the question might be, how does one detect when a user has killed a > session/left your app? The timeout method is still the main way to do it... but with the addition of the AJAX methods you can have the client machine *push* updates into your user session. Once you've determined that the client is enabling JS then it is pretty safe to assume they will keep JS enabled for the life of the browser session. So when your site stops getting pings from the client you could kill their session. All of this said... unless you're using AJAX throughout the entire sit already I wouldn't mess around with it. IMHO it takes a lot of extra coding and the added benefit for something like improved user count isn't going to offset the costs of coding and extra HTTP connections when it goes live.
Re: [PHP] trying to figure out the best/efficient way to tell who is logged into a site..
Close: You mix both of these ideas. Create a custom session handler. This handler creates user entries in a database. Then when you want to know how many are online you do a count on the number of user entries in the table. Play around with different gc_probability values to tune the efficiency. On 9/13/05, bruce <[EMAIL PROTECTED]> wrote: > > hi... > > anybody have pointers to trying to tell who/how long someone is logged > into > a system/site. i've thought about setting a session var, but i'm not sure > how to read/tabulate this var across the entire group of people who'd be > logged in. i've also thought about keeping track in a db tbl.. however, > i'm > still not sure that i've got a good way of tracking who's logged in, and > still on... > > a possible approach would be to have the app periodically update the > system > whenever a logged in user goes from page to page... > > so, any thoughts/ideas/etc... > > -thanks > > bruce > [EMAIL PROTECTED] > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > >
Re: [PHP] Unique user?
I'm going to agree with Jay... most users are lazy enough that if you just require them to have a user account then that will suffice. Since this is only for a joke site that would be my suggestion as well. However, if you really, really wanted to identify remote *computers* then you can try tracking the clock skew of the client which is making that request. If you're interested then google for "clock skew tracking" and you should get some hits. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Custom session handling - bad or good idea?
This can be a fine way to go, given that you have a specific reason to do so that is not easily handled by using session_set_save_handler. The most common session handler in use (besides the default handler) is a DB session handler. You could write this handler in C and it would possibly be worth the effort. Caching DB connections in a shared module could give you a nice performance boost (although I have no idea how stable a setup like that would be, usual caveats about multi-threaded servers would apply). Hope this helps. On 8/18/05, GamblerZG <[EMAIL PROTECTED]> wrote: > I'm not speaking about "session_set_save_handler", I'm considering > writing session handler from scratch. Is it a bad idea? If so, why? > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: proxy security
The problem here is that you need an anonymous proxy server that you trust. Most of the ones you can trust aren't going to be free. However, once you've identified an anonymous proxy server which you *do* trust then you can just pipe the mails to them like any old email server would. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Register globals and ini_set
Since you mention the PHP version was old (4.1) then I have to ask: were you using the $_SESSION array all along or were you using session_register to register session variables? Although you probably aren't since that would be rather easy to debug. The script in which your global_variable was set makes absolutely no difference. PHP is just looking for the SID someplace anyways (whether that's COOKIE, GET or POST) and then it goes and retrieves that session that matches that SID. OK... when you say that it fails sporadically, what do you mean exactly? Probably, based on what you've just said, you're somehow assigning into your $_SESSION variables through the use of global variables that have the same name as your $_SESSION indexes. http://php.net/manual/en/ref.session.php#ini.session.bug-compat-42 -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Register globals and ini_set
[EMAIL PROTECTED] wrote: Hi, If i use, at the beginning of my scripts, ini_set('register_globals', 0), register globals will be turned off? Thanks ini_set() just doesn't make sense for that directive. register_globals takes the input data from HTTP requests and sets them in the symbol table before any of your PHP code gets parsed. PHP has already done the work. Doesn't seem too terribly efficient to just throw all of that away on every script invocation, now does it? But what you *can* do, is to ini_get('register_globals') and have your script act accordingly. You could for example extract() your $_GET and $_POST variables. http://php.net/manual/en/function.extract.php -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Security, Late Nights and Overall Paranoia
The typical way that forums handle this is to use what is called "BBCode". In short, you have a non-HTML way for users to supply information that will produce markup instead of just plain text. So if you want to allow italics, bolds, URL's, etc. then you have some codes for it like: [i]This text will be in italics.[/i] [b]This text will be in bold.[/b] [url=http://php.net]This will be a URL that points to php.net.[/url] Mailing archives probably have some code that does this... or you could see what the maintainers of phpBB do under the hood. Ah, the beauty of Open Source! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem serializing a mysqli_result object.
But why are you going to all of that trouble? What does the mysqli_result object have that you really need? If you just need the result set then you can fetch it as an assoc array and serialize that. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] reading PDF's
Richard Lynch wrote: On Fri, June 24, 2005 12:10 pm, Jon said: Is it possible to read text from a PDF file with PHP? How? ... There may be a free one, or even an OpenSource one, but I've never heard of it, possibly because they'd have to pay a license to Adobe (Macromedia this week?) to be legal... Free (as in beer): http://sourceforge.net/projects/pdfcreator/ It's built on top of Ghostscript... which AFAIK does most of the heavy lifting. Several licensing options too. ... You don't want to get to launch and find out 90% of the real PDFs simply don't work. :-( I've been using it for about 3 months with very few problems. In fact, I can't think of any problems that I've had with the library (but I don't use it with PHP... I just know that bindings are there for you to go do it yourself). -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Object Oriented PHP (5)
Richard Lynch wrote: ... Ooooh. At the risk of being branded a heretic, try to pick up another language or two. Start with something a whole lot like PHP. Maybe Perl, or even C. You'll have to shove all your PHP knowledge over to one side of your brain, cram all the new stuff into the other half of your brain, and then compare/contrast. Then, for real fun, try to learn something totally whacked-out different like Lisp, Scheme, Forth, Logo, or even (blech) COBOL. This will require even more compartmentalization in your brain-space, and some serious deep thinking on what makes a program tick. Only after you really "get it" in a totally different programming paradigm do you achieve that deep comprehension of Programming with a capital P. Hmmm how does declensional based programming sound? Remember back when our ParrotHeadPoster was alive and squawking and ready to flap his wings right out into the news server? Well doing some searching for text classifiers led me to this really funky, weird, unusual... twisted... programming tool. The program is called crm114. "It's not ugly like Perl; it's a whole different *kind* of ugly." I still am not an expert with this program (hell, the development is finally getting to where it can use autoconf), but it fits in really well as a new / active tool that does everything different. And I mean almost everything. Everything is a regex. The default regex engine is called TRE (which supports approximate matches). The language is declensional instead of parameterized. For the most part the order that you use for your arguments just don't matter. Variables look like :*:yourvariable: Releases don't follow the typical naming convention; instead, people get blamed for releases. crm114-20050628.BlameCochrane is the new release that just came out and it is the "CRM114 Galactica Buzzphrase Compliant Version". It makes use of the new hyperspatial classification... just read the manual on it, ok?!?! At least one similarity to PHP though: it makes use of a JIT compiler. In short, it's a useful and interesting utility. Not just because it can sort your spam / nonspam email with greater than 99% accuracy... but because you can adapt it to other tasks by writing your own crm filters. This is no simple task (I'm still learning how to use it!), but this is mostly because the way of doing things is just different. The whole thing is like a computer science project gone mad, but at the same time it's actually very useful for something. For those that are interested, grab the new version released today: http://crm114.sourceforge.net/ H. That came out kinda stronger than I meant it... I mean, sure, the guy who learns C, and knows only C, and codes C all day is a Programmer, and I'm not knocking that. But there's this sort of "hole" in a guy like that, and while it doesn't "hurt" them or make them less a Programmer, it's there, and it's just not the same as a guy who actually groks something as bass-ackwards (that's a compliment) as Lisp as well as they do C. Well, that got long and philosophical, didn't it? Indeed. But those are some of my favorite posts to read. :) -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: __PHP_Incomplete_Class
Jay Wright wrote: ... My page uses a header.php5 include file to call session_start(). Next a require_once("classloader.php5") performs the autoload. Here is the problem... you need to switch the order. Load the classes / autoloader first, then session_start(). PHP was able to serialize the object because it was properly saved in the session store, but it didn't have the class definition. I'm using php5 on windows xp (also linux). The error is here: [client 127.0.0.1] PHP Fatal error: main() [function.main]: The script tried to execute a method or access a property of an Read the next part carefully. incomplete object. Please ensure that the class definition "Gallery" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide a __autoload() function to load the class definition in C:\\code\\jaysphotos\\local-apache-webapp\\web\\thumbnails.php5 on line 127, referer: http://localhost/jaysphotos/thumbnails.php5?page=p2 -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] constant() - php5
Richard Davey wrote: ... Isn't the warning coming from the fact that $cnst isn't defined, rather than coming from the constant() function itself? Best regards, Richard Davey Nope... tested with PHP 5.0.5-dev -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: constant() - php5
Marek Kilimajer wrote: Jason Barnett wrote: ... The above is wrong, use: echo constant('UNDEFINED_CONSTANT'); OK, that's a good catch. But this still causes an E_WARNING. -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: constant() - php5
Actually, thanks for pointing out this function to me because I never even knew that it existed. You learn something new every day. I have to admit that a warning seems a little unusual given that an undefined variable would result in only an E_NOTICE. Especially since the default behavior for an undefined constant (anywhere except for this function) is an E_NOTICE. Seems like you may have found a bug to report. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] looking for a pure startup opportunity..OT
Jay Blanchard wrote: [snip] the fact is, you misread, misinterpreted what we stated... [/snip] The fact is... there are at least 4 people that regularly post on this list that "misinterpreted" what you stated. Then we would be even... [snip] I was just pointing out that the style in which the original message was delivered had a little smell to it, IYKWIM. [/snip] Agreed. Not only that, but some of us have actually given you some constructive criticism to which you have responded quite negatively. I guess you just can't help some people. [shrug] OK list, I apologize for keeping this off-topic thread alive... we now resume our regularly scheduled programming. -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Breaking up data efficiently
Kevin L'Huillier wrote: ... Create the function split_location to return the associative array or, if it is invalid, throws an exception. If PHP4, replace the exception with similar error handling. If efficiency is really the goal, then the OP probably shouldn't go the route of Exceptions. Just use a simple trigger_error() and your php.ini to direct where the error messages go. Especially in this case... because errors here are likely just because someone added / removed an extra "|" where it didn't belong. In my opinion you should save exceptions for, well, EXCEPTIONal problems. Either that or you use exceptions for a large system that discriminates against specific types of errors and handles each error type in a totally different way. Can we say bloat? -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: DOM XML issue
Andrew Kachalo wrote: Hi! ... Fatal error: Call to undefined function domxml_open_file() in /Users/Andrew/Sites/portfolio/index.php on line 61 This is because PHP5 now has an object-oriented approach. You use DOMDocument's and/or SimpleXML to read your XML files. Also in the newest versions of PHP there is a new extension called XMLWriter that might better suit your needs. How can I fix this problem? In short, you can't do anything except modify code to the new way of doing things. XML support is the lesser-known-yet-dramatic change in the migration from PHP 4 to PHP 5. http://php.net/manual/en/ref.dom.php Thank you! == Best Regards Andrew Kachalo http://www.geocities.com/andrew_kachalo/ -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] looking for a pure startup opportunity..
OK, let me put this another way... while trying to remain polite. Let's suppose that I am an unknown (to you) member of this list and I have this great idea that I want to develop. My idea is a great one and it's going to make millions. Now since I'm the one that had the idea I think it's pretty easy for me to go find 3 friends of mine (people that I know/trust/live close to me) that have the requisite skills. After all, it's not like most programmers go hanging out with Hollywood celebrities. ;) If I really believed that my idea was so hot then I probably wouldn't be waiting around for someone on this mailing list, I'd just get started doing it. Back about two years ago I was subscribed to this newsgroup with my email address from college. Back then I was just doing what I do now... answering PHP questions while I work. Except that I answered a lot more questions then because, well, I was in school still. :) I don't remember exactly how many I answered, but you can check out the marcives if you really want. Anyhow, after doing this for about a year I apparently caught someone's attention. I received an email from telling me that he had capital to give me if I had an idea that I wanted to develop. I politely declined, but I told him I would get back to him if a superb idea came my way... I have always felt that getting the financing is the easy part. Besides, if your goal is to get $millions in funding then you're looking at it all wrong. The goal is to make profit... and loads of it. If it just so happens that you need a lot of funding to make that happen, then you can go get it. If you have killer idea(s), then you are better off mocking up a prototype and networking with some people that can get you financing. You always have to make a profit. You always have to make a profit. At least, if you plan on doing anything that's going to catch the attention of some VC's. ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: the EXEC command
mikael wrote: I wanted to use the exec function but when i did a simple test script i got no result. This is the testscript: exec('whoami', $stdout, $stderr); print "Standard Out:\n"; print_r($stdout); print "Standard Error:\n"; print_r($stderr); -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP search
Bruce Gilbert wrote: Hello, I am fairly new to PHP, and I am looking to create a search functionality on a website using php. Can anyone point me to a good tutorial that can walk me through this? Between Google / Codewalkers / PHPFreaks you should be able to find something. -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Strange notation to create object
Robert Cummings wrote: ... This is intentional behaviour, there are times when you want a copy of a reference and there are times when you want a reference to a reference. For instance consider the following: $foo1 = $foo2 = $foo3 = new a(); $foo2 = new b(); If these were references to references instead of copies of references then $foo1, $foo2, and $foo3 would all now refer to the newly created b object. Cheers, Rob. OK I'm pretty clear on it, but now I wonder: is variable assignment (=) the only place where the Zend Engine will copy a reference instead of reference the reference? -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Strange notation to create object
Robert Cummings wrote: ... Yeah, *grin*. And on that note, there are times when you will actually want $foo = &new SomeClass(); versus $foo = new SomeClass(); since assigning by reference will break any previous references -- something I forgot to mention to Matthew Weier when he challenged the relevance of the snippet I sent. Cheers, Rob. Indeed... Matt, hope you see this one. I was quite surprised by the results as well! Rob, since you're explaining this to us now then I assume that the dev team is well aware of this issue and this is intended behavior... or is this something that will be fixed/changed so that we don't have copies of references floating around? Because that seems very unintuitive to me... references to references seems like a better "default" behavior unless there's a good reason why we shouldn't change. #!/usr/local/bin/php changes++; } } class b { } $aObj = new a(); $aRef = &new a(); $bObj = new b(); $foo1 = $aObj; $foo2 = $aObj; $foo3 = $foo1; $foo4 = &$foo2; $foo5 = $aRef; $foo6 = &$aRef; $foo1->changes = 'I changed!'; echo "--\n"; print_r( $foo1 ); print_r( $foo2 ); print_r( $foo3 ); print_r( $foo4 ); print_r( $foo5 ); print_r( $foo6 ); $foo1 = $bObj; $foo2 = $bObj; $foo5 = $bObj; echo "--\n"; print_r( $foo1 ); print_r( $foo2 ); print_r( $foo3 ); print_r( $foo4 ); print_r( $foo5 ); print_r( $foo6 ); $foo1 = &$aObj; ?> -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Strange notation to create object
Robert Cummings wrote: ... There's a difference between a reference to a reference and a copy of a reference *hehehe*. Cheers, Rob. Dear diary: jackpot! Now that makes sense. And am I correctly filling in the blanks when I guess that $foo3 = $aObj is merely copying the reference instead of referencing the reference? I probably could have written that more clearly, but I think you get what I'm saying. -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Strange notation to create object
Matthew Weier O'Phinney wrote: ... This doesn't demonstrate what the OP was talking about, which is initial assignment of an object using a reference operator. The results of this make perfect sense to me -- the references are passed exactly as I would expect. But not exactly as I would expect! I thought that all objects were created as references, but apparently this is not the case. Is there some kind of dereferencing going on when you're using an object on the right side of the assignment (=) operator? In any case, assignment without & is a tricky thing to look out for and certainly can produce some really hard to detect bugs. If the people that have been using PHP for years don't fully understand this... *whistling and walking away* Let me rephrase my question to you: is there a reason to do the initial object assignment using a reference operator using PHP5? I.e., is there a good reason to do this: $foo =& new Foo(); instead of: $foo = new Foo(); I haven't seen any reason to do the former case using PHP5. Neither have I... Slightly on-topic: I was browsing through PECL today and found an interesting looking extension called "parsekit". It will take your PHP code and show what the underlying opcodes are. If I find some time tonight I'm going to play around with this extension and see if I can figure out how references are being handled by the engine. P.S. Windows users: save your sanity and just get the .dll version instead of trying to build from source. :) http://snaps.php.net/win32/PECL_5_0/ -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] text areas and line brakes
http://php.net/manual/en/function.nl2br.php -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: security question...??
This was an interesting topic when it started, but this is getting way out of the realm of PHP and you are in danger of your messages going my /dev/null. I understand your concerns about application security being all-encompassing, but there have been a lot of good suggestions on how to overcome some of these problems already. If you are hell bent on checking browser integrity then this is what you do: 1. Download every version of IE, Fire(fox|bird|???), Opera, Konqueror, Safari, Links, Lynx, Mosaic, Netscape Navigator, mobile phone browsers, PDA browsers, etc. that has ever existed. These have to be the "trusted" binary versions of those applications for every platform on which they have been built. 2. Run a checksum program on each of the binaries and store the checksums in a database. This checksum algorithm needs to be one that you trust. 3. Require each user to create a secure connection with your server (however you want to do that). 4. After the connection is created, get the user to upload the executable they are using to access your server. 5. Checksum the upload and look for the matching hash. The steps outlined above do very little if anything to enhance security, but it is a way to check for integrity of a plain vanilla installation. Then again if you really, really wanted to be accurate you would also need to download and hash all possible combinations of 3rd party add-ons with each browser, for each operating system, and... Do you see what a difficult task this is? And do you think the average user is actually going to do anything like what I've described above? It's tough enough to just get visitors to accept cookies. The benefits of going through the exercise you're describing are nowhere even close to the costs involved (costs meaning the time involved for the server, the client, the web developers, and the end users as well as bandwidth usage). There are other ways to increase security that are more cost effective than what you're suggesting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: security question...??
I haven't tried it yet, but clock skew looks interesting: http://www.aunty-spam.com/track-any-computer-on-the-internet-using-its-clock-skew-fingerprint/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] phpInfo() executed on Yahoo!
Rats, I guess Andrei is watching this list because it's already down :P I knew they used PHP... but it would have been cool to see what things they've done to handle the number of page requests they have. Oh well. :-/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: So many returned mail notices!
Chris W. Parker wrote: Hey, I know this kind of post can be annoying to some people but I must ask anyway. Is everyone else getting a bunch of returned mail from [EMAIL PROTECTED] It looks like it has something to do with (possibly) an email address that is subscribed through Road Runner? Yes, I see lots of them coming through to the newsgroup. Upon inspection of the message it appears to have come from 65.32.5.135 (nslookup shows this is ms-smtp-05-smtplb.tampabay.rr.com). This message looks ok to me, however, the thread that it replied to certainly has some suspicious looking messages. It sucks when we see several messages coming "from" [EMAIL PROTECTED], [EMAIL PROTECTED], [EMAIL PROTECTED] and so on. Rasmus, can you do something about these? Or are these actually legit messages? Anyway this kind of thing always makes me a bit nervous because I start to think something is wrong with my end. Chris. -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: security question...??
Please do not CC me; I will check the newsgroups and usually respond to all messages there. Onward! bruce wrote: jason... it's the 2nd point... the hacked app that i'm concerned/thinking about... as i stated, a secure app/system incorporates not just the system, and the wire, it also deals with the client app that's being used. Very true. and in fact, i'm of the belief that the manufacturers/developers of a given app could in fact provide some function on their servers that you could check against to verify that the browser/app in question is indeed legitimate... OK, but if someone is truly skilled enough to rip apart an IE binary, don't you think it would be trivial for them to override / alter this checkIntegrity() function? Or whatever the heck you would call it. as to the details, i'm not exactly sure how it could be accomplished, but i'm pretty sure it could be done... As to the details, the current way of checking app integrity usually involves checking the MD5 hash of a program against a published / known good MD5 hash. Although as was discussed in a recent thread it may be feasible for hackers to create new binaries that have the same MD5 checksum as a legit / non-hacked binary. i'm not trying to stop someone from copying an app... i just want to know that the version of IE that i'm talking to is indeed a good/not hacked copy... -bruce I don't see how this is feasible for reasons mentioned above. Even if it was feasible can you also guarantee that there aren't other mailicous processes running in the background (e.g. keystroke loggers)? Since MS has a web-based auto-update program then there is likely some way to find all of this critical information over an HTTP connection... but I just don't know how they do it. Also when MS checks your system it is really slow so it would be a huge performance impact on your site. But all of this is dark voodoo magic that doesn't really belong on this list. :) -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Predictable-random array
Dotan Cohen wrote: I've got an array $items which has about 200 entires. I want to print them out in random order, but as usual, I have a catch! I need to add a 'key' so that if need be, I can always return to the same 'random' order, like so: $items=predicatable_random($items, "qwerty"); Try using multi-dimensional arrays, something like: echo "There are a total of " . count($random) . " randomly sorted arrays. Here are the randomly shuffled numbers for array number $selected.\n"; /* Now you can access each random array */ print_r($random[$selected]); ?> -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: security question...??
bruce wrote: hi... a number of you write apache/web/server apps that deal with secure information.. in doing some research it occured to me that a potential weak link is on the client side, regarding the browser? how many of you actually attempt to verify that the browser being used by the client is indeed a legitimate (non-hacked) browser?? or is there even a way to do this? or should i just go back to sleep..?? thanks -bruce [EMAIL PROTECTED] Quite frankly I don't see how you are going to do this. The only thing I know of that might indicate the version / type of browser that is being used is the User Agent string, but it's not hard for this to be forged. So you could very well be dealing with an IE user that has a Mozilla Fire(fox|bird|) User Agent string. More to the point: are you concerned that someone is using an unpatched browser that has holes, or are you concerned that someone is using a binary that has been hacked to pieces and rebuilt to look just like a normal browser? Because I really, REALLY don't think there would be a way to test for the second problem. What do you look for? How in the world do you find it? -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] asterix for arrray_search?
Richard Lynch wrote: On Sat, June 18, 2005 10:11 am, Merlin said: ... I believe that in recent versions of PHP, the preg_* functions will accept an array as an argument... Or maybe I dreamed that. FYI I thought this also... but it appears that you can only do one match at a time with preg_match(). The only one I found that allows the array syntax that you're referring to above is preg_replace(). All the same you can still set up an array full of regex patterns, loop through each of these, and do whatever you want with those matches. $text = "Why don't you run this code and see if you can match this example?"; $matches = array(); foreach($regs as $regex) { preg_match($regex, $text, $matches[]); } print_r($matches); ?> -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Extensions: parameters as references
Yasir Malik wrote: Is there any list (or forum) that can help me with this? Thanks, Yasir You probably will have more luck trying out the PECL group. These authors write PHP extensions and have the knowledge / desire to work on extensions. Not too many of us "regular" developers have actually had the need to write our own extensions, you know what I mean? Jason -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using Exec Function
Davide Pasqualini wrote: I did as You suggested: but Hello.Exe, a very simple program, doesn't run and my browser seems waiting something from the server. Can I run a program (exe file) in another way ? Thank in advance for your help. Davide PHP will just sit there waiting for Hello.exe to finish with output / error status. What is the command line output when you execute this program? Are you sure that Hello.exe isn't running, or is it possible that PHP is just not responding (which makes you think that it didn't execute Hello.exe)? Because if Hello.exe starts up and doesn't exit then PHP is going to sit there forever waiting on Hello.exe to finish. -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] passthru() passing variables
What is a reliable cross-platform way of showing which user PHP is running as? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question to example from manual
janbro wrote: Hi, I've been working on this example and copied it in my webroot, it doesn't give me an output. Does anybody know why? "System" WinXP Apache 2.0.50 php 5.0.3 Because you've defined the function, but you've never called it. thx janbro Example 7-6. Static variables with recursive functions Test(); ?> -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: If I have 2 arrays...
Jay Blanchard wrote: [snip] Close... I think array keys are preserved from the (original) first array, but other than that those appear to be the values that should intersect. [/snip] After a var_dump I am seeing that there is an extra space in each element of one array, so no intersection occurs. Well then there you have it... having an extra space means that the strings in the first array won't match the strings in the second array. Perhaps you can array_intersect(array_walk($array1, 'trim'), $array2) -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: If I have 2 arrays...
Close... I think array keys are preserved from the (original) first array, but other than that those appear to be the values that should intersect. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Include and extending classes
Mike Smith wrote: I'm trying to consolidate code in a new project. My dirs are: / /inc core.class.php /mods /mods/system system.class.php //extends core.class.php user.class.php //extends system.class.php In core.class.php I have my generic special html methods and my db connection. I'm having trouble accessing $this->db (initialized in core.class.php) from user.class.php. Am I wrong in thinking user.class.php should be able to access methods/attributes of core.class.php? http://php.net/manual/en/function.include.php So if user.class.php include()'s core.class.php then you should have the class definition (for methods) as well as any objects that were created. in core.class.php. In other words all variables get imported into the current scope in the calling file. I'm running PHP 5.0.4 on Windows //core.class.php class core { var $db; Is this actually var? Did you possibly call this private / protected? Var == Public, so the db property of any "core" class should be available. function core(){ //initialize db connection (works from here) } //Other methods } //system.class.php include "../../inc/core.class.php"; Note that relative paths can cause problems when you switch the current working directory. This likely isn't a problem for this particular issue you're having, but it's a gotcha for future work. What I do for relative includes is something like: include dirname(__FILE__) . "../../inc/core.class.php"; class system extends core { function system(){ /** See note below */ $this->core(); } } //user.class.php include "system.class.php"; class user extends system{ function user(){ //$this->db cannot be used here What exactly do you mean by cannot be used... do you mean that you don't have access to db? Or perhaps you expect cascading __constructor calls which PHP does not do by default. Instead you need to call the parent constructor *explicitly*. $this->system(); } } TIA, Mike "There are no stupid questions." --my professors until I came into class. -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: [RE-PHRASE] PHP ZIP Class
I have no clue why your PDF's are reading one byte short. However, I did find a class over at SourceForge which claims to do exactly what you want: http://sourceforge.net/projects/few/ I have never used this package and have no idea if it's going to explode when you use it. -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using Exec Function
Exec is the way to go... it gives you output as well as any error status. Here's an example script that works for a Win32 program I have and you should be able to adapt to your own usage: /** Notice that the command has extra quotes around it for the Windows command line as well as double-backslashes for each directory in the path */ $win_cmd = "\"C:\\Program Files\\The Regex Coach\\The Regex Coach.exe\""; exec($win_cmd, $stdout, $stderr); print "Standard output:\n"; print_r($stdout); print "Standard error:\n"; print_r($stderr); ?> -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: OT Major Release Versions
Richard Lynch wrote: This is Computer Software philosophical musing, not specifically related to just PHP, but applicable to PHP and, well, all other OpenSource software... As I sit here surrounded by machines (physically and virtually) and realizing that while I've got most of them on "auto-update" as much as I can, or I've foisted off the updating on somebody else (for $$$) because I just don't *WANT* to be a SysAdmin... I'm still left with a lot of hours I'd have to invest to really be as "current" as I'd like to be. Let's take RedHat and other OSes, for example, only because I don't want this to devolve into the "what version of PHP should I use" thread that would be a hot button here. [Not that RedHat and or its versions aren't almost as hot, but...] No kidding! The way that they switched their codebase was, erm, interesting to say the least? I looked at Red Hat about 1.5 years ago and it took me a while to realize that Fedora Core was the free / development branch of their OS. And the prospect of using a box that never makes it out of "development" is, um, a reason to invest in Rolaids :) I've got RedHat 8, RedHat 9, FC2, and FC3 on different machines here and at client's sites. Oh, and Win XP Home, just for fun, for testing stupid IE bugs. I'd love to just move them all to FC3 (4 now?) but it would really be painful, and a lot more hours than I have available. Now, the thing is, it's finally gotten to the point where I'm willing to let the OS authors/maintainers (RedHat) update my box for me, because, with the current arms race in viruses and whatnot, that's got to be better than my inability to stay on top of things, even if occasionally it breaks something that actually worked before. Yes it's an unfortunate trade off, but not so bad if you Keep It Simple Stupid (tm). Most of the patches that get released to the wild (i.e. the stuff that you get if you don't closely watch any internals@ lists) have been tested for the OBVIOUS problems. It's the edge cases that cause the most bugs... My philosophical question is: Why can't the damn things just have an easy one-click button to go from major version to major version, or if I'm willing to turn over control of the OS versioning to RedHat (or whomever) just do it automatically? Okay, I can accept that for Microsoft and other proprietary software, that's a non-option, because they WANT to force you to BUY the new version, though with their new subscription model... Well, let's not get into THAT argument either. Forget the Windows box. But that's hard to do with my W2K workstation... with that pompous sound that blares out of the speakers every time I reboot! ;) In the past, I've been told that the various pieces of software version control and tracking means that you need the "clean break" of a major release to keep sanity in versions. I think that was true then, but is it really true now? I would tend to say: yes. Take PHP for example. There are a lot of Extensions floating out there (mostly in PECL) which rely heavily on internal function calls / behaviors. So if the maintainers of the PHP project decide to do something so fundamentally different that it's likely to break, like, everything... well then every extension out there needs to be recoded (and tested) or else it's going to break. There are currently two issues on the PHP internal list that directly affect this question of yours: Unicode and Module Dependencies. As we all know (or should know) PHP lacks proper Unicode support. Perl, Java, and a whole slew of others already have this support, but PHP ("the language of the web?") doesn't. So there is work underway to fix this in the default distribution (I've heard maybe around PHP 5.5), but let's face it: this is going to break almost everything. Strings are the lifeblood of web applications and the addition of Unicode strings is going to require a lot of extensions to be upgraded. An excellent summary of this situation can be found here: http://www.gravitonic.com/downloads/talks/intlphpcon2005/php_unicode.pdf So clearly our extension authors need to get the word and upgrade their packages. A lot of them probably will make the changes for PHP 5.5 (or whatever version Unicode comes out in), but some might not. So if Redhat comes in and upgrades your version of PHP (even if they're good enough that they upgrade all of the extensions too!) then you're going to have an application that doesn't work because your extensions don't support Unicode. Now we move on to another discussion on the internals@ list. Someone (Jani?) mentioned they had started work on a patch for module dependencies. The proposal is still being worked on, e.g. where do we do the checking so that PHP startup doesn't slow down too dramatically? However, if the module lists dependencies properly... and the parent modules (e.g. PHP core) correctly indicate BC breaks... then we might have s
[PHP] Re: retreiving postal/zip codes with PHP
Talk with Richard Lynch. He had talked about doing something like this several months ago and he might have worked on it since then... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] What Works Works Validator
Although this isn't a validator, I recently found this site which seems to hold a lot of good information for supporting a wide range of browsers (especially some of the dinosaurs). http://www.quirksmode.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: reverse MD5 ???
Richard Lynch wrote: On Fri, June 10, 2005 3:01 pm, Jason Barnett said: That is incredibly interesting stuff, many thanks for that link! So the position seems to be that it may not be feasible to reverse MD5, but it is now feasible to create forged documents / binaries / whatever that result in exactly the same MD5 hash as the original. No. Richard, did you actually go to the site that Greg showed and look at the example? Two very different (as in content) postscript documents... same MD5 hash. I actually tried it out for myself... and indeed the two different documents produced the exact same MD5 sum. That's a one in a billion chance... So, if your binary file HAPPENS to match that meaningless string, you could use that OTHER meaningless string instead... Again I say... did you look at the other "meaningless" string in the example? I don't pretend to understand how the authors made it work, but it wasn't just some "meaningless" string that they got to match. I'll bet neither of the two strings has any real-world "meaning" They just happen to be the two strings that are "easy" to find that have the same MD5. This has absolutely NO meaning in real-world uses of MD5. You'd have heard a LOT more screaming and wailing and gnashing of teeth if this mattered. :-) Unless of course most people dismiss it the same way that you seem to be dismissing it. ;) -- NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: reverse MD5 ???
That is incredibly interesting stuff, many thanks for that link! So the position seems to be that it may not be feasible to reverse MD5, but it is now feasible to create forged documents / binaries / whatever that result in exactly the same MD5 hash as the original. I actually tried it out for myself... and indeed the two different documents produced the exact same MD5 sum. Now I'm wondering... does this mean that I now need to download PHP binaries from multiple "trusted" sources, do the checksums on each separate download, *and* do a diff for each binary? That way a cracker has to infiltrate multiple servers in order for me to be affected by a cracked PHP binary? Very interesting indeed... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!
@media print { /* style sheet for print goes here */ } http://www.w3.org/TR/REC-CSS2/media.html ^^^ This is a good suggestion. But if you only need to print just this one invoice then you can also take a full screen shot, paste that into your favorite image program and then print from there. (Usually this is Print Screen on your keyboard). And if it does not fit on one screen, take more screenshots and glue them together in the favorite image program :) The OP's problem is that images are printed, so this crazy solution would not work Maybe that's the way you read it, but to me it looks like he's complaining that what he sees in his browser is what he wants to print, but this is not what is being printed (I assume because of alpha images). My point was that if the OP only needs to print one or two invoices then it's a bit overkill to create a CSS for print media when he can just print out a screenshot. Yeah it's out of the box / not the purist answer. Sue me. :P -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Beautiful HTML Invoice -> Prints like crap! I need somesuggestions!
Marek Kilimajer wrote: Matt Babineau wrote: Hi all - I've got a great html invoice that prints like crap because of my user of background images and foreground images. Does anyone have any good suggestions other than turn on images in IE to get this thing to print the graphics? Is there a good way I could convert the HTML view to a JPG? I'm on a linux box and have php 4.3.10. make css for print media: @media print { /* style sheet for print goes here */ } http://www.w3.org/TR/REC-CSS2/media.html ^^^ This is a good suggestion. But if you only need to print just this one invoice then you can also take a full screen shot, paste that into your favorite image program and then print from there. (Usually this is Print Screen on your keyboard). -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] The "goto" discussion on the Internals List
I agree 100% with Greg's comments for the goto() / ifsetor() discussion on the internals list. As far as speed goes if the dev team knew of ways to improve specific parts of the codebase (while maintaining the rest of the features available in PHP) then I'm confident they would make that change. There was one comment on the internals list that perhaps the documentation should have a big fat red warning label that says "DO NOT USE THIS UNLESS YOU REALLY KNOW WHAT YOU'RE DOING". I guess the developers assume users actually read the manual, but I think this list has proved time and again that end users don't do this. ;) This is especially true for newbies (i.e. the ones most likely to get burned by using goto() all over their code). PHP-dev team: at the moment you are supplying me with 95% of the features that I need with a base installation. Just focus on getting Unicode support, make it stable, and make it fast. -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] about the absolutely path
http://marc.theaimsgroup.com/?l=php-general&m=111008638014141&w=2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Exporting to MS Word or Excel
Miguel Guirao wrote: Hi!!! Are there any chances that I could export a dynamic created web page into MS Word or Excel? I know this can be done with PDF!! I'm using LAMP!! If you're using LAMP then you're probably out of luck. The only possibility I can think of would be to check out the MONO or WINE projects and see if you can access the COM interfaces for MS Office through one of those. I've never actually done this, but it's worth a look. -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Best way to use other objects within classes?
Then you're a better coder than me, but then again who isn't. :) It's just that in general I try to make things as strict / difficult as possible to code during development so that I will catch as many errors as possible before hand. But then again I use error_reporting(E_ALL). -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie - Request interface for PHP 5 website
Greg Donald wrote: On 6/2/05, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: For PHP 4.x sites I used my index page to capture the HTTP request and use a switch statement to call the content or task based on the $_GET and $_POST arrays. That was very inefficient and the Switch case became totally unmanageable along with the rest of the site. I am re-designing the site using PHP5 and OO design patterns like Composite and Builder as an example. I know these are basic patterns but its a start. Anyway I am not sure how to capture the HTTP request and pass it to the relevant objects. Is there a generic Œway¹ developers process the request to call the classes and generate the needed objects in PHP5? I'd use $_REQUEST if I were expecting to access both $_GET and $_POST arrays frequently/equally. __autoload() is pretty handy, keeps you from writing tons of include statements. I agree with Greg. Although I would add that if you are using GET / POST arguments to determine which pages to include then you minimally want to filter to be sure they don't try to read sensitive files (/etc/passwd, "My Documents", and the like). And since I'm paranoid I might also want to escapeshellarg() the $_REQUEST variable you're using. -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Best way to use other objects within classes?
Matthew Weier O'Phinney wrote: * "Murray @ PlanetThoughtful" <[EMAIL PROTECTED]>: (Note: my development environment is PHP 5.0.3, but the production environment is 4.3.10. This is my first project built with 5.x local and 4.1.x remote, so if anyone with more experience spots any fatal flaws where I'm using 5.x specific methods etc, I'd appreciate knowing about them) If you're developing with PHP5, but the production environment is PHP4 then at the top of each script you probably want to add: This way you will have objects default to pass by value instead of by reference and you don't end up deploying to production server with some really hard-to-find dereferencing problems. -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5 Question about OO
Jochem Maas wrote: Richard Lynch wrote: On Wed, June 1, 2005 3:53 am, Marcus Bointon said: On 1 Jun 2005, at 11:38, Jochem Maas wrote: all true, now imagine that you install a couple of 3rdparty php5 'packages' and they all define __autoload() - ain't gonna work! which is why there has been discussion on internals regarding the possibility of use a handler- function stack for autoloading (in the same way that you can register a stack of input/output filter-function)... something to keep an eye on in case things change :-) I've run into this one. One way that would work for me (and initially it's how I assumed it worked) is for __autoload to be a standard class method like __construct, so that a class would attempt to run its own autoloader before breaking out to the global function namespace. Maybe I'm being dumb, but how can an object's __autoload function get called when the object class definition hasn't been loaded, and that's why you're calling __autoload in the first place... That seems like classic chicken/egg situation to me... that was my first reaction, but then I thought what if the __autoload() function was called when 'any' class needed to be included while running code inside said class... that _might_ actually be useful at any rate the __autoload() issue is still very much undecided :-) I opened up a feature request for this very topic a while back. The __autoload function should just register user-defined functions and store those func names in a stack so that (in turn) each function can require the appropriate file. If the first registered function fails to load the class then __autoload tries the next registered fucntion and so on until all of the registered functions have been tried. At this point if __autoload fails then we E_ERROR out explaining that __autoload could not load the class definition. As far as I can tell this is the cleanest solution that has been provided, but there is some disagreement over some of the details on this approach. Life would be so much easier if everyone just did things like the PEAR coders do -- Teach a man to fish... NEW? | http://www.catb.org/~esr/faqs/smart-questions.html STFA | http://marc.theaimsgroup.com/?l=php-general&w=2 STFM | http://php.net/manual/en/index.php STFW | http://www.google.com/search?q=php LAZY | http://mycroft.mozdev.org/download.html?name=PHP&submitform=Find+search+plugins -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP and USB Devices
Joe Harman wrote: Has anyone out there found a way to get information from a USB device running on their computer... what i am trying to do is retrive the fingerprint ID that the Microsoft USB fingerprint reader returns for a finger print and put it in a webpage form??? There has to be a way to do it... I haven't ever done anything with that new-fangled fingerprint reader stuff. But if there is some digital form of the person's fingerprint coming from that machine then there is some way to capture that ID and send it to a webserver. So just find out how a user can obtain this digital fingerprint in file / text format and then send the file / text to the server via a form. But as the other poster has already suggested this is a client side issue and about the only thing that you can do is find some way for the person to send the fingerprint to you. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: .INC files
Martin Zvarik wrote: Hi, I saw files like "file.inc.php" and "file.inc" What is the *.inc suffix good for ? Thank you for replies. Martin STOP SPAMMING THE LIST! .inc is just a shorthand for include files and it's just a different way of organizing code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Moving PEAR installation (for self-contained class library)
Andrei Verovski (aka MacGuru) wrote: Hi, I have a PEAR-related question. My class library using some PEAR packages, and I would like to make it self-contained, i.e. to be able to move it to a server (for example MacOS X) which do not have (and will not require) installation of any PEAR package(s). What I would like to do is just to copy whole PEAR directory from the /usr/share/php5 in the corresponding subdir of my class library. The question is - how to make this work transparently. What global php_ini variables need to be changed? Just ¨include_path¨ or anything else? Thanks in advance for any suggestion(s). *** with best regards *** Andrei Verovski (aka MacGuru) *** Mac, Linux, DTP, Programming Web Site *** *** http://snow.prohosting.com/guru4mac/ include_path is the only php.ini setting that might need to be changed. But why exactly are you planning on bundling the PEAR classes? There are several reasons why this isn't a great idea: - New versions of the scripts you need are released, but users downloading your package will have outdated (and probably buggy) versions - For people that already *do* have PEAR, they're probably going to get confused when trying to debug... and get really annoyed when they find out it's because PHP was trying to read *your* PEAR library instead of the global one - It's easier (in terms of getting access from server admin) to add more php files to the web root than it is to get access to php.ini There is really only one advantage that I can see here: you don't have to worry about BC / your custom library will "just work". In my opinion however it's just not worth it for the reasons listed above. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Voting Polls and preventing multiple votes
Dan Rossi wrote: Hi there I am mocking up a quick voting poll system, however I would like to put hooks in place to prevent users posting more than once, voting bots etc. Is there a way to prevent them, obviously sessions, cookies, host ips cant be used as they can be removed, and especially with host ips , ppl are usually behind a proxy ip that doesnt forwarding the referring ip. Let me know if anyone has cooked up something like this thanks. I have the voting mechanism and result displaying fine, just the special checks to prevent the form being displayed. If vote bots are your concern, then you will want to use one of those image generating scripts that create a unique code that only a human can read. It's tough to identify unique users with anything short of testing their clock skew. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Sorting Objects in an array by object properties
Reto M. Kiefer wrote: ... PS: The array has the following structure: Array ( [0] => mail_Header Object ( [id] => 1 [pid] => 1 [read] => r [flagged] => n [from] => [EMAIL PROTECTED] [subject] => Re: [ugffm] TYPO3 anybody ? [sendtime] => 2005.05.17 - 18:27:25 ) [1] => mail_Header Object ( [id] => 2 [pid] => 1 [read] => r [flagged] => n [from] => [EMAIL PROTECTED] [subject] => Re: [ugffm] website [sendtime] => 2005.05.17 - 19:13:26 ) ) For certain you will want to use usort, maybe something like: sendtime == $mailObj2->sentime) { return 0; } return ($mailObj1->sendtime < $mailObj2->sendtime) ? -1 : 1; } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: xml
Andy Pieters wrote: Hi all I recently decided to switch to xml for the configuration of our programs. I am now looking for a good way to handle that xml data. Basically, what I am looking for is a functionality where I say Get tag x with attribute1=y, attribute2=z,..., read its contents and put it in an associative array. If you want that much granular detail then you might want to use XPATH. The syntax is obviously a little different than PCRE, but once you understand it you'll find it's much more efficient (and easier) than building monstrously large PCRE's. http://php.net/manual/en/function.dom-domxpath-query.php http://www.w3.org/TR/xpath#path-abbrev -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: printf() in a variable, or alternative to printf()
sprintf() http://php.net/manual/en/function.sprintf.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: array_diff odities
Pablo Gosse wrote: Howdy folks. I'm running into something strange with array_diff that I'm hoping someone can shed some light on. I have two tab-delimited text files, and need to find the lines in the first that are not in the second, and vice-versa. There are 794 records in the first, and 724 in the second. Simple enough, I thought. The following code should work: $tmpOriginalGradList = file('/path/to/graduate_list_original.txt'); $tmpNewGradList = file('/path/to/graduate_list_new.txt'); $diff1 = array_diff($tmpOriginalGradList, $tmpNewGradList); $diff2 = array_diff($tmpNewGradList, $tmpOriginalGradList); I expected that this would set $diff1 to have all elements of $tmpOriginalGradList that did not exist in $tmpNewGradList, but it actually contains many elements that exist in both. The same is true for $diff2, in that many of its elements exist in both $tmpOriginalGradList and $tmpNewGradList as well. Since this returns $diff1 as having 253 elements and $diff2 as having 183, it sort of makes sense, since the difference between those two numbers is 70, which is the difference between the number of lines in the two files. But the bottom line is that both $diff1 and $diff2 contain elements common to both files, which using array_diff simply should not be the case. Hard to say what happened here. If I had to take a guess I might say that you're getting line wrapping in the middle of 183 different records. However, when I loop through each file and strip out all the tabs: And really since you have tab-delimited records you should be exploding on those tabs in order to get the data set. But because I'm slightly paranoid I would do it on the entire string of the file. $str_OriginalGradList = file_get_contents('/path/to/graduate_list_original.txt'); $ary_OriginalGradList = explode(chr(9), $str_OriginalGradList); $str_NewGradList = file_get_contents('/path/to/graduate_list_new.txt'); $ary_NewGradList = explode(chr(9), $str_OriginalGradList); $diff1 = array_diff($ary_OriginalGradList, $ary_NewGradList); $diff2 = array_diff($ary_NewGradList, $ary_OriginalGradList); echo ''; var_dump($diff1); var_dump($diff2); echo ''; ?> foreach ($tmpOriginalGradList as $k=>$l) { $tmp = str_replace(chr(9), '', $l); $tmpOriginalGradList[$k] = $tmp; } foreach ($tmpNewGradList as $k=>$l) { $tmp = str_replace(chr(9), '', $l); $tmpNewGradList[$k] = $tmp; } I get $diff1 as having 75 elements and $diff2 as having 5, which also sort of makes sense since there numerically there are 70 lines difference between the two files. I also manually replaced the tabs and checked about 20 of the elements in $diff1 and none were found in the new text file, and none of the 5 elements in $diff2 were found in the original text file. 75 / 5 is probably the right mix. Programmatically you can check this by comparing the diffs with each list. However, if in the code above I replace the tabs with a space instead of just stripping them out, then the numbers are again 253 and 183. I'm inclined to think the second set of results is accurate, since I was unable to find any of the 20 elements I tested in $diff1 in the new text file, and none of the elements in $diff2 are in the original text file. Does anyone have any idea why this is happening? The tab-delimited files were generated from Excel spreadsheets using the same script, so there wouldn't be any difference in the formatting of the files. The sad truth is that this is quite possibly the root cause of your problem. I have had many many problems caused by MS Excel conversion to/from other types of data. I don't completely understand the escaping process in Excel, but double quotes have always been a problem. And occasionally it seems like Excel just barfs on a tab / comma. Why it does that is completely beyond me. I can't count the number of times that I have opened up a comma delimited file in Excel, just *looked* at the file, saved it, and when I view the source it's been mangled a bit. Moral of the story: I don't ever use Excel to view tab or comma delimited types of data unless I have a backup someplace. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Responses in my email.
Rory Browne wrote: This is primarly a mailing list. Not a news group. The whole idea of a mailing list is that you get every message mailed to you. I use this solely as a news group. The news group seems to lag the email responses a little, but not too badly. For those that are interested I use Mozilla Thunderbird to connect to the news.php.net news server and overall I'm pretty happy about it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: gather reply from POST
Jeremy Reynolds wrote: I received this useful bit of code for storing a page into a variable instead of loading it as an include. But how can I modify this to submit some parameters to a page and collect the returned page / HTML into a variable?? Jeremy -- $text = file_get_contents('DocumentA.php'); echo $text; ?> You'll probably want to use cURL for this task, although Rasmus' posttohost might also give you something useful. http://php.net/manual/en/ref.curl.php http://www.php-faq.com/postToHost.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: why are session only working with cookies?
Please keep questions regarding PHP problems on the list instead of in my inbox. Thanks. Brian V Bonini wrote: > On Wed, 2005-05-18 at 12:58, Jason Barnett wrote: > >>Brian V Bonini wrote: >> >>>On Mon, 2005-05-16 at 22:10, Richard Lynch wrote: >>> >>> >>>>Let him fight with phpIniDir some other day. >>> >>> >>>Something interesting maybe: >>>http://gfx.gfx-design.com/session_test.php >>>Hit your browsers refresh button. >>> >>>I would think SID is NOT supposed to change with every page refresh..?? >>> >> >>Except that the SID is NOT in any POST / GET parameter. So since PHP >>doesn't recieve a SID on any refresh, it assumes that it is starting a >>new session each time. This is expected behavior. > > > Thanks for clarifying... Does not really have any bearing on my original > problem, but... At least I know THAT is nothing to look at further... > > -B > But it *does* have bearing on your original problem! If you *don't* use *cookies* then the only way to continue a session is by passing the SID through *POST* or *GET* parameters! That has been the whole point of the discussion about trans_sid! Simple as that! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: why are session only working with cookies?
Brian V Bonini wrote: On Mon, 2005-05-16 at 22:10, Richard Lynch wrote: Let him fight with phpIniDir some other day. Something interesting maybe: http://gfx.gfx-design.com/session_test.php Hit your browsers refresh button. I would think SID is NOT supposed to change with every page refresh..?? Except that the SID is NOT in any POST / GET parameter. So since PHP doesn't recieve a SID on any refresh, it assumes that it is starting a new session each time. This is expected behavior. Try creating a POST form instead and see what happens when you submit that form. Refreshing the page without a SID anywhere won't do anything. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Applications?
Evert | Rooftop wrote: Chris Shiflett wrote: Danny Brow wrote: > Zend sells a compiler to speed up your PHP code. Since it's compiled, > it also does not contain the source code in readable form. You should > visit the Zend website. Any free ones? http://pecl.php.net/package/APC APC won't work for me, segmentation faults all around =( suprisingly this doesn't occur the first time I load a page, only the second time ! grt, Evert I can't say for sure, but I'm betting that APC doesn't support the version of PHP that you are trying to use. Specifically, I don't think it supports PHP5+ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] hey dip shit
John Nichel wrote: Jason Motes wrote: HAH This list could really use an active moderator. Did Mr. Nichel just volunteer for that task... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] server taking long time to make graph
Balwant Singh wrote: Hi I am making graph in PHP using JPGRAPH. I am not taking big data, my data is only 48 points. Through TOP command in linux, I found that httpd is taking lot of time to make the simple x-y graph. I found that the graph size is 47.75kb only. May pls suggest if any setting needs to be done in PHP / APACHE etc. to make it fast If you really want to make that script go fast then you might try contacting Johann directly. He has both public / commercial versions and I'm willing to bet that the commercial version is faster than the public one. That being said, the best way to improve performance is to cache the graph. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Complex Data Structures
Zzapper wrote: Hi, I seem to remember that you access/use PHP data in the same/similar way to Perl data and that you can create complex data structures ie arrays of arrays, arrays of records etc. For once Google let me down so can any one point at any doc info. class A { } /** Initialize the array with values */ $stack = array(1,2,3); /** Push an array on the stack */ $stack[] = array('a', '2nd dimension of array'); /** Now we show that we can push an object onto the array */ $obj = new A(); /** The & might be recommended if you're using PHP4 */ $stack[] = &$obj; $obj->testvar = TRUE; /** Now we look at the stack */ echo ''; var_dump($stack); echo ''; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: why are session only working with cookies?
Brian V Bonini wrote: ... Still no go... Other changes in php.ini DO take effect, just not this I'm at a loss By any chance are you changing PHP values through Apache's conf file? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Components
So rather than starting YAPF[1] go and make an existing one better! [1] Yet Another PHP Framework I don't want to go on a rant here, but... I agree 100% with the above statement. So much code is out there that is free (however you want to define that). However, there isn't much code that is both free *and* of superior quality. I'm not just talking good; I'm talking about a program that is so excellent you would be foolish not to make use of it. PHP itself is one such example. Let me put this argument a different way: is it better for the computing world to have 3,000,000,000 different operating systems out there; or is it better for the computing world to have only 5 different operating systems, but they only need to be rebooted once a year? And you don't have to be the person that started a great project in order to be recognized for it. Yes, Rasmus started PHP eons ago and we are all very thankful for it. But who now gets the most recognition for their contributions to the PHP project? The names "Zeev" and "Andi" come to mind. So do "Stig Bakken", "Alan Knowles", "Marcus Boerger", and a whole host of others. So yeah... go make an existing project better. It will benefit us all in the long run, especially if you make your framework so good that *I* actually decide to use it. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] regex question
$text = 'Some text @ and some mo@@re and [EMAIL PROTECTED], etc @@@.'; /** Word boundaries before and after @ */ $regex = '/[EMAIL PROTECTED]/'; preg_match_all($regex, $text, $matches); var_dump($matches); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Cache
... H... well, file_get_contents() doesn't lock the file so I'm interested in how you're accomplishing this feat. Perhaps you're creating a temporary directory (atomic IIRC) for the filename and then flocking that? I dunno, I hate race conditions. I was to fast with that, I didn't look into it enough.. What _would_ be the fastest way (+locking) to do this? I haven't tested either of these options, but two ideas come to the top of my head: 1. if( mkdir($filename. '.lck') ) $text = file_get_contents($filename); /* be sure to rmdir($filename . '.lck') when operation is complete */ 2. regular steps of fopen(), flock() / mkdir(), fgets(), fclose(), flock() / rmdir() In any case you will find the user notes for flock() are useful: http://php.net/manual/en/function.flock.php You might also want to consider the security of the data that goes into your cache'd $_APP data. Because any file that is created by PHP is going to be in pretty much the same boat as the default session files and on a shared server, well... That's from a different thread, and is a different issue. I agree with your argument though, I'm aware of this risk, but most of the time I code on dedicated servers anyway =) grt, Evert Lucky you! Hey what can I say except that I can occasionally remember more than simply what is on screen *right now* and I try to put it all together when I can. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem with an excel file generated with a PHP class
Jay Blanchard wrote: Hi all, I am getting this error when generating an excel file blah.xls cannot be accessed. The file may be read-only, or you may be trying to access a read-only location. Or, the server the document is stored on may not be responding. I get this error if I click 'Open' in the dialog box, or if I save it and then try to open it. At this point I am rather tired and may be over-looking something. Can someone shed some light on the problem for me? Thanks! My guess is that the PHP user is not the same as the user that you're logged in with. Try blah.xls -> right click -> Properties -> [TAB] Security and change the permissions manually. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Cache
Evert | Rooftop wrote: Hi, I'm developing a cache system. Which works in pseude code, like this: class Cache { function Fetchdata($id1,$id2,$id3) { $id = md5($id1 . $id2 . $id3); if ($this->DataIsExpired($id)) return false; else return unserialize(file_get_contents($id)); } function storeData($data,$id1,$id2,$id3) { $id = md5($id1 . $id2 . $id3); OpenTheFileAndWriteTheDataSerialized($data); } } $id1 $id2 and $id3 are when they are combined unique * Is there a chance of collision when MD5 is used on the id's and the ids are long strings Yes there is a chance, but it's small enough that for practical purposes you can ignore it. * Is file_get_contents the fastest way to open the file? AFAIK yes it is since it takes advantage of memory mapping (where possible). * Is serialize the fastest way to serialize ;) ? Not sure. * Are there any other things I should consider? (I'm aware of file-locking issues, and have taken care of that) regards, Evert H... well, file_get_contents() doesn't lock the file so I'm interested in how you're accomplishing this feat. Perhaps you're creating a temporary directory (atomic IIRC) for the filename and then flocking that? I dunno, I hate race conditions. You might also want to consider the security of the data that goes into your cache'd $_APP data. Because any file that is created by PHP is going to be in pretty much the same boat as the default session files and on a shared server, well... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: learning classes - need pointer
Dustin Krysak wrote: ... that I should just pass to the class? Or would there be a more efficient way to do it? d http://pear.php.net/package/DB -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Firefox COM object
Dang Nguyen wrote: Hello, I would like to write some PHP scripts to automate web testing. I already have a framework that uses the COM class to automate the tests in IE. Now, I'd like to port that code so that I can test the same web pages in FireFox or Mozilla browsers. I haven't been able to locate any documentation or otherwise regarding this matter. Does Firefox have any COM interface like IE does? Cheers, Dang Nguyen Firefox makes use of Cross Platform COM, aka XPCOM. Now when I first read your question I didn't know what the answer was, but heck I was interested enough that I actually got off my lazy butt and searched for this one. A nice discussion here: http://forums.mozillazine.org/viewtopic.php?t=21&highlight=automated+test http://www.iol.ie/~locka/mozilla/control.htm I haven't tried it, but it looks like you can use some of your pre-exisitng code to test pages in Firefox as well. By the way, other people might find your code useful as well. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] extension development
Evert | Rooftop wrote: Basicly I want very rapid and easy information sharing between multiple processes. I'm not totally sure about the implementation yet. The most simple implementation would be using a $_APP global which is shared accross servers and processes, but to be honest I have to look into it to find the best and most usefull implementation. Funny that you mention $_APP. Depending on your needs you might find the following classes will help you out: Store the result of function calls to disk: http://pear.php.net/package/Cache http://cvs.php.net/co.php/pear/Cache/Application.php?r=1.8 Shared memory streams wrapper class: http://pear.php.net/package/Stream_SHM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Add to array problem
Mayo wrote: I'm having a little problem adding to an array. Each time I add to an array it wipes what was previously added. I'm using array_push(). $items=array(); $items=array_push($items, $_POST["whatever"]); I'm missing something easy. thx $items[] = sanitize($_POST['whatever']); function sanitize($postdata) { /* Some function that will check this $_POST data. In this case we'll just return the original value i.e. do no data validation. */ return $postdata; } ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re-initiating an autostarted session
Ville Mattila wrote: Marek Kilimajer wrote: You are right, unset($_COOKIES) does not remove cookie from the client. You need to unset() it so that your next call to session_start() does not use the same $_COOKIES[session_name()]. session_start will generate new session id if there is not one set in the request variables. I see, thanks! I tried unsetting the cookies and request superglobals, but it still does not give a new session id. unset($_COOKIES[session_name()]); unset($_REQUEST[session_name()]); session_destroy(); session_start(); session_write_close(); But this code *still* does not destroy the cookie on the client side. Are you doing that somewhere else? http://php.net/manual/en/function.session-destroy.php http://php.net/manual/en/function.setcookie.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] changing php ini location
Emre wrote: ... yes i aware of php ini set, but there is no logic using that command for global changes that you use each time. if you want to change global php.ini settings for a spesific script than its useful, but to change global settings for each script, thats smt like overkill :) eg. you can use phpiniset to increase a script max execution time, espesiaclly for upload or image manipulation process purposes. but for global execution time setting must be set via php.ini. thats what that file is for. Yep there are some php.ini options that you simply can't change at runtime. Period. For a listing of these options that you can't change you should go here: http://php.net/manual/en/ini.php#ini.list anyway after my research, I couldnt find a way to change php.ini location on this system: windows XP, apache 1.3, php5. This probably isn't the method that you envisioned, but if you run PHP as a CGI then you can specify which php.ini to use like the following: \php.exe -c Obviously you need to change the paths above. :) it sounds a little bit weird. why cant we use phpinidir at apache 1.3? since its supported by apache 2.0, it must also be supported by 1.3. how hard can it be anyway? most people (like me) still use and trust old good apache 1.3.XX its time to mail bomb apache dev team I think. All php users with apache 1.3, unite ! :) Better be careful there... Rasmus is/was on the Apache dev team... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: why are session only working with cookies?
Brian V Bonini wrote: On Fri, 2005-05-13 at 23:31, Jason Wong wrote: On Saturday 14 May 2005 09:42, Brian V Bonini wrote: Yeah, I know session support is there and I DO NOT have it set to use ONLY cookies. But if I disable cookies in the browser stuff relying on sessions stops working. I'm using 5.0.3 session.use_trans_sid 0 0 Set that to 1. Sessions *are* cookies, they're cookies that have been set to expire when the browsing session finishes (ie when the browser is closed). I thought the idea was; cookies if available otherwise the session data gets serialized and propagated in the URL? The later of which appears to not work, for me, if applicable While it is possible that you might save some data in a cookie (yes, I've seen it done) that's not usually the way that it works. Usually it's just as Richard has already described; the cookie just stores a name / value pair that identifies which session is yours and then PHP goes and retrieves that record. If you don't want to rely on cookies then using trans_sid is seriously the next best way to go. So go turn it on if you don't want to require cookies, it really should be that simple! Then the name / value pair is attached to the URLs instead of stored in a cookie. Do people actually try the code that I post to the list? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: why are session only working with cookies?
Brian V Bonini wrote: Everything in php.ini seems to be correct. Is there soem thign I'm supposed to pass to 'configure' at compile time? Session support is now built-in by default, so unless you specifically compile without it then you should have support for sessions in your build. Although yes, there are several php.ini settings that can modify cookie behavior: /** http://php.net/manual/en/ref.session.php#ini.session.use-only-cookies Don't force PHP to only use cookie propagation for session */ ini_set('session.use_only_cookies', 0); /** http://php.net/manual/en/ref.session.php#ini.session.use-trans-sid Optional, may not even work for your version of PHP */ ini_set('session.use_trans_sid', 1); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Form handling
Dan wrote: Richard Lynch wrote: ... The "value added" of the central switch seems dubious to me. Just my opinion. Richard - I want your opinion, which is why I'm taking a stab at the list ;) What other methods would be good to use? Using a giant if statement? Thanks -dant Nononono a giant "if" statement is still a case of you trying to control all form processing in one centralized location. I won't venture a guess as to why Richard doesn't approve of the centralized approach, but rather just pointing out that if() is logically similar to switch(). Now going back to your original question... one easy to predict problem is that you've forgotten to handle form submission errors. I mean surely you will want to validate the incoming data and do something sensible if the data doesn't match some regular expression(s). If you're really trying to go for a centralized approach then I'd say this validation should be handled through this main script. A simple alternative? Each form has its "target" attribute set to itself. You start out with invalid data. Then when the form POSTs to itself you can validate the incoming data within the same script where the form elements are located. This approach puts all of the business logic for one page *inside the one page*. It makes debugging a lot simpler because, well, if you have a problem with page1.php then you know it lies somewhere in the script page1.php instead of any of the following: - page1.php - controller.php - index.php - page2.php - etc. One of the easiest ways to reduce maintenance is to make it easy to find your bugs. I'm not being condescending to you, because we all have bugs. But it sure is easier to fix them when you can find them. :) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Hello, I'm new...
[EMAIL PROTECTED] wrote: I would like to create a 'community' website and was wondering if there was a framework available to get me started? Well now I don't even know what a framework is. I was expecting someone to say "Oh, you should use model view controller" or something. All the answers seem to be applications. Are applications frameworks? J I would call MVC a design pattern... but then again I never took a CS class in college so my knowledge of the lingo might be lacking. In any case based on the responses others have given to the OP (including your own responses) there are really multiple questions that you need to address: - what content / features do you want? - what kind of user interface do you want? - do you want a solution that is fully integrated? - If so, then also consider the licensing options for each solution. - If you don't want the full integration then you get to other questions like: - what design pattern fits my overall application? (likely MVC) - what pre-existing code does the best job for each part of my site? - what amount of flexibility do I want to build into my application? - what can I do to make this code as easy as possible to understand in the future, because I or someone else will have to debug it later? I'm missing a lot of questions out of my list, but it gets you started. Really it comes down to having a good mental picture of what it is you want the site to do and how it will work / look / feel. Then you get all of that down on paper and start finding code / packages / tutorials to fill in the blanks. Based on the somewhat vague OP, you have somewhat vague (but somewhat useful) answers. ;) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php works in IE not Firefox?
Dustin Wish wrote: Anyone run across an issue where a php script works in IE and not Firefox? Christianboards.org is a PHP nuke site running on a Enism linux box that is having this issue. --- Outgoing mail is certified Virus Free. Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.859 / Virus Database: 585 - Release Date: 2/14/2005 The site came up for me. Although it failed the first time around; perhaps the server is just overworked? Or are you trying to ask about a specific script? BTW, I denied the session cookie. 0:) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: new security patch problem
K.S. Tang wrote: Thanks you, There is no ['PHP_AUTH_USER'] nor ['PHP_AUTH_PW'] in var_dum() I've asked the server administrator, He said he has installed a php security patch two days ago. Could anyone tell me how to config the php server so that ['PHP_AUTH_USER'] and ['PHP_AUTH_PW'] can be access or avaliable to me and the web browser By default the php.ini settings should enable all PHP scripts to use $_SERVER variables (i.e. values that are provided by Apache / IIS / whatever). AFAIK you can limit this by changing the php.ini's variables_order so that it doesn't include 'E'; or you can use some combination of safe_mode, safe_mode_allowed_vars and / or safe_mode_protected_vars to accomplish this as well. The manual says that all of these except for variables_order are PHP_INI_SYSTEM, so the only one of these settings that you can possibly change at runtime would be: Within PHP it is sometimes possible to use getenv() to get the value of an environment variable. I don't have the time to test this but you might be able to try: ini_set('variables_order', 'EGPCS'); $user = getenv('PHP_AUTH_USER'); $pw = getenv('PHP_AUTH_PW'); /** search this output for PHP_AUTH_USER or PHP_AUTH_PW */ var_dump($GLOBALS); ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Seeking decent domain registrar
Marcus Bointon wrote: ... They did "change the rules" starting in November 2000, with RFCs (3454, 3490, 3491, 3492) finalised in 2003. See http:// www.verisign.com/products-services/naming-and-directory-services/ naming-services/internationalized-domain-names/index.html This page may be of interest too: http://www.imc.org/idna/. Also, have you tried going to www.café.com? It works just fine for me (if you're using an http://www.café.com -> I was redirected to http://www.xn--caf-dma.com/ http://www.whois.sc/www.café.com -> http://www.whois.sc/www.caf%E9.com (which shows the entry for some site which I don't understand) http://www.cafe.com -> some wireless internet provider http://www.whois.sc/www.cafe.com -> wireless internet provider What was it supposed to be exactly? All of the above was through Firefox 1.0.4 / Win32. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Hello, I'm new...
[EMAIL PROTECTED] wrote: Hi all, I have only recently started to look at php, I hope this list dose not mind 'noob' questions. I have got 'Programming PHP' by Rasmus Lerdorf, Kevin Tatroe and 'Web Database Applications with PHP and MySQL' Hugh E. Williams, David Lane. I would like to create a 'community' website and was wondering if there was a framework available to get me started? Thanks. While it won't have everything, you will probably find that the PEAR repository has a lot of useful classes for you to explore. http://pear.php.net/packages.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Re-initiating an autostarted session
Ville Mattila wrote: ... session_destroy(); session_regenerate_id(); session_write_close(); Header("Location: ..."); exit; For my point of view, this should do exactly what I like to do: destroy the old session data, generate a new one, write them and redirect the user to next page. And you're partly right. From the client's point of view it's still the same session. Why? Because you didn't destroy the cookie as well as the session data. So you're generating fresh session data, but the id is the same. In other words: - Page1.php - PHP reaches this session termination code - session file on hard drive / in DB / whatever for current SID is destroyed - $_SESSION still exists! Although this might be ok?... - execution for Page1.php ends (Header and then exit) - Page2.php starts - PHP reads in the session ID from the cookie - SID is the same as what was used in Page1.php - However, no session data exists for this SID so PHP starts up a *new session* with the *old SID* I remember somehow that there have been problems with SetCookie and Header("Location: ..") combination. Could this session problem arise due same reasons? Sort of. This is what you need: http://php.net/manual/en/function.session-destroy.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: number format?
Dustin Wish wrote: I have a number like -56.98 I need to convert it to -5698. I tried -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: text with $
Martín Marqués wrote: I have a text variable that contains "$" symbols, that when I pass it out PHP thinks that the "$" mean that a variable name comes right after. I tried escaping the "$" put with no luck. Is there something I can do? echo '$'; echo "\$"; ?> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Barcodes [Solved]
Mike Smith wrote: On 4/18/05, Eric Wood <[EMAIL PROTECTED]> wrote: - Original Message - From: "Mike Smith" I'm using a script to generate the barcodes (3 of 9 or Code39): http://www.sid6581.net/cs/php-scripts/barcode/ This script seems to limit the input barcode to 15 characters... um... -eric woo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php The sample on the website will display image to small for 16 characters. There is an options to adjust the widthXheight of the generated image to display more I found the longest part number we had and based my image width on that (+5). There are other options (phpclasses, hotscripts), but this works for now. I may evaluate some other options as I get into it. -- Mike Hey, did you do any more testing with this? My company has gone through a lot of the parts identification process for our accounting system and we're eager to get barcoding set up as well. Our platform of choice is Windows (yeah, yeah) so it would be great to hear some feedback about that OS if you've tested on it... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newsgroup
Jochem Maas wrote: ... ** as in 'people who compulsively want to help newbies', rather than 'people that are newly infected by the helping virus' (of which there are many on this list also ;-). Hey, I resemble that remark! :P -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Tracking what has been changed
Mark Rees wrote: -Original Message- From: Robb Kerr [mailto:[EMAIL PROTECTED] Sent: 05 May 2005 00:29 To: php-general@lists.php.net Subject: [PHP] Tracking what has been changed Here's the scenario... I am building a site in which users will be able to create and then later edit personal information. When they edit their information, I need to keep track of what was changed so that I can inform via email a person to approve the changes. Here's the flow I'm considering... When an UPDATE page is loaded, I build an array like... $fields = array("table.field1" => value, "table.field2" => value, "table.field3" => value) I then plan to save this array to a SESSION variable. Then, when the form is posted I save the new form contents to another SESSION variable. Then I compare the two arrays and save the names of the fields changed to an array saved in a third SESSION variable. Finally, when I build the email, I can parse the changed fields array to inform the person who must approve the changes. First, does anyone have a suggestion of a better way to do this? cron job a script for the emails... just in case you have some fool(s) trying to make 100's of updates per minute. store the potential changes to an "UPDATE" table or something similar. admin can then commit the change by updating these proposed changes or just dump them from the table. [EDIT] I see that you're doing this below. Nice. -- How long do you expect people to take to approve the changes? What happens if they don't approve them? What if they are on holiday? What if someone changes the data, then someone else makes another change, then the person who approves them approves the first change? Your problem, not mine. ;) Seriously those are good questions, but I'm not going to make policy decisions for you / your company. Your question about transactions is interesting though... do you mean you have multiple users that can change the same information? I would recommend storing the change information in a db. Say you have a table t_personal_info Id firstName surName Telephonenumber dateUpdated You can then have another table t_personal_info_pending With an additional field changeid (to handle multiple changes to the same record) With the same fields. When someone approves a change, update t_personal_info with the change and delete the record from t_personal_info_pending Second, I can't seem to save an array to a SESSION variable. I build the array in a local variable and then set the SESSION variable equal to it. When I recall the SESSION varialbe, it's contents is "Array". Then, when I print_r() the SESSION variable, I still get "Array" as the contents. What's up? I doubt that references are the issue, but if they are you can do this: $_SESSION['local'] = &$local; Are you possibly emptying out the $local array some place? Or are you emptying out the $_SESSION anywhere? Heck, are you even sure that you're using the same session from request to request? Or perhaps the process you use to build the $local and / or $_SESSION['local'] is flawed and not really building anything. Thanx in advance for any help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php