Re: [PHP] escape \n
Le 23/04/2010 10:05, Ashley Sheridan a écrit : By default, PHP sends out HTML headers. Browsers ignore extraneous white-space characters, and also new lines, carriage returns and tabs, converting them all to a single space character. For completeness, the white-space discarding depends about the context the characters are met. For more inside, Nick could look into <http://www.w3.org/TR/html401/struct/text.html>. So said, the browser doesn't convert, it renders ;) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Replace a space with a newline every 2 spaces
Le 22/04/2010 19:29, Paul Halliday a écrit : I found some long functions to achieve this but I couldn't help but think that it could be done in a couple lines. Possible? http://us.php.net/manual/en/function.wordwrap.php -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Want a answer about php-cgi
Le 21/04/2010 12:17, Sharl.Jimh.Tsin a écrit : i can not find php-cgi file in the bin/sbin directory. WHY? ("--disable-cgi" is not used) cd to your build directory, then type next command : find . -name php5-cgi -or -name php-cgi -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Display HTML in XSL Style Sheet
Matthew Croud wrote: Is there a way to store HTML in an XML file, Access that node using XLST, and have it display as rendered html ? As XHTML ypu can integrate it in an XML, by the use of XMLNS. But it is OT. In the XML, you declare two XMLNS. In the XSLT, you declare three XMLNS. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Developer Question [DOMDocument]
Ashley Sheridan wrote: I've not had a look at DOMDocument myself, having only used DomDocument before (there's a slight difference in the capitalisation of the 2nd and 3rd letters which made it a pain in the proverbial to work with at first!) Did you never notice that PHP has case insensitive class names and function names ? (maybe you did a joke ?) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo
Ben Dunlap wrote: ... and, in fact, that /is/ how C behaves. The following code: No, that's implementation's behaviour. AFAIK, the normative document give to compiler the behaviour implementation. So, it can do optimization, that gives strange behaviour for a people how think increment operators had a wall defined behaviour. int a = 2; a = a++; printf("a = [%d]\n", a); Will output "a = [3]". At least on Ubuntu 9 using gcc 4.3.3. That's gcc way :) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Creating alphanumeric id for a table
aveev wrote: where the id consists of 3 alphanumeric characters and 4 numerical digits in the beginning (for numerical digit, it can grow like this AAA10001). I try to use php script to generate id like this, where I use the following script. $id = $num; if($num_dig <= $start_dig) { $num_zero = $start_dig - $num_dig; for($i=0;$i< $num_zero; $i++) { $id = '0' . $id; } } $id = 'AAA' . $id; return $id; } You can create a stored procedure or a trigger on inserting that implement your id logic. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Renaming a Directory
Paul M Foster a écrit : I would have thought so, but the man pages didn't mention it. I haven't use mv in ages. Makes sense that it would work, though. Moving/renaming a file would just change the name, not the inode number, which is the real key to *nix file systems. Ashley said it, a directory is a file. But more, when you do a mv on a file, it don't rename. If the target is in the same filesystem, mv do a hard link on the source file, then unlink the original name. If you move accross filesystem, mv do a copy of the directory. If you don't believe me, get the source. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting URL's to hyperlinks.
Sorry for the lag. Daevid Vincent a écrit : OP ? Original Poster Thanks :) Blah blah blah. I've used this code for about 6 years now and have yet to find emails that it didn't work for. If someone has some funky (whacky) RFC extremity, then so be it. That's their problem. Most people have NORMAL emails that follow the above. I faced a professionnal issue because of a lazy programmer (a Delphi component that was not aware about "Toto man"@example.com). What you consider normal e'mail is a subset that is not interoperable. And I hate that. But you are correct, I have revised it to be a little more forgiving of some allowed characters... preg_replace("/([\w\.\-...@[\w\.\-_]+\.\w{2,6})/i", You can revised your regex to fit to the new kind of email. But it is smarter to use the right tool (like filter_vars). Yeah, I know, I feel like some spanish windmill hunter. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Searching on AlphaNumeric Content Only
Ashley Sheridan a écrit : You'll have far greater performance issues if you retrieve all those records and attempt to do the same thing inside of PHP... It's why I speak about « avoiding » and not « bannishing ». Like can be usefull, I used to use it. But it is not the a good answer to all problems. The problem with like operator is it can't use the index (or in a very limited way). So I try to warn about it. So said, I never submit an all-retrieving method. I know it isn't the solution too. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Searching on AlphaNumeric Content Only
sono...@fannullone.us a écrit : Here's an example: let's say there is an itemID of 4D-2448-7PS but someone omits the dashes and searches on 4D24487PS. Is it possible in PHP to have the find be successful, even if the search criteria doesn't exactly match what's stored in the field? I think you don't follow the good path. A good way could be to have a strenger UI management. For exemple, here, you have an ID that is composed about 3 bits. So do the UI present three input fields, or write a smart input (with JS). Of course, in the control side (PHP), you have to check the format of the returned data. Here you can reject the input, or fall through some segment of code that try to interpret the submitted value. But in first time, do it simple and be rough to users. Usability can be improved in a second time. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Searching on AlphaNumeric Content Only
Ashley Sheridan a écrit : What's wrong with using the wildcards that are built into most SQL variants? Performance issues. Like is an operator to avoid when possible. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Converting URL's to hyperlinks.
Daevid Vincent a écrit : Maybe I misunderstood the OP, OP ? but wouldn't this (or something like it) be easier and cleaner than that mess below?? No, it's dirty too. $url = preg_replace("/(\...@\w+\.[a-za-z]{2,3})/i", "$1", $url); This violate the numerous RFC about mail addresses, and some other stuffs. $url = preg_replace("/\s(http:\/\/)?(\w*\.?\w*\.[a-zA-Z]{2,3}.*?\s)/i", " $2", $url); Same as previously. What about .info, .museum and so on tld ? The filter_var is well suited for this kind of job. Oh, and your regex isn't smart (you use the case insensitivity flag, but seek A-Z characters...) :D -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: IRC and English
Paul M Foster wrote: I'm sorry, but is anyone else annoyed by people who attempt to use IRC jargon on mailing lists? For example, substituting "u" for "you". Oddly enough, I'm seeing this primarily in foreign language posters, not in native English speakers. It's often accompanied by English so broken I don't even bother trying to decypher it, and sometimes an *attitude* (after which, I blacklist the poster). Actually, it isn't jargon, maybe degenerated (this is english word ?) dialect of english. Some years earlier, I took the habit to use these shortcuts (10x, u, eg, etc). Because I learned your langage throught the Internet. It's why this few sentences are so broken. If people don't care about their writing, banish them from your life. I do the same with french. But if you cross someone like me, who juste would learn better way to speack, please accept our apologies ;) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Getting backtrace through GDB?
Jason Young wrote: Anyone, anyone? Bueller? :P I'm sure someone has experience with GDB? I'm not looking for a newbie primer, I'm just curious if anyone has had experience with the problem below and knew how to correct it.. I guess we are on PHP users list, gdb's ;) If no symbols appear, it means that libraries and PHP wasn't compile with debug flags (eg -g with gcc). So, what you need as informations depends about what OS you're running. But, especially for PHP, you must run configure PHP building with the fine flag --enable-debug. For more information, you can read the GCC and GDB documentations. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Exclusive File Access
Bastien Koert wrote: lock it with www.php.net/flock But you remain to be carefull, because flock is more like a semaphore : it doesn't really lock the file. See man page for flock. (Maybe under MS Windows the lock is hard). -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unset( $anobject) does not invoce __destruct()
Ashley Sheridan wrote: That would seem sensible to me though really. A constructor only bears true for the base class, so any classes which inherit it must incorporate all the constructor parts. A destructor doesn't know about further classes which will need to inherit it, so it shouldn't be inherited and the new class should sort things out. At least, that's how I see it. No, destructor can be set in abstract class. And it must if some advanced stuff done in the base classe. Like freeing ressources, closing file or database connections that is generic for classes that implements abstract stuff. So said, the __destuct destructor isn't called, for obvious reasons explained further. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] unset( $anobject) does not invoce __destruct()
kranthi wrote: unset($obj) always calls the __destruct() function of the class. Never calls the dtor. The dtor will be called only when the reference count reaches 0. class c { function __destruct() { echo 'dying !' ; } } $v1 = new c ; $v2 = $v1 ; unset($v1) ; // don't call the dtor unset($v2) ; // call the dtor -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: This is the kind of [expletives deleted] answer that is certain to prevent bugs being reported.
Per Jessen wrote: See http://bugs.php.net/?id=48612 I don't understand too the answer. For me it is obvious it is a bug because it breaks the system locale behaviour. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Question on code profiling
Andrew Ballard a écrit : I'm trying to profile a site on our development server to see why it takes around 4 seconds to generate a pretty basic page. Last time I seen this is when I did validate DOM Document without DTD on local disk :D Can you put somewhere the essential code that take time ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Structure of PHP files
Sándor Tamás (HostWare Kft . ) a écrit : It isn't really a programming question, but rather a structural. It is part of our burden ;) Which is the better approach: They are no better approch, only bad ones. I'm using to organize my code in module. Each module require the needed modules. This design permit me to ease case testing, and ease maintenance because you know quite fast what module can be impact by the alteration of another. I never have to speak about scallability of this method, because I never work on a very big system. But that's optimization, I think it'll need some sed (sed -i 's/\/require_ondemand/' project/) and a strong mecanism to provide including on demand. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Doubt regarding session_destroy() in PHP 5
Ashley Sheridan a écrit : But *how* does it offer more security? You've not actually mentioned that! Because you need database slice access to manage the session, and not only file access in /tmp/ (where sessions belongs, by default). So now the problem is : and what about the configuration file that lies in my filesystem ? :D -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Exception not being caught
Weston C a écrit : If it's catchable, why isn't it caught in my example? This is well-documented here <http://php.net/manual/en/class.errorexception.php> -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function parameter passed by reference with default value to null
David Otton a écrit : So there's some serious impedance mismatch going on there to make both features to work together. Just think of the default value as "something I can overwrite", eg: Thanks for this smart explanation. It shines my day. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function parameter passed by reference with default value to null
Stuart a écrit : The whole point of default arguments is for it to use that argument if none is passed. It is not the point too. What makes you think not passing an argument to that function should raise an error? Maybe because in my example, the provided value is not a valuable value for a reference ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Function parameter passed by reference with default value to null
Stuart a écrit : You appear to be using the definition of null that comes from the world of C. I didn't. The point is I'm allowed to set a default value to null for a referenced parameter (what I can do in C for a pointer, so I knew it). I'm happy PHP raises an error on foo(null) ; I'm in trouble when foo() doesn't. The actual question is : why PHP doesn't raise an error ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Function parameter passed by reference with default value to null
Hi, I would like to know if I am alone to be shoked by this : == 8< == function foo(& $bar = null) { } foo() ; // runs foo(null) ; // raise an error == >8 == Why the default value to null for a reference is allowed ? Is it a bug, a feature ? Thanks ! -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] calculate the time that day ends
Shawn McKenzie a écrit : STFW That's not so fair. If Thodoris ask about day end, it is obvious he's wrong with the word. Wrong because he isn't mastering english. So, without the good word (sunset), he can't find. So please don't bash us when we appear silly ! -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Blank page of hell..what to look for
Terion Miller a écrit : Is there a certain thing that should be suspected and looked at first when getting the php blank page of hell Did you check error logs from Apache or the one you configured in php.ini ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org Seeking for a position <http://lupusmic.org/pro/> -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] IE Problem Detecting Post Variables
L. Herbert a écrit : Each input is a "submit" button. MSIE pushes input_name.x and input_name.y to the server, when the input is an image. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Good PHP book?
Daniel Brown a écrit : You'd be surprised. The "For Dummies" series is one of the best-selling franchises in mainstream publishing history. Best-selling are not a proof of quality. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: file_Exists() and case
Stan a écrit : The script is running on an UBUNTU v8.04 LAMP server. Case is supposed to matter, isn't it? With a POSIX filesystem only. If you store you're pictures in a fat or ntfs filesystem, case sensitive will not matter. BTW, extension concept doesn't exists in POSIX filesystems, because it is unsafe. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PCRE regex result is different between Linux & Windows.
ClapClap a écrit : For the PCRE version, I really can not tell you which one I use... Where can I see that ? In the the output from phpinfo function. So, It may be a bug ? Too bad... I remember some change behavior recently in PCRE. But I am not sure, I want just to drop this option first. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PCRE regex result is different between Linux & Windows.
Jochem Maas a écrit : okay, are you using the same PHP version on both machines? anything in the php.ini's that differs? And by the way, what version of PCRE are in use. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] permission failure with fopen
Andrew Ballard a écrit : Once you identify the account, it needs to have Modify (which, for files, includes Read & Execute, Read, and Write) permission on the file being edited. If the file does not already exist, then that account needs to have Modify (which, for folders, includes Read & Execute, List Folder Contents, Read, and Write) permission on the folder where it will be created. They are an amazing thing to check in MS Windows NT OSes : the file has right to be open by a connected application (or something like that). And IIS or Apache are one of them. Enjoy :D -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Infinite Loop Issue
Kyle Terry a écrit : I believe I'm doing everything right here. It just seems like it doesn't end. The browser just keeps trying to load the page forever... If the problem doesn't seem to be there, you could see the wrong code snipset :D Did check out your error log from PHP, from Apache ? ? Some time, the segfault of Apache (due to self or PHP) cause the same effect than an infinite loop. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic php question...
Thodoris a écrit : Do these people really exist? I though that their extinction happened the same with the dinosaurs. Like Ashley said it, they are some specific situation where you can't. But, Javascript can become a secrity issue, and it must be deactivable. Some years ago, they was a security issue about images in MSIE. To avoid any problems, images where filtered. Imagine to browse without images, when a great share of web sites uses images for their layout, and never cleanly fill the alt attribute ? It is the same with Javascript : it's a sugar. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] removing text from a string
Ashley Sheridan a écrit : Thats a lot of code when a couple of lines and a regex will do ;) Maybe because the use of the regex is pointless here. A bazooka to kill the fly ? :) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] removing text from a string
Micah Gersten a écrit : Yep, with a regex, it's real easy (untested code): So easy you got two bugs : I hope you don't really do that in production code. It can be bogus with big files. $newFileData = preg_replace('/^\d+?\.\s?(.*$)/m','/$1/', $fileData); Buggy regex. And text,txt is a correct filename, I don't understand why you worry about :D -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Weird problem with HTML form and $_POST
Michelle Konzack a écrit : and as you can see, there are three items taged... So, this part is working fine, but if I select an additional item and hit SUBMIT I get only: How do you select it ? By a click or a ctrl-click ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] basic php question...
Richard Heyes a écrit : users who browse without Javascript enabled, Heretics! No, paranoid :D -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Write my own extensions
Gautier Di Folco a écrit : I am a French student, so I do not speak english very well, I am sorry... We(re a lot in this case :p For a few weeks I want to write my own extension for PHP in C++ language... Do it in C, not C++. And compile in C, not C++. C and C++ are slightly different. If you want a plain explanation, write me in private (en plus on pourra parler en français, et non dans un horrible globish). But I do not find any trivial things, all the exemples did not have any paramaters... Do you know where I can find concrete things to do function or class/objects for PHP in C++ ? C++ interface for writing PHP extension doesn't exists, it is C only. And the best source of documentation for that is the PHP source code. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Mailing lists
Daniel Brown a écrit : On Thu, Oct 30, 2008 at 3:06 PM, Richard Heyes <[EMAIL PROTECTED]> wrote: Pink isn't my colour... And there's no 'U' in 'color' either, you limey! ;-P It depends on what english your are using, isn't it ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Newbie: can I store flash file into Mysql DB
Bastien Koert a écrit : We used to do that here, and there was significant performance impact after the database got to be about 12Gb, with minor impact showing after only a few Gb. I ended up having to write a script that stripped all the data from the Db into the file system. What engine did you run ? With innodb, blobs are stored in separate files, so it doesn't impact the engine performances (they are other problems, like file caching not available). -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex validation
VamVan a écrit : This is where it messes up. So I have decided not to allow people to use that as well. By that way, you're making a lot of ennemies on this very list :D -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] clear a mysql table
Jim Lucas a écrit : I would ass-u-me that if someone had foreign keys and/or triggers setup that they would not need to ask how to clear/empty a table I never assume that kind of thing, because he could be cleaning a database he didn't designed. It happends. :) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] clear a mysql table
Daniel P. Brown a écrit : In direct response to your question, you're looking for the TRUNCATE command. I hope he doesn't have any foreign keys nor triggers. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to submit form via PHP
Ashley Sheridan a écrit : From the link you gave, we stick on <http://www.w3.org/TR/html401/types.html#type-uri>, so it references an IETF RFC <http://www.ietf.org/rfc/rfc1808.txt> that describes what is an URI. The fourth section describes how we have to determine the resolution of an URI. The point that are in our scope is the next I quote : « a) If the embedded URL is entirely empty, it inherits the entire base URL (i.e., is set equal to the base URL) and we are done. » If you have any doubt, just enjoy reading the full document ;) But for me, it is quite clear that an empty string is a valid URI *into* a document served by HTTP. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How to submit form via PHP
Micah Gersten a écrit : Not according to this: http://www.w3.org/TR/html401/interact/forms.html#adef-action The only defined behaviour is when you specify a URI. The empty string into an HTML document is a valid relative URI ;) According the same document gave (just follow the references ;) ). -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Prevent execution bad commands
Ashley Sheridan a écrit : find /home/test -mtime -$duration | sort | xargs grep -l "$search_criteria" It's likely yes, unless you validate the search criteria in any way, you're just asking for trouble. I just add an exemple that delete evérything on your server : $searh_criteria = "`rm -rf /`" ; It exists a function <http://fr2.php.net/manual/en/function.escapeshellcmd.php> that escape shuch kind of string. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Math problems (No not high school math!)
Jason Pruim a écrit : $totalday = $totalday/60/60; If you're working with legal dates, this is wrong. A day can be 23 or 25 hours long. Thing about time changing (winter and summer time). Use strtotime to avoid this kind of problems. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Reading a Word document from PHP
Robert Cummings a écrit : If it were me... and I REALLY needed to do this... I'd probably start look into how to make Open Office do a command line conversion of word documents to plain text. If you're on Debian, seek for the openoffice.org-headless package ;) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] was [PHP] Re: render html
Nathan Rixham a écrit : is an interesting one; and very rarely used Maybe because it isn't part of the normalized W3C markup languages ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SESSIONS vs. MySQL
Per Jessen a écrit : No, that wouldn't be the default behaviour. /tmp is typically on the filesystem, and it's not cleared on every reboot (unless your system has been configured to do so). In Debian based, it is the default behaviour. i hope it is the same in other major distributions. The last fashion is to use a tmpfs to mount /tmp -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: OOP - Calling methods from classes that are inheriting?
Ben Stones a écrit : Hope I have made myself as clear as possible! I did'nt understand what you mean, but I guess you're seeking for the parent keyword. Read again the PHP manual about OOP. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Header() - POST
Maciek Sokolewicz a écrit : Your xss answer is moot. XSS attacks can (almost) just as easily be performed via POST as they can via GET. No, because you can't click on a link that make a post. Maybe on unsecured browser that allows Xhr (and a POST so) on every sites on the Internet. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Browser could not get mp3 files from http site
Michelle Konzack a écrit : It is a Netscape/Mozilla Extension: Are you kidding ? This is normalized thing : <http://www.w3.org/TR/html4/struct/objects.html> -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Header() - POST
Michelle Konzack a écrit : Why using JS? echo ""; would do the trick... No, because it'll not send back the datas in the hide form. And if you suggest to pass datas in a HTTP GET, I'll answer XSS in the scope :) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: render html
Michelle Konzack a écrit : $body = "helloierhellohello"; ^ Should be Definitely no : <http://www.w3.org/TR/2006/REC-xml-20060816/#dt-empty> <http://www.w3.org/TR/2006/REC-xml-20060816/#NT-S> Or maybe for buggy browsers ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Calculation assistance.. :)
Stephen Johnson a écrit : OK.. Math is NOT my forte ... I am converting a site from ASP to PHP ... And this calc is in the ASP Code : $nMonthlyInterest = $nRate / (12 * 100) Wow, that's rather not good. Learn about <http://en.wikipedia.org/wiki/Geometric_progression>. Because : 12 % of 100 is 12 but if you get 1 % each month : 1 % of 100 the first month 1 % of 99 the second month etc. so it will be less than 12. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Email Verification
Richard Heyes a écrit : New domain name extensions can be accounted for easily, eg: \.(?:[a-z]){2,4} It excludes .museum tld. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP on 64bit Ubuntu
Robert Cummings a écrit : Exactly double. Please explain where I went wrong. You're right. The problem is elsewhere : Alignement, I forgot it my explanation :-/ It doesn't count in the sizeof computation, but it is actually allocate, and can take a lot of place. It can be interesting to watch the memory consumption when playing with optimizations options ;) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Using DOM textContent Property
[EMAIL PROTECTED] a écrit : That example was for finding email addresses and turning them into links, not the other thing about adding missing attributes. XPATH would be no help with the former. You're right, I misunderstood :-/ sorry for the noise. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP on 64bit Ubuntu
Robert Cummings a écrit : Please explain how it can take up more than twice. It is obvious for a C developper. == 8< == Zend/zend.h typedef struct _zval_struct zval; typedef union _zvalue_value { long lval; /* long value */ double dval;/* double value */ struct { char *val; int len; } str; HashTable *ht; /* hash table value */ zend_object_value obj; } zvalue_value; typedef struct _zend_object { zend_class_entry *ce; HashTable *properties; HashTable *guards; /* protects from __get/__set ... recursion */ } zend_object; struct _zval_struct { /* Variable information */ zvalue_value value; /* value */ zend_uint refcount__gc; zend_uchar type;/* active type */ zend_uchar is_ref__gc; }; == 8< == When you write $a = 1 ; The $a variable don't contain only the integer, it contains a lot of more stuff. This stuff is needed by the fact that a variable can contain every types available in PHP. So, I let you calculate the memory needed to store the variable, but you can easily understand that they'll not be twice the previous memory footprint, but a little more. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Google Chrome
Shawn McKenzie a écrit : Will somebody volunteer to test on Wine or Mono? Google don't allow the downloading from Linux (I now, I can easily work around, but I don't workaround when the other site won't). -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Using DOM textContent Property
Tim Gustafson a écrit : $Elements = $HTML->getElementsByTagName("*"); for ($X = 0; $X < $Elements->length; $X++) { ... SNIP ... } Why don't use the XPath ? <http://fr.php.net/manual/en/class.domxpath.php> <http://fr.php.net/manual/en/domxpath.query.php> This query fetch all a elements with no title attribute or empty title attribute : '//a[not(@title) or @title = ""]' ; -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: skinning a cat
Robert Cummings a écrit : Try running that on windows. No problem <http://technet.microsoft.com/en-us/interopmigration/bb380242.aspx> -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: switch case - to require the break statements seems strange to me
Diogo Neves a écrit : Hi, Well, I see a good reason anyway... U can have a lot of entry points and only one to exit... Like: I misunderstood the question :-/ I read Govinda had a strange behavior that ignore the break :-D -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [HS] Howto answer Was: [PHP] casting static property
Govinda a écrit : does "top post" mean to puts one's reply text at the top of the email? People prefer it to be at the bottom? Yes, because the regular way is to read top to bottom. Personally I like the new text to be at the top so I don't have to scroll down to see the new part You don't have to scroll if everybody clean as it must. expect/prefer so I can maximize my chance to get help when I need it ;-) Yeah, because morron like me autoscroll ;) If I see nothing, I don't answer and stroke key to reach the next message :) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: switch case - to require the break statements seems strange to me
Govinda a écrit : Or is there a better reason? What is exactly in $i ? A scalar integer, a string containing an integer ? A boolean ? What version of PHP ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP IDE needed
Shelley a écrit : Though vim is not a so-called IDE, actually it's quite handy. Actually, it is. An IDE is a glue between a set of tools. Vim provides every services you need, and it is scriptable. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for email validation
Per Jessen a écrit : I don't know, but I suspect due to lack of support in popular mailers and mail-servers. Also, the use of quotes does make it cumbersome to work with, both as a user and as a mailserver admin. I had to write some pieace of code that can handle "toto toto"@ndd five years ago, it was Lotus Mail habits of the end users ;) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for email validation
Per Jessen a écrit : That format is about as dead as the dinosaurs. Why ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regex for email validation
mike a écrit : php should have a good check built-in. see http://www.php.net/manual/en/function.filter-var.php Argh ! Howmany times it is in ? I spent so many time to write a regex that belongs the RFC822 :-/ Because all the regex in answer here was false. They don't allow email like "Mickael Doodoo"@lupusmic.com nor [EMAIL PROTECTED] ; and they are valuable email addresses. Without the fact that a top level domain isn't always between two and three characters (think about .museum). -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] [OT|Troll] Re: [PHP] Re: PHP IDE needed
Sancar Saran a écrit : Whats wrong with echo "" > index.php Two syntacticals errors ? :p is there anything to satisfy your needs... I prefer cat for that purpose, more flexible. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Bug in array_key_exist?
Korgan a écrit : public function addXXX($id, $count) { $count = (int)$cout; Try to work with error_reporting set to E_ALL ;) session_start(); var_dump($_SESSION['XX']); /** A **/ If XX is a right value for a variable name, they are no problem. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] concatenating with "." or ","
tedd a écrit : The cycle of programming continues. And the algorithm era crunch down ;) The test isn't accurate because it focuses on two strings of the same length. And all programmers know that some algorithms depends on the size of the data handled, and the number of it. Obviously, parameters method of echo must be faster than concatenation method. If it isn't, we are in the window that is better, or they are a problem, or an optimization ;) The reason is PHP make an allocation of a new string when concat that equal to the size of the two strings, and copy strings content into the new allocate memory zone. So if you just echo, it allocates the memory just needed to copy in the echoed string. So said, benchmarks must be make with a good knoledge of what you're handling, although you can't do a good one. For example, I can't make a benchmark on english as you can see ;) -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie Q: How to say, "if the fileNAME is equal to...", or better yet, "if the fileNAME ends with '.jpg'"?
Ford, Mike a écrit : case '.gif': case '.png': case '.jpg': case '.jpeg': Be careful. The end of the filename is just a clue on what is filled the file. See <http://fr3.php.net/manual/en/book.fileinfo.php> for more acurate result. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] newbie Q: How to say, "if the fileNAME is equal to...", or better yet, "if the fileNAME ends with '.jpg'"?
Ford, Mike a écrit : case '.gif': case '.png': case '.jpg': case '.jpeg': echo $file; Be carefull. The « extension » is just a clue to know what filled the file. See <http://fr3.php.net/manual/en/book.fileinfo.php>. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php not reading file properly
sean greenslade a écrit : $fh = fopen($myFile, 'r'); Here, they are some return code to ckeck. but not when I access it thru the web. when I browse to it, it just displays the static text ("This weeks apache log (clears every sunday morning):"), not the log text. Who owned /var/log/httpd/access_log ? What mode accesses on the file ? What user runs the webserver (www-data, apache, someunprivileged) ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Negative Look Ahead Regex - Code Mistake or Bug?
Cameron B. Prince a écrit : An example of the code is here: $buffer = preg_replace('/"http\:\/\/www\.domain\.com([\/\w\.-]*)(?!\?PHPSESSID\=2u0cca ffoh6jaeapkke35qpp87;?)/', '"http://www.domain.com$1?PHPSESSID=t9gksvpdcuobsnqt98qloe6lg4;', $buffer); I never build my regex inline. I write them by pieces I can test. It is obviously to divide (and I don't know in english the end). So when the starting and ending marks are too frequents in my pattern, I use an other mark (like `). $domain = '(http://www\.domain\.com)' ; $path = '(/\\w*)+' ; $search_part = 'PHPSESSID=(?:[\w\d]+)' ; $re = sprintf("`%s%s?%s`", $domain, $path, $search_part) ; $buffer = '\1\2?PHPSESSID=t9gksvpdcuobsnqt98qloe6lg4;' ; $buffer = preg_match($re, $url, $buffer) ; So said, it doesn't work anymore when you'll have other parameters in your search part. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Negative Look Ahead Regex - Code Mistake or Bug?
Ashley Sheridan a écrit : Hi Cameron, As far as I can tell, you have an error in your syntax. You're using a - (hyphen) character in the first match, but Regex uses this to define a range of characters. That's not valuable if hyphen is the last character of the range set. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Breaking a line in two
Ron Piggott a écrit : This is 23 characters long. I want added after the 12th character, following the first space: I guess you want to use wordwrap <http://www.php.net/wordwrap> and nl2br <http://www.php.net/nl2br>. -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Open Source Classifides
Joey a écrit : Does anyone know of a good php based classified system? What do you mean by classified system ? -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Buffering problem
Anders Norrbring a écrit : I'm running out of ideas to where to look for this, so can you please give me some pointers? I guess it is that you're seeking for : <http://fr.php.net/manual/en/outcontrol.configuration.php#ini.implicit-flush> -- Mickaël Wolff aka Lupus Michaelis http://lupusmic.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php