[PHP] Re: data grids...
BlueShoes: PHP Framework and CMS http://www.blueshoes.org/en/javascript/ Regards, Nadim Attari Alienworkers.com Blackwater Dev [EMAIL PROTECTED] a écrit dans le message de news:[EMAIL PROTECTED] Does anyone have a nice clean way to provide data grids with php short of simply creating a bunch of input boxes or using flash? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Users of RDBMS
John Nichel wrote: M. Sokolewicz wrote: John Nichel wrote: Joshua D. Drake wrote: PHP != MySQL MySQL != RDBMS Please tell me you're kidding. that's a funny one... could've sworn it actually was one... All this time the MySQL AB people have been lying to us. It's actually an Excel spreadsheet. ;) Well RDBMS things like Foreign Key's and constraints used to be documented but did not actually work, so what else was not provided ;) -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] A somewhat faster alternative to is_dir and is_file?
Howdy, I've written some, kinda coolish, class that reads directories recursively with some simple calls. Yihaaa, .. (but I'm not the only one who has done that, I guess :P). Anyway, during the process of traversing a directory it checks to see if the something that was found is either a directory or a file, based on that it will do some things. Fine, works. But, now that I've got a directory with about 800 files to read I noticed that it takes the poor script almost two seconds to find the correct type of all the somethings. In fact, I timed it on a steady 1.71. I've tried to use filetype() on the something, but that took even longer - while looping through the directory without any checks finishes in 0.01 seconds. Now, for the question: does anybody know an alternative method on checking whether a something is either file or directory? Wouter (this time, I'm on a Windows XP machine running PHP5 - just tested the same thing on Linux and PHP 4.3.8 and came out on 0.63 secs, ..) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A somewhat faster alternative to is_dir and is_file?
You can try directoryIterator and recursiveDirectoryIterator in php5. I don't know if they are more faster than your solution (it seems to me that these extension are written in php, not in C, but portage to C is in todo list), but they do exactly the same thing than your class. Is it really a good thing to reimplement a builtin solution ? Fred Wouter van Vliet wrote: Howdy, I've written some, kinda coolish, class that reads directories recursively with some simple calls. Yihaaa, .. (but I'm not the only one who has done that, I guess :P). Anyway, during the process of traversing a directory it checks to see if the something that was found is either a directory or a file, based on that it will do some things. Fine, works. But, now that I've got a directory with about 800 files to read I noticed that it takes the poor script almost two seconds to find the correct type of all the somethings. In fact, I timed it on a steady 1.71. I've tried to use filetype() on the something, but that took even longer - while looping through the directory without any checks finishes in 0.01 seconds. Now, for the question: does anybody know an alternative method on checking whether a something is either file or directory? Wouter (this time, I'm on a Windows XP machine running PHP5 - just tested the same thing on Linux and PHP 4.3.8 and came out on 0.63 secs, ..) -- === Frederic HARDYEmail: [EMAIL PROTECTED] HEXANET SARL URL: http://www.hexanet.fr/ ZAC Les CharmillesTel: +33 (0)3 26 79 30 05 3, allée Thierry Sabine Direct: +33 (0)3 26 61 77 84 BP 202 - 51686 REIMS CEDEX 2 FRANCE === -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A somewhat faster alternative to is_dir and is_file?
Wouter van Vliet wrote: Howdy, I've written some, kinda coolish, class that reads directories recursively with some simple calls. Yihaaa, .. (but I'm not the only one who has done that, I guess :P). Anyway, during the process of traversing a directory it checks to see if the something that was found is either a directory or a file, based on that it will do some things. Fine, works. But, now that I've got a directory with about 800 files to read I noticed that it takes the poor script almost two seconds to find the correct type of all the somethings. In fact, I timed it on a steady 1.71. I've tried to use filetype() on the something, but that took even longer - while looping through the directory without any checks finishes in 0.01 seconds. Now, for the question: does anybody know an alternative method on checking whether a something is either file or directory? Wouter (this time, I'm on a Windows XP machine running PHP5 - just tested the same thing on Linux and PHP 4.3.8 and came out on 0.63 secs, ..) Depends on the filesystem. There are not many alternatives in WXP, but FAT should be faster. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] A somewhat faster alternative to is_dir and is_file?
Wouter van Vliet wrote: Howdy, I've written some, kinda coolish, class that reads directories recursively with some simple calls. Yihaaa, .. (but I'm not the only one who has done that, I guess :P). Anyway, during the process of traversing a directory it checks to see if the something that was found is either a directory or a file, based on that it will do some things. Fine, works. Don't lose hair over it. 800 files is quite a lot even to produce a directory listing in the command prompt would probably take as long. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP: Supported OS
Hello there, could anyone tell me if PHP supports these OS? I wasnt able to find anything on the net. LynxOS MVS OS390 QNX VMS Windows CE Xenix Thanks, FireSnake -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with header(Location:home.php)
Hello, In conection.php I have written. SESSION_ START(); on successful login I am registering a session variable. SESSION_REGISTER(userId); on login failure I am redirecting to home page. Header(Location: home.php); the following error occuring in above line. Warning: Cannot modify header information - headers already sent by (output started at E:\PHPMySql scripts\bugtrack\connection.php:3) in E:\PHPMySql scripts\bugtrack\index.php on line 117 the connection file I have included in every page. why this error is occuring? Bharadwaj -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] problem with Header(Location: home.php);
Hello, In conection.php I have written. SESSION_ START(); on successful login I am registering a session variable. SESSION_REGISTER(userId); on login failure I am redirecting to home page. Header(Location: home.php); the following error occuring in above line. Warning: Cannot modify header information - headers already sent by (output started at E:\PHPMySql scripts\bugtrack\connection.php:3) in E:\PHPMySql scripts\bugtrack\index.php on line 117 the connection file I have included in every page. why this error is occuring? Bharadwaj -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with Header(Location: home.php);
the following error occuring in above line. Warning: Cannot modify header information - headers already sent by (output started at E:\PHPMySql scripts\bugtrack\connection.php:3) in E:\PHPMySql scripts\bugtrack\index.php on line 117 Have you got any space before you output anything to the browser? I've found that often I've saved a file with a newline at the end by accident - meaning that PHP thinks I'm ready to start sending output and therefore any functions that modify the headers won't work because they've already been sent. Check connection.php around line 3 to see if there is anything sending output before you call session_* or Header(). BTW, you shouldn't use relative URIs in Location: headers, try using: header('Location: http://www.mydomain.com/path/to/home.php'); instead (this won't fix anything, but it's the correct way to do it according to the HTTP/1.1 standard). Hope this helps, Paul -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with Header(Location: home.php);
On Thursday 12 August 2004 07:48 pm, CBharadwaj wrote: Hello, In conection.php I have written. SESSION_ START(); ^ Get rid of extra space and it should work Hth, Andre on successful login I am registering a session variable. SESSION_REGISTER(userId); on login failure I am redirecting to home page. Header(Location: home.php); the following error occuring in above line. Warning: Cannot modify header information - headers already sent by (output started at E:\PHPMySql scripts\bugtrack\connection.php:3) in E:\PHPMySql scripts\bugtrack\index.php on line 117 the connection file I have included in every page. why this error is occuring? Bharadwaj -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Regular expression help
I'm trying to replace all occurances of the X character in a text with Y, but only those X's that occur between bold tags (b/b). -- Romanian Web Developers - http://ROWD.ORG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PHP: Supported OS
Hi, could anyone tell me if PHP supports these OS? I wasnt able to find anything on the net. LynxOS MVS OS390 QNX VMS Windows CE Xenix Thanks, FireSnake www.php.net You should be able to find builds for Windows and Linux (as far as server...). If you are wondering what browsers on which OSes will display PHP pages, all of them, PHP is server side. -Dan Joseph -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php imap functions problem
Hello NG Please excuse my bad english because I come from austria. I hope you understand me... I have searched in the NG and in internet and don't found an answer to my php problem: When I use the imap functions with php all looks like good but when I will get the body or structure from an email I get an error. my Code looks like this: - $mbox = imap_open( {localhost:143/imap/notls}INBOX , username , password , OP_HALFOPEN ); $structure = imap_fetchstructure($mbox, msgnum ); The Error ( Warning ): -- Warning: imap_fetchstructure(): Bad message number in (...) on line (...) I dont't think that the Message number is really the problem because i tested also other numbers. I hope anybody can help me! Thanks Markus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expression help
From: Skippy [EMAIL PROTECTED] I'm trying to replace all occurances of the X character in a text with Y, but only those X's that occur between bold tags (b/b). ?php $str = 'This X and this X will not be fixed, but bthis X and/b and hopefully this bX/b should be, along b with this X also. /b, but not this X.'; function myreplace($match) { $from = 'X'; $to = 'Y'; return str_replace($from,$to,$match[0]); } $new_str = preg_replace_callback('#b.*/b#Uis','myreplace',$str); echo $new_str; ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php imap functions problem
From: Markus H [EMAIL PROTECTED] $structure = imap_fetchstructure($mbox, msgnum ); Warning: imap_fetchstructure(): Bad message number in (...) on line (...) Is msgnum a constant or do you mean to have $msgnum, i.e. a variable? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why should $_SESSION be slower than other arrays?
From: Aaron Voisine [EMAIL PROTECTED] I read in the docs several comments that $_SESSION is slower that other arrays. One comment even had benchmarking info indicating it was about half as fast. I don't understand why this should be. Isn't $_SESSION just a normal super global array like any other, except that it get serialized and written to disk *once at the end* of a request? Why on earth would this impact the performance of reading and writing in the middle of a request? Is there some funkyness going on under the covers that I'm missing? Can it be made to work as I described? Do you have links to these docs?? The following code gives me this: Normal $val: 9.4890594482422E-05 Session var: 1.1920928955078E-05 ?php function gt() { list($usec, $sec) = explode( , microtime()); return ((float)$usec + (float)$sec); } session_start(); $s1 = gt(); $val['key'] = array('foo'); $e1 = gt(); $s2 = gt(); $_SESSION['key'] = array('foo'); $e2 = gt(); echo 'Normal $val: ' . ($e1 - $s1) . 'br /Session var: ' . ($e2-$s2); ? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] php imap functions problem
John Holmes wrote: From: Markus H [EMAIL PROTECTED] $structure = imap_fetchstructure($mbox, msgnum ); Warning: imap_fetchstructure(): Bad message number in (...) on line (...) Is msgnum a constant or do you mean to have $msgnum, i.e. a variable? ---John Holmes... Yes, I mean thats msgnum is a Variable . I forgott the $ ... It is dynamically inserted from the header list. Because i'd like to write an webmail system. The Folderlist and the Header listing are working but only the displying of the real E-Mail don't works. I have found in Internet that there could be a problem with an c-client or an file called php_imap.c but I don't undestand this. Markus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] preg_replace_callback clarification
The piece of code you have submitted (see under) is interesting, although there is one thing I don't find meaning to, even after RTFM, and STFG(Searching The Funky Google). In your regular expression pattern '#b.*/b#Uis', what does this do : #...#Uis Thank you very much Piece of code : [snip] ?php $str = 'This X and this X will not be fixed, but bthis X and/b and hopefully this bX/b should be, along b with this X also. /b, but not this X.'; function myreplace($match) { $from = 'X'; $to = 'Y'; return str_replace($from,$to,$match[0]); } $new_str = preg_replace_callback('#b.*/b#Uis','myreplace',$str); echo $new_str; ? [/snip] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why should $_SESSION be slower than other arrays?
John Holmes wrote: From: Aaron Voisine [EMAIL PROTECTED] I read in the docs several comments that $_SESSION is slower that other arrays. One comment even had benchmarking info indicating it was about half as fast. I don't understand why this should be. Isn't $_SESSION just a normal super global array like any other, except that it get serialized and written to disk *once at the end* of a request? Why on earth would this impact the performance of reading and writing in the middle of a request? Is there some funkyness going on under the covers that I'm missing? Can it be made to work as I described? Do you have links to these docs?? The following code gives me this: Normal $val: 9.4890594482422E-05 Session var: 1.1920928955078E-05 The key here is the 'to the power of -05' bit. -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace_callback clarification
From: François Moreau [EMAIL PROTECTED] The piece of code you have submitted (see under) is interesting, although there is one thing I don't find meaning to, even after RTFM, and STFG(Searching The Funky Google). In your regular expression pattern '#b.*/b#Uis', what does this do : #...#Uis [snip] $new_str = preg_replace_callback('#b.*/b#Uis','myreplace',$str); The # characters simply start and end the pattern. You can use any character for that, really. I normally use /, but since it's present in the pattern /b and I didn't want to escape it, I used the # character. The characters after the pattern delimiters are called pattern modifiers. They are explained here (http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php), but for the afraid-to-clicky-people: U - ungreedy (makes sure the .* in the pattern doesn't match too much) i - case-insensitive matching (in case you use B and /B) s - makes the dot character match newlines as well, otherwise text between bold tags that included newlines wouldn't be matches. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why should $_SESSION be slower than other arrays?
From: raditha dissanayake [EMAIL PROTECTED] The following code gives me this: Normal $val: 9.4890594482422E-05 Session var: 1.1920928955078E-05 The key here is the 'to the power of -05' bit. Yeah? 0.948 0.112 Which one is larger? ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace_callback clarification
Thank you very much for your quick answer! Le 04-09-09, à 10:10, John Holmes a écrit : From: François Moreau [EMAIL PROTECTED] The piece of code you have submitted (see under) is interesting, although there is one thing I don't find meaning to, even after RTFM, and STFG(Searching The Funky Google). In your regular expression pattern '#b.*/b#Uis', what does this do : #...#Uis [snip] $new_str = preg_replace_callback('#b.*/b#Uis','myreplace',$str); The # characters simply start and end the pattern. You can use any character for that, really. I normally use /, but since it's present in the pattern /b and I didn't want to escape it, I used the # character. The characters after the pattern delimiters are called pattern modifiers. They are explained here (http://www.php.net/manual/en/reference.pcre.pattern.modifiers.php), but for the afraid-to-clicky-people: U - ungreedy (makes sure the .* in the pattern doesn't match too much) i - case-insensitive matching (in case you use B and /B) s - makes the dot character match newlines as well, otherwise text between bold tags that included newlines wouldn't be matches. ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with header(Location:home.php)
the connection file I have included in every page. why this error is occuring? check E:\PHPMySql scripts\bugtrack\connection.php for white space before or after ?php ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why should $_SESSION be slower than other arrays?
John Holmes wrote: From: Aaron Voisine [EMAIL PROTECTED] I read in the docs several comments that $_SESSION is slower that other arrays. One comment even had benchmarking info indicating it was about half as fast. I don't understand why this should be. Isn't $_SESSION just a normal super global array like any other, except that it get serialized and written to disk *once at the end* of a request? Why on earth would this impact the performance of reading and writing in the middle of a request? Is there some funkyness going on under the covers that I'm missing? Can it be made to work as I described? Do you have links to these docs?? The following code gives me this: Normal $val: 9.4890594482422E-05 Session var: 1.1920928955078E-05 ?php function gt() { list($usec, $sec) = explode( , microtime()); return ((float)$usec + (float)$sec); } session_start(); $s1 = gt(); $val['key'] = array('foo'); $e1 = gt(); $s2 = gt(); $_SESSION['key'] = array('foo'); $e2 = gt(); echo 'Normal $val: ' . ($e1 - $s1) . 'br /Session var: ' . ($e2-$s2); ? Sligtly modified code, $_SESSION is almost always faster then regular variable. I even tried testing $_SESSION first, then $val, same result. Now why is it so? ?php function gt() { list($usec, $sec) = explode( , microtime()); return ((float)$usec + (float)$sec); } session_start(); $val = array(); $s1 = gt(); for($i = 0; $i 5; $i++) { $val['key' . $i] = array('foo'); } $e1 = gt(); $s2 = gt(); for($i = 0; $i 5; $i++) { $_SESSION['key' . $i] = array('foo'); } $e2 = gt(); echo 'Normal $val: ' . ($e1 - $s1) . 'br /Session var: ' . ($e2-$s2); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why should $_SESSION be slower than other arrays?
John Holmes wrote: From: raditha dissanayake [EMAIL PROTECTED] The following code gives me this: Normal $val: 9.4890594482422E-05 Session var: 1.1920928955078E-05 The key here is the 'to the power of -05' bit. Yeah? 0.948 0.112 Which one is larger? The answer is that for such small measurements you cannot say for certain. ---John Holmes... -- Raditha Dissanayake. http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader Graphical User Inteface. Just 128 KB | with progress bar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Regular expression help
Quoting John Holmes [EMAIL PROTECTED]: From: Skippy [EMAIL PROTECTED] I'm trying to replace all occurances of the X character in a text with Y, but only those X's that occur between bold tags (b/b). ?php $str = 'This X and this X will not be fixed, but bthis X and/b and hopefully this bX/b should be, along b with this X also. /b, but not this X.'; function myreplace($match) { $from = 'X'; $to = 'Y'; return str_replace($from,$to,$match[0]); } $new_str = preg_replace_callback('#b.*/b#Uis','myreplace',$str); echo $new_str; ? It works great, thank you. I had tried something on my own previously, but without the ungreedy modifier and with replacements inside a repeated while{} cycle instead of a callback. The main drawback in my version was that an X near hopefully would have been replaced as well (since technically it is between b and /b). But that wasn't what I wanted, of course. -- Romanian Web Developers - http://ROWD.ORG -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why should $_SESSION be slower than other arrays?
On Thu, 2004-09-09 at 10:57, raditha dissanayake wrote: John Holmes wrote: From: raditha dissanayake [EMAIL PROTECTED] The following code gives me this: Normal $val: 9.4890594482422E-05 Session var: 1.1920928955078E-05 The key here is the 'to the power of -05' bit. Yeah? 0.948 0.112 Which one is larger? The answer is that for such small measurements you cannot say for certain. But you could if you ran the test a billion times and took the average. Rob. -- .. | InterJinn Application Framework - http://www.interjinn.com | :: | An application and templating framework for PHP. Boasting | | a powerful, scalable system for accessing system services | | such as forms, properties, sessions, and caches. InterJinn | | also provides an extremely flexible architecture for | | creating re-usable components quickly and easily. | `' -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why should $_SESSION be slower than other arrays?
Chris Dowell wrote: Entirely off the top of my head, I would imagine it has to do with the scope of the variables in question. When assigning a value to a variable, there must be some time spent resolving the scope in which that variable is valid, to see if the new value overwrites any existing value and to ensure that it is accessible from the correct places. As a superglobal, however, $_SESSION has a very specific and unchanging scope. If I were Zeev or Andi, I'd have added a little optimisation into ZE to check for trivial cases such as this and shortcut the tedious scoping. I could be wrong, but this seems to be the most obvious explanation. Has anyone tried this with any other superglobals like $_POST or $_SERVER? Just tried it, $_SESSION is certainly faster then $_POST, $_GET and $_SERVER: Session var: 0.380021095276 GET var: 0.50522685051 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php lists
wang dang wrote: Hey John, I just read your post in the php mailing list regarding rsync + ssh and rdbms. I wish you would keep your stupid remarks to yourself. I try and read each and every post to help people. And post like yours waste more time than the OT posts. In other words if you don't have anything useful to say Shut The Fuck Up!! By the way I won't get a response from you because I only accept mail from people if there email address is in my contacts folder. And you are definitely not in there. Well then, I'll just make sure you get my reply. Funny, you claim to try and help people, but there is not one post to this list with the Hotmail account you are using. H...could you be trying to hide who you really are? Typical Internet tough guy. I wonder who you could really bewho on this list has access to the University of Kansas' computer center? I am sending this off list because I do not want to waste everyones time on the list! Get the point DUMB-ASS! See, I want to 'waste' their time so that they can see what a stand-up guy you are. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Tidy installation problem in php 4.3.8
Lizet Peña de Sola wrote: Hi all, I need to use tidy for cleaning up html in my project, our hosting company has php 4.3.8, so we need to install tidy and make the installation again. After several times, the configure and make commands replied no error, however, the phpinfo() doesn't show the package as installed and when we run the function ini_set() to set the tidy constants in the php.ini file, it returns nothing, also any call to the tidy library functions gives error...any ideas of why this isn't working? After a succesfull installation, is there any enviroment constant we can check or should set? Thanks a lot in advance, Lizet Do you mean you installed tidy php module on your hosting company server? Then you need to load the module using dl(): if (!extension_loaded('tidy')) { if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { dl('/path/to/php_tidy.dll'); } else { dl('/path/to/tidy.so'); } } Loading extensions might be disalowed by your hosting company. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with header(Location:home.php)
look the line 3 of connection.php Good luck On Wed, 8 Sep 2004 16:43:54 -0700, CBharadwaj [EMAIL PROTECTED] wrote: Hello, In conection.php I have written. SESSION_ START(); on successful login I am registering a session variable. SESSION_REGISTER(userId); on login failure I am redirecting to home page. Header(Location: home.php); the following error occuring in above line. Warning: Cannot modify header information - headers already sent by (output started at E:\PHPMySql scripts\bugtrack\connection.php:3) in E:\PHPMySql scripts\bugtrack\index.php on line 117 the connection file I have included in every page. why this error is occuring? Bharadwaj -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Pablo M. Rivas. http://pmrivas.ipupdater.com --- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] why should $_SESSION be slower than other arrays?
In any case, it would appear the comments in the session section of the online docs are wrong or just out of date, and I don't need to worry about it. I'll go ahead and add a comment to that effect on the ref.session page. l8r Aaron --- Marek Kilimajer [EMAIL PROTECTED] wrote: Chris Dowell wrote: Entirely off the top of my head, I would imagine it has to do with the scope of the variables in question. When assigning a value to a variable, there must be some time spent resolving the scope in which that variable is valid, to see if the new value overwrites any existing value and to ensure that it is accessible from the correct places. As a superglobal, however, $_SESSION has a very specific and unchanging scope. If I were Zeev or Andi, I'd have added a little optimisation into ZE to check for trivial cases such as this and shortcut the tedious scoping. I could be wrong, but this seems to be the most obvious explanation. Has anyone tried this with any other superglobals like $_POST or $_SERVER? Just tried it, $_SESSION is certainly faster then $_POST, $_GET and $_SERVER: Session var: 0.380021095276 GET var: 0.50522685051 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ Do you Yahoo!? Yahoo! Mail Address AutoComplete - You start. We finish. http://promotions.yahoo.com/new_mail -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Tidy installation problem in php 4.3.8
Hello Marek, thanks for your reply. It was the hosting company support and I the ones installing, yes they have they have the loading extensions disabled. However in the package I downloaded from http://pecl.php.net/package/tidy/1.1 there's no .dll file in it... Lemme try that script and I'll let you know, thanks Lizet -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Thursday, September 09, 2004 12:42 PM To: Lizet Peña de Sola Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Tidy installation problem in php 4.3.8 Do you mean you installed tidy php module on your hosting company server? Then you need to load the module using dl(): if (!extension_loaded('tidy')) { if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { dl('/path/to/php_tidy.dll'); } else { dl('/path/to/tidy.so'); } } Loading extensions might be disalowed by your hosting company. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: php lists
* * Do not Cc: me, because I am on THIS list, if I write here * * Keine Cc: am mich senden, bin auf DIESER Liste wenn ich hier schreibe * * Hello John, Am 2004-09-09 12:03:01, schrieb John Nichel: wang dang wrote: Hey John, I just read your post in the php mailing list regarding rsync Well then, I'll just make sure you get my reply. Funny, you claim to try and help people, but there is not one post to this list with the Hotmail account you are using. H...could you be trying to hide who you really are? Typical Internet tough guy. I wonder who you could really bewho on this list has access to the University of Kansas' computer center? I am sending this off list because I do not want to waste everyones time ^^ on the list! Get the point DUMB-ASS! See, I want to 'waste' their time so that they can see what a stand-up guy you are. Are you happy now ? Wang Dang had writen you personaly and I am not interested in YOU private conversation. Please keep it OFF-LIST !!! Greetings Michelle -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSM LinuxMichi 0033/3/8845235667100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
Re: [PHP] Tidy installation problem in php 4.3.8
Lizet Peña de Sola wrote: Hello Marek, thanks for your reply. It was the hosting company support and I the ones installing, yes they have they have the loading extensions disabled. However in the package I downloaded from http://pecl.php.net/package/tidy/1.1 there's no .dll file in it... Lemme try that script and I'll let you know, thanks Lizet .dll files are only for windows. do you want to install the extension at the root level (available to all users) or at the user level? At the root level you need line: extension=tidy.so or extension=php_tidy.dll depending on your platform. Also make sure that the extension is in extension_dir (check php.ini). Then restart the webserver. -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Thursday, September 09, 2004 12:42 PM To: Lizet Peña de Sola Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Tidy installation problem in php 4.3.8 Do you mean you installed tidy php module on your hosting company server? Then you need to load the module using dl(): if (!extension_loaded('tidy')) { if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { dl('/path/to/php_tidy.dll'); } else { dl('/path/to/tidy.so'); } } Loading extensions might be disalowed by your hosting company. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timing on an internal email
Not necessarily outside of php, but outside of webserver. You need to setup a cron job that will execute the phpmailer script. Gotcha.., My webserver is a windows box, so I can just run a task schedule and give it; php.exe myfile.php and that should do it? Would it be more efficient as a command line task or as an instance of the browser? You can use a windows version of cron, find it here: http://www.kalab.com/freeware/cron/cron.htm Or, if you don't want to or can't install it - you can ask somebody with a linux server/machine to setup a cron script that does a request to a webpage that should send the emails. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Tidy installation problem in php 4.3.8
Hello Marek, our webserver is a Unix one, and yes we want to make the extension available for all users. Please explain where I need to put the line extension=tidy.so, in the php.ini file? I checked that the tidy folder is in the extensions folder... Thanks in advance, lizet At the root level you need line: extension=tidy.so depending on your platform. Also make sure that the extension is in extension_dir (check php.ini). Then restart the webserver. -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Thursday, September 09, 2004 12:42 PM To: Lizet Peña de Sola Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Tidy installation problem in php 4.3.8 Do you mean you installed tidy php module on your hosting company server? Then you need to load the module using dl(): if (!extension_loaded('tidy')) { if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { dl('/path/to/php_tidy.dll'); } else { dl('/path/to/tidy.so'); } } Loading extensions might be disalowed by your hosting company. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
FW: [PHP] Tidy installation problem in php 4.3.8
Another reply... lizet -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Thursday, September 09, 2004 1:12 PM To: Lizet Peña de Sola Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Tidy installation problem in php 4.3.8 Lizet Peña de Sola wrote: Hello Marek, thanks for your reply. It was the hosting company support and I the ones installing, yes they have they have the loading extensions disabled. However in the package I downloaded from http://pecl.php.net/package/tidy/1.1 there's no .dll file in it... Lemme try that script and I'll let you know, thanks Lizet .dll files are only for windows. do you want to install the extension at the root level (available to all users) or at the user level? At the root level you need line: extension=tidy.so or extension=php_tidy.dll depending on your platform. Also make sure that the extension is in extension_dir (check php.ini). Then restart the webserver. -Original Message- From: Marek Kilimajer [mailto:[EMAIL PROTECTED] Sent: Thursday, September 09, 2004 12:42 PM To: Lizet Peña de Sola Cc: [EMAIL PROTECTED] Subject: Re: [PHP] Tidy installation problem in php 4.3.8 Do you mean you installed tidy php module on your hosting company server? Then you need to load the module using dl(): if (!extension_loaded('tidy')) { if (strtoupper(substr(PHP_OS, 0, 3) == 'WIN')) { dl('/path/to/php_tidy.dll'); } else { dl('/path/to/tidy.so'); } } Loading extensions might be disalowed by your hosting company. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Remove punctuation
Hi all! I am creating a function that will remove punctuation from a string, however, I am wondering if PHP has a function somewhere that will do the same. Right now my approach is to cycle through an array of punctuation and remove the items. Anything already exist? Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Remove punctuation
http://ca3.php.net/manual/en/function.str-replace.php if you have the array of puncuation already, i think that is your solution. Jason Jed R. Brubaker [EMAIL PROTECTED] wrote: Hi all! I am creating a function that will remove punctuation from a string, however, I am wondering if PHP has a function somewhere that will do the same. Right now my approach is to cycle through an array of punctuation and remove the items. Anything already exist? Thanks! -- 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
RE: [PHP] Remove punctuation
[snip] I am creating a function that will remove punctuation from a string, however, I am wondering if PHP has a function somewhere that will do the same. Right now my approach is to cycle through an array of punctuation and remove the items. Anything already exist? [/snip] Have you looked at regular expressions? http://us4.php.net/regex -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Remove punctuation
Jed R. Brubaker wrote: Hi all! I am creating a function that will remove punctuation from a string, however, I am wondering if PHP has a function somewhere that will do the same. Right now my approach is to cycle through an array of punctuation and remove the items. Anything already exist? Thanks! You don't have to cycle through an array... preg_replace ( /[\.,\;'\:]/, , $string ) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php_printer
Anybody got php_printer running? If I give printer_open an invalid printer name, error. Give it a valid (shared) printer name, not error, but using the $handle in printer_set_option gives an 'invalid printer handle error' What do I need to do next to check this out? -- Lester Caine - L.S.Caine Electronic Services -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Remove punctuation
i think str_replace is faster that ereg_replace Jason John Nichel [EMAIL PROTECTED] wrote: Jed R. Brubaker wrote: Hi all! I am creating a function that will remove punctuation from a string, however, I am wondering if PHP has a function somewhere that will do the same. Right now my approach is to cycle through an array of punctuation and remove the items. Anything already exist? Thanks! You don't have to cycle through an array... preg_replace ( /[\.,\;'\:]/, , $string ) -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- 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
Re: [PHP] Remove punctuation
Jason Davidson wrote: i think str_replace is faster that ereg_replace Jason We tested that theory a while back on here (I don't remember the subject of the emails, so finding it would be kind of hard), and it came out to be almost exactally the same speed. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] My problem with the code
Hi All, I have a problem...with my code ,can any one please guide or correct me. [BLUE] My main aim is to develop a php(or php in html) ,in which Login is there ,after appropriate login ,User must get the Option of selecting available databases ,Upon selecting databases,user must get to select the appropriate tabl from Selected database, Can I have that code. Please do the needful. [BLUE] Please find the questions in blue format authenticate.php (should be login.php no probs but) ?php include(phpscripts/draw_table.php); $hostname=xxx; $usrname=$_POST['username']; $usrname=root; $pswd=$_POST['password']; $db_selected; $db_list; $row; $dbconnlink=mysql_connect($hostname,$usrname,$pswd); if($dbconnlink) { echo h4bConnected to the MYSQL Server : $hostname /bh4br; $db_list = mysql_list_dbs($dbconnlink); echo h4The Databases available in $hostname are :/h4; while ($GLOBALS[row] = mysql_fetch_object($db_list)) { // echo $row-Database . \n; echo form METHOD=\POST\ action=?php show_table($row-Database); ?p input type=\radio\ name=\Database_Selection\ value=\$row\ $row-Database /p [BLUE] I am listing the available databases here present in the mysql server 'xxx' I want the user to select the database available ,upon the submit of selection of database,User must be able to see the available tables in that selected database Again in the same format of Radio Options to select the table,He must be able to select the table,Upon selecting particular available table,he must be able to see the Values in it. [BLUE] br ; echo Testing; $selectcat=$row[category]; echo option value=\$selectcat\$selectcat/option br; //To List all the Databases present in $hostname } echoBRINPUT TYPE=\reset\ VALUE=\Clear\ INPUT TYPE=\submit\ VALUE=\Select\ ; [BLUE]Can I have here to put the value as dynamic database.[/BLUE] mysql_free_result($row); } else { echo bError : .mysql_error()./bbr.b pre Go Back and type the Exact User ID and Password Which mySQL Admininistrator Gave You, if not available,Please contact a href = \[EMAIL PROTECTED] [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] /pre script language=\javascript\ javascript.alert(\Go Back and type the Login Information Correctly\); /script br /b; } function show_table() { $tableselected=''; $tableselected= $_POST[$row-Database]; } ? Thanks, Nikhil.
[PHP] stdin buffering
I'm currently working on some stuff with php-cli and got a few problem. I want to be able to read one single character from stdin via keyboard, ie. pressing a button. It works fine if I use enter as newline afterwards, but I would like to do it without pressing enter. Thus, I have to turn off buffering in the input stream but I can't find any way to do it. Been looking everywhere on php.net but can't find any hints. // Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Remove punctuation
John Nichel wrote: Jason Davidson wrote: i think str_replace is faster that ereg_replace Jason We tested that theory a while back on here (I don't remember the subject of the emails, so finding it would be kind of hard), and it came out to be almost exactally the same speed. Around 1/10th of a second difference in 100,000 replaces ?php function getmicrotime() { list( $usec, $sec ) = explode( , microtime() ); return ( ( float ) $usec + ( float ) $sec ); } $string = Foo is a common term used in programming.; $start = getmicrotime(); for ( $i = 0; $i 10; $i++ ) { preg_replace ( /Foo/, Bar, $string ); } $stop = getmicrotime(); $preg = $stop - $start; $start = getmicrotime(); for ( $i = 0; $i 10; $i++ ) { str_replace ( Foo, Bar, $string ); } $stop = getmicrotime(); $strreplace = $stop - $start; echo ( PREG : . $preg . br /\nSTR_ : . $strreplace ); ? -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Workflow Suite
Does anyone know if a workflow suite/engine written in PHP exists? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Remove punctuation
From: John Nichel [EMAIL PROTECTED] i think str_replace is faster that ereg_replace We tested that theory a while back on here (I don't remember the subject of the emails, so finding it would be kind of hard), and it came out to be almost exactally the same speed. Not that speed tests like this really matter in the long run of your code, but: str_replace: 0.26480603218079 ereg_replace: 0.61685109138489 preg_replace came in at about 0.4, btw ---John Holmes... Code: ?php function gt() { list($usec, $sec) = explode( , microtime()); return ((float)$usec + (float)$sec); } $str = 'It\'s, all! ok? asd? asdf! and wosz'; $s1 = gt(); for($i = 0; $i 5; $i++) { str_replace(array('.',',','!','?','','\''),'',$str); } $e1 = gt(); $s2 = gt(); for($i = 0; $i 5; $i++) { ereg_replace([.,!?\'],'',$str); } $e2 = gt(); echo 'str_replace: ' . ($e1 - $s1) . 'br /ereg_replace: ' . ($e2-$s2); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] problem with header(Location:home.php)
Warning: Cannot modify header information - headers already sent by (output started at E:\PHPMySql scripts\bugtrack\connection.php:3) in E:\PHPMySql scripts\bugtrack\index.php on line 117 the connection file I have included in every page. why this error is occuring? You are getting this error because you have header output starting at line 3 in file connection.php. The warning is stating that the function, 'header(location: home.php);' cannot fire because you have started outputing header information. Your header() call is on line 117 of index.php. Header() can only be used if there has been no header information sent to the page. You will need to see what is on line 3 and probably line 2 of connection.php. alex hogan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Remove punctuation
John Holmes wrote: From: John Nichel [EMAIL PROTECTED] i think str_replace is faster that ereg_replace We tested that theory a while back on here (I don't remember the subject of the emails, so finding it would be kind of hard), and it came out to be almost exactally the same speed. Not that speed tests like this really matter in the long run of your code, but: str_replace: 0.26480603218079 ereg_replace: 0.61685109138489 preg_replace came in at about 0.4, btw Yeah...less than 1/2 a second between str and ereg in your tests for 50,000 runs, works out to what? 1/500,000 of a second per single instance? Not worth losing sleep over...whatever yer comfortable with I say. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stdin buffering
Martin Holm wrote: I'm currently working on some stuff with php-cli and got a few problem. I want to be able to read one single character from stdin via keyboard, ie. pressing a button. It works fine if I use enter as newline afterwards, but I would like to do it without pressing enter. Thus, I have to turn off buffering in the input stream but I can't find any way to do it. Been looking everywhere on php.net but can't find any hints. http://www.php.net/ncurses -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stdin buffering
On Thu, 2004-09-09 at 14:10, Martin Holm wrote: I'm currently working on some stuff with php-cli and got a few problem. I want to be able to read one single character from stdin via keyboard, ie. pressing a button. It works fine if I use enter as newline afterwards, but I would like to do it without pressing enter. Thus, I have to turn off buffering in the input stream but I can't find any way to do it. Been looking everywhere on php.net but can't find any hints. I have never been able to find a way to disable STDIN buffering in PHP. You may find ncurses_getch() of use however. http://www.php.net/ncurses_getch -- Greg Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Remove punctuation
From: John Nichel [EMAIL PROTECTED] Not worth losing sleep over...whatever yer comfortable with I say. I agree... people love stats like that, though. :) ---John Holmes.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Remove punctuation
ya, no doubt, i was going to repost my message, i should have said, that manual suggests using str_replace over ereg_replace... without reason.. i just assumed it was speed and resources.. eitherway, both would work, try em both. :) Jason John Nichel [EMAIL PROTECTED] wrote: Jason Davidson wrote: i think str_replace is faster that ereg_replace Jason We tested that theory a while back on here (I don't remember the subject of the emails, so finding it would be kind of hard), and it came out to be almost exactally the same speed. -- John C. Nichel ÜberGeek KegWorks.com 716.856.9675 [EMAIL PROTECTED] -- 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
Re: [PHP] stdin buffering
On Thu, 2004-09-09 at 14:10, Martin Holm wrote: I'm currently working on some stuff with php-cli and got a few problem. I want to be able to read one single character from stdin via keyboard, ie. pressing a button. It works fine if I use enter as newline afterwards, but I would like to do it without pressing enter. Thus, I have to turn off buffering in the input stream but I can't find any way to do it. Been looking everywhere on php.net but can't find any hints. I have never been able to find a way to disable STDIN buffering in PHP. You may find ncurses_getch() of use however. http://www.php.net/ncurses_getch -- Greg Donald I'm not sure how great this solution is but here it is anyway: exec(stty -icanon min 0 time 0); The -icanon turns of canonical reading of stdin. The min has to do with the minimum characters needed for a read to be complete while time sets the read timeout (0 means no timeout and no minimum characters). You can also turn off echo if you don't need the user to see what they type: exec(stty -icanon -echo min 0 time 0); If you do this and run your script it will affect your terminal. If you happen to turn echo off just hit Ctrl c (to clear any invisible commands) and type (blindly) stty echo to turn it back on. To see the current terminal options do stty or stty -a to see everything. man stty is just as much fun. :-) Good luck, Jim Grill -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Assigning one var to multiple vars
Just mostly curious but is there a way to assign one variable to multiple variables in one single line? Rather than do this: $var2 = $var1; $var3 = $var1; Is there a method to perform a: ($var2,$var3) = $var1; -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] crap-ass DOM xsd schema validation?
Hello, To put it bluntly, has anyone here been able to get the PHP5 DOM extension to validate using an xsd schema worth a rat's ass? I'm finding that it doesn't enforce required attributes, dies on any global complex types, has uninformative validation warnings, and basically sucks. Any comments from the core devs on how likely this is to change dramatically for the better would be helpful. I literally will have absolutely no reason to use DOM at all if this feature isn't improved, as it seems to be a lot slower and much less stable than using a sax parser. Greg -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Remove punctuation
* Thus wrote John Holmes: From: John Nichel [EMAIL PROTECTED] i think str_replace is faster that ereg_replace We tested that theory a while back on here (I don't remember the subject of the emails, so finding it would be kind of hard), and it came out to be almost exactally the same speed. Not that speed tests like this really matter in the long run of your code, but: str_replace: 0.26480603218079 ereg_replace: 0.61685109138489 preg_replace came in at about 0.4, btw I betya strtr() will win over them all :) Also, results will vary greatly with a string like: $str = ; str_replace will fall down closer to preg. str_replace(array('.',',','!','?','','\''),'',$str); Curt -- The above comments may offend you. flame at will. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Assigning one var to multiple vars
From: Matthew Sims [EMAIL PROTECTED] Just mostly curious but is there a way to assign one variable to multiple variables in one single line? $a = $b = $c = $d = 1; ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Assigning one var to multiple vars
$var2 = $var3 = $var5 = all the same; Jason Matthew Sims [EMAIL PROTECTED] wrote: Just mostly curious but is there a way to assign one variable to multiple variables in one single line? Rather than do this: $var2 = $var1; $var3 = $var1; Is there a method to perform a: ($var2,$var3) = $var1; -- --Matthew Sims --http://killermookie.org -- 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
Re: [PHP] Assigning one var to multiple vars
Matthew Sims wrote: Just mostly curious but is there a way to assign one variable to multiple variables in one single line? Rather than do this: $var2 = $var1; $var3 = $var1; Is there a method to perform a: ($var2,$var3) = $var1; $var1 = $var2 = $var3 = 'some_value'; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Assigning one var to multiple vars
On Friday 10 September 2004 04:38, Matthew Sims wrote: Just mostly curious but is there a way to assign one variable to multiple variables in one single line? Rather than do this: $var2 = $var1; $var3 = $var1; Is there a method to perform a: ($var2,$var3) = $var1; manual Expressions -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Nothing astonishes men so much as common sense and plain dealing. -- Ralph Waldo Emerson */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] stdin buffering
On Thu, 2004-09-09 at 15:25, Jim Grill wrote: exec(stty -icanon min 0 time 0); Nice. I suspect 'phpSnake' will appear on freshmeat in a couple days. :) -- Greg Donald -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Assigning one var to multiple vars
How about: ? $var1 = $var2 = $var3 = 5; echo $var1 . 'br/' . $var2 . 'br/' . $var3 . 'br/'; ? Regards, Justin -Original Message- From: Matthew Sims [mailto:[EMAIL PROTECTED] Sent: Thursday, September 09, 2004 1:39 PM To: [EMAIL PROTECTED] Subject: [PHP] Assigning one var to multiple vars Just mostly curious but is there a way to assign one variable to multiple variables in one single line? Rather than do this: $var2 = $var1; $var3 = $var1; Is there a method to perform a: ($var2,$var3) = $var1; -- --Matthew Sims --http://killermookie.org -- 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] Problem with the code
Hi All, I have a problem...with my code ,can any one please guide or correct me. [BLUE] My main aim is to develop a php(or php in html) ,in which Login is there ,after appropriate login ,User must get the Option of selecting available databases ,Upon selecting databases,user must get to select the appropriate tabl from Selected database, Can I have that code. Please do the needful. [BLUE] Please find the questions in blue format authenticate.php (should be login.php no probs but) ?php include(phpscripts/draw_table.php); $hostname=xxx; $usrname=$_POST['username']; $usrname=root; $pswd=$_POST['password']; $db_selected; $db_list; $row; $dbconnlink=mysql_connect($hostname,$usrname,$pswd); if($dbconnlink) { echo h4bConnected to the MYSQL Server : $hostname /bh4br; $db_list = mysql_list_dbs($dbconnlink); echo h4The Databases available in $hostname are :/h4; while ($GLOBALS[row] = mysql_fetch_object($db_list)) { // echo $row-Database . \n; echo form METHOD=\POST\ action=?php show_table($row-Database); ?p input type=\radio\ name=\Database_Selection\ value=\$row\ $row-Database /p [BLUE] I am listing the available databases here present in the mysql server 'xxx' I want the user to select the database available ,upon the submit of selection of database,User must be able to see the available tables in that selected database Again in the same format of Radio Options to select the table,He must be able to select the table,Upon selecting particular available table,he must be able to see the Values in it. [BLUE] br ; echo Testing; $selectcat=$row[category]; echo option value=\$selectcat\$selectcat/option br; //To List all the Databases present in $hostname } echoBRINPUT TYPE=\reset\ VALUE=\Clear\ INPUT TYPE=\submit\ VALUE=\Select\ ; [BLUE]Can I have here to put the value as dynamic database.[/BLUE] mysql_free_result($row); } else { echo bError : .mysql_error()./bbr.b pre Go Back and type the Exact User ID and Password Which mySQL Admininistrator Gave You, if not available,Please contact a href = \[EMAIL PROTECTED] [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] /pre script language=\javascript\ javascript.alert(\Go Back and type the Login Information Correctly\); /script br /b; } function show_table() { $tableselected=''; $tableselected= $_POST[$row-Database]; } ? Thanks, Nikhil.
[PHP] Problem with the code
Hi All, I have a problem...with my code ,can any one please guide or correct me. [BLUE] My main aim is to develop a php(or php in html) ,in which Login is there ,after appropriate login ,User must get the Option of selecting available databases ,Upon selecting databases,user must get to select the appropriate tabl from Selected database, Can I have that code. Please do the needful. [BLUE] Please find the questions in blue format authenticate.php (should be login.php no probs but) ?php include(phpscripts/draw_table.php); $hostname=xxx; $usrname=$_POST['username']; $usrname=root; $pswd=$_POST['password']; $db_selected; $db_list; $row; $dbconnlink=mysql_connect($hostname,$usrname,$pswd); if($dbconnlink) { echo h4bConnected to the MYSQL Server : $hostname /bh4br; $db_list = mysql_list_dbs($dbconnlink); echo h4The Databases available in $hostname are :/h4; while ($GLOBALS[row] = mysql_fetch_object($db_list)) { // echo $row-Database . \n; echo form METHOD=\POST\ action=?php show_table($row-Database); ?p input type=\radio\ name=\Database_Selection\ value=\$row\ $row-Database /p [BLUE] I am listing the available databases here present in the mysql server 'xxx' I want the user to select the database available ,upon the submit of selection of database,User must be able to see the available tables in that selected database Again in the same format of Radio Options to select the table,He must be able to select the table,Upon selecting particular available table,he must be able to see the Values in it. [BLUE] br ; echo Testing; $selectcat=$row[category]; echo option value=\$selectcat\$selectcat/option br; //To List all the Databases present in $hostname } echoBRINPUT TYPE=\reset\ VALUE=\Clear\ INPUT TYPE=\submit\ VALUE=\Select\ ; [BLUE]Can I have here to put the value as dynamic database.[/BLUE] mysql_free_result($row); } else { echo bError : .mysql_error()./bbr.b pre Go Back and type the Exact User ID and Password Which mySQL Admininistrator Gave You, if not available,Please contact a href = \[EMAIL PROTECTED] [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] /pre script language=\javascript\ javascript.alert(\Go Back and type the Login Information Correctly\); /script br /b; } function show_table() { $tableselected=''; $tableselected= $_POST[$row-Database]; } ? Thanks, Nikhil.
RE: [PHP] Users of RDBMS
You can create user from mysql prompt by connecting it through first cmdmysql -h host -u userid -p instance password : ** then type GRANT ALL PRIVILGES ON *.* TO 'newuser'@'host' IDENTIFIED BY 'password' with GRANT OPTION; where newuser is new users id and host may be either localhost or any other host,if you want to add that user to connect from any host then replace 'host' with '%' with single quotes. and password is new users password. Regards Nikhil -Original Message- From: Victor Saldaña D. [mailto:[EMAIL PROTECTED] Sent: Thursday, September 09, 2004 1:03 AM To: [EMAIL PROTECTED] Subject: Re: [PHP] Users of RDBMS On Wed, 8 Sep 2004 12:01:55 -0700 (PDT), Pahlevanzadeh Mohsen [EMAIL PROTECTED] wrote: Dears, I need to create user for MySQL. Please guide me.. Please RTFM http://dev.mysql.com/doc/mysql/en/Adding_users.html -- Victor Saldaña D. -- 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
RE: [PHP] Assigning one var to multiple vars
How about: ? $var1 = $var2 = $var3 = 5; echo $var1 . 'br/' . $var2 . 'br/' . $var3 . 'br/'; ? Regards, Justin I had something stuck in my head between what Python does and PHP's list function. Not sure why I couldn't figure this one out. Thanks all. -- --Matthew Sims --http://killermookie.org -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] image size?
Is there a way to get the size of an image created using the imagecreate function? The PHP manual section on image functions mentions getimagesize, but that only works on remote or local files. Thanks, Ed
[PHP] preg_replace question
Hi Sorry for issuing this again, but I need help with preg_replace. I manage to replace certain text between b/b in text with preg_replace but I want for every other b/b to be replaced by other text. By this I mean when some text between b/b has been found that text is replaced with some Text, on second match, text between b/b is replaced by some other different text etc. Btw, where I can find patterns that are valid? (something like (\w+), (\d+)+i etc. Thanks. Regards. Zoran
Re: [PHP] stdin buffering
Greg Donald wrote: On Thu, 2004-09-09 at 15:25, Jim Grill wrote: exec(stty -icanon min 0 time 0); Nice. I suspect 'phpSnake' will appear on freshmeat in a couple days. :) thats more or less what we are trying to do. =) pong as a start at least. doing it all over again, this time php-style. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] no-store and no-cache = no files in browsers cache ?
Hi! Am I assuming correctly that if you add this in the beginning of a PHP page that the browser will not store files for that page to its cache? ?php header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1 header('Cache-Control: post-check=0, pre-check=0'); // damnable IE5 header('Expires: Wed, 16 Nov 1977 10:00:00 CET'); // date in past header('Last-Modified: '.date('r'));// right -now- header('Pragma: no-cache'); // HTTP/1.0 ? I tried it, but the sensitive files I want to avoid from being available on the client's harddrive, still get downloaded and saved in the Temporary Internet Files for IE6. I also tried Mozilla, but I see changes in the cache as well. Comments would be greatly appreciated! Thx! Bart -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Assigning one var to multiple vars
* Thus wrote Jason Davidson: $var2 = $var3 = $var5 = all the same; or $var2 = $var3 = $var5 = all the same; Curt -- The above comments may offend you. flame at will. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] preg_replace question
Zoran Lorkovic wrote: Sorry for issuing this again, but I need help with preg_replace. I manage to replace certain text between b/b in text with preg_replace but I want for every other b/b to be replaced by other text. By this I mean when some text between b/b has been found that text is replaced with some Text, on second match, text between b/b is replaced by some other different text etc. Btw, where I can find patterns that are valid? (something like (\w+), (\d+)+i etc. Use preg_replace_callback() with a static variable within the callback function. Increment the variable each time the function is called and then based upon whether it's odd or even, substitute the appropriate string. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals www.phparch.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: image size?
Ed Lazor wrote: Is there a way to get the size of an image created using the imagecreate function? I'm guessing it would be xsize x ysize x colour depth = size in bits ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: image size?
-Original Message- Ed Lazor wrote: Is there a way to get the size of an image created using the imagecreate function? I'm guessing it would be xsize x ysize x colour depth = size in bits ? What's the default color depth? -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: image size?
Ed Lazor wrote: -Original Message- Ed Lazor wrote: Is there a way to get the size of an image created using the imagecreate function? I'm guessing it would be xsize x ysize x colour depth = size in bits ? What's the default color depth? -Ed It looks to me like it's 8bit for imagecreate and maybe 24bit for imagecreatetruecolor ? Does anyone else know about this for certain ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php