[PHP] OR
if (cond || cond2) OR if (cond OR cond2) What do you use, and why? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OR
if (cond || cond2) OR if (cond OR cond2) What do you use, and why? -- || coz its easier to type ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OR
On Sunday 25 April 2004 12:14 am, Aidan Lister wrote: if (cond || cond2) OR if (cond OR cond2) What do you use, and why? Doesn't matter- personal preference. -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- There is a certain right by which we may deprive a man of life, but none by which we may deprive him of death. -Nietzsche -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SSI and query string variables to PHP
On Saturday 24 April 2004 10:29 pm, Tim Traver wrote: Hi all, ok, this may be a dumb question, but I have a page that has server side includes that include a php script like this : !--#include virtual=schedule.php -- works fine, except the script doesn't appear to receive any of the query string information if that page has a query string on it... an example would be something like this : http://www.domain.com/index.shtml?myvariable=1 the php script should get $_REQUEST['myvariable']==1, but instead does not get any of the query information. The $_SERVER global gets the unescaped query string, but has no value for just the query string... um, huh? you mean it has the query string but it isn't parsed into the proper superglobals ($_GET, $_REQUEST)? Not really sure what you're looking for here so i'm going to just pretend this paragraph isn't here ;) any way around this without making the whole page a php script ? php.net/parse_str Thanks, Tim -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- The greatest mistake is to imagine that the human being is an autonomous individual. The secret freedom which you can supposedly enjoy under a despotic government is nonsense, because your thoughts are never entirely your own. Philosophers, writers, artists, even scientists, not only need encouragement and an audience, they need constant stimulation from other people. It is almost impossible to think without talking. If Defoe had really lived on a desert island, he could not have written Robinson Crusoe, nor would he have wanted to. Take away freedom of speech, and the creative faculties dry up. -George Orwell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: OR
Aidan Lister schrieb: if (cond || cond2) OR if (cond OR cond2) What do you use, and why? It doesn't matter except you combine it because || has a higher priority as OR. Rainer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SSI and query string variables to PHP
Tim Traver wrote: Hi all, ok, this may be a dumb question, but I have a page that has server side includes that include a php script like this : Please send a new message if you have a new question, and do not reply to a thread and change the subject. It breaks the conversation flow. Where is that newbie guide? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fetching XML for parsing
Patagonia Hosting Development Group wrote: That may be the exact problem. I was not figuring that one out. Thi is my fopen and XML parser code: $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, startElement, endElement); xml_set_character_data_handler($xml_parser, characterData); if (!($fp = fopen($uFile,rb))) { Are you sure about rb? Shouldn't that just be r? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SMTP and GroupWise
Todd Cary wrote: My client is using GroupWise to relay *without* having relay turned on and it needs/uses an authenication that is different from the regular SMTP. Here is a trace of a message that went through: [ snipped POP before SMTP authentication ] Does anyone know of a class that can provide this type of authenication? I don't know of a class, but phpprojekt 4.1 has this functionality built in. You could look at that code and get some ideas. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP /MySQL problem on SMP machines
Hi all, We just installed PHP 4.3.6 on FreeBSD 5.2.1 on some SMP machines and we are experiencing some weird problems. The PHP processes are running as FastCGI under Zeus with these compile options: ./configure --with-curl \ --enable-sockets \ --enable-dbx \ --with-jpeg-dir \ --with-jpeg \ --prefix=/webdisk/local/progs/php/compiled/4.3.6 \ --with-imlib \ --with-mysql \ --with-gd \ --enable-fastcgi \ --with-config-file-path=/webdisk/servers/php \ --with-exec-dir=/webdisk/servers/php/exec-dir \ --enable-memory-limit \ --disable-force-cgi-redirect \ --disable-url-fopen-wrapper \ --enable-track-vars \ --enable-xslt \ --with-xslt-sablot \ --enable-inline-optimization \ --disable-debug \ --enable-sockets \ --enable-sysvsem \ --enable-sysvshm \ --with-ttf \ --with-freetype-dir=/usr/local/include/freetype2/ \ --with-zlib-dir=/usr/src/lib/libz/ \ --enable-gd-native-ttf \ The database backend is MySQL 4.0.18 and is run on a seperate dedicated server. Last night some problems occured - when we queried the databases for simple queries that _should_ return some rows (and worked minutes before) the database simply returned 0 rows. A restart og the mysqld and the php processes solved the problems but they return at random. I suspect that it is some weird problem with PHP / MySQL / SMP but I have no clue what can cause the problem. The old servers we used before the upgrade are all uni processor machines and we haven't experienced any similar problems on those machines. The sysctl for FreeBSD is set to: kern.ipc.shm_use_phys=1 (used on the old setup as well) Is there any issues with the mysql library under PHP that can cause the problems on the server - eg. not thread safe? I do hope that any of you have some pointers so I can get over this weird problem. Thanks in advance. Regards -- Lasse Laursen · VP, Hosting Technology · NetGroup A/S St. Kongensgade 40H · DK-1264 Copenhagen K, Denmark Phone: +45 3370 1526 · Fax: +45 3313 0066 - Don't be fooled by cheap finnish imitations - BSD is the One True Code -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fetching XML for parsing
I used to have the r alone but I thought on trying... and nothing... Burhan Khalid [EMAIL PROTECTED] escribió en el mensaje news:[EMAIL PROTECTED] Patagonia Hosting Development Group wrote: That may be the exact problem. I was not figuring that one out. Thi is my fopen and XML parser code: $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, startElement, endElement); xml_set_character_data_handler($xml_parser, characterData); if (!($fp = fopen($uFile,rb))) { Are you sure about rb? Shouldn't that just be r? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OR
According to historical records, on Sun, 25 Apr 2004 17:14:13 +1000 Aidan Lister wrote about [PHP] OR: if (cond || cond2) OR if (cond OR cond2) What do you use, and why? I always use || basically because to me it's easier to read in more complex statements ... like this: if ((($del_own == 1 $post_userID == $userID) || $del_other == 1) ($postID != $first_postID || $del_thread == 1)) { I always stick to the symbols ... just easier ... || |! ! ^ being OR, AND, NOR, and NAND (believe NOR is actually called XOR, can't remember ...) Rene -- Rene Brehmer aka Metalbunny ~ If you don't like what I have to say ... don't read it ~ http://metalbunny.net/ References, tools, and other useful stuff... Check out the new Metalbunny forums at http://forums.metalbunny.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] adult content censoring
hi... i have to make an adult content censoring system so people cant post bad words on any public viewable posts. i know preg_replace and possibaly preg_match would be a huge help but im wondering how i would put all the bad words in a file (textfile) 1 word on a line and have it look through the file for the words? when it finds a match then it will either replace the word with * but better yet tell the user that content in the post was rejected because of bad content and take them back to the form with the stuff they typed in it... if there is a better way to do this (i hope sounds like a lot of work) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] adult content censoring
Hello Andy, Sunday, April 25, 2004, 3:22:29 PM, you wrote: AB i have to make an adult content censoring system so people cant post bad AB words on any public viewable posts. i know preg_replace and possibaly AB preg_match would be a huge help but im wondering how i would put all the bad AB words in a file (textfile) 1 word on a line and have it look through the AB file for the words? when it finds a match then it will either replace the AB word with * but better yet tell the user that content in the post was AB rejected because of bad content and take them back to the form with the AB stuff they typed in it... The way I do it on a piece of forum software I wrote on a VERY popular web site was as follows: Create an include file which contains all your badwords in an array, like: $badword[] = 'well'; $badword[] = 'you'; $badword[] = 'get'; $badword[] = 'the'; $badword[] = 'idea'; Then I have a simple function as follows: function APL_Func_BadWord ($text) { global $badwords; // This will check our given text against the badword list. It does it slightly differently // in that instead of firing up the regular expression engine, we use a more simple but just as effective technique: // Get the length of the text $original_length = strlen($text); // Now strip out ANY of the bad words using the fast str_replace and count the result $stripped_length = strlen(str_replace($badwords, '', strtolower($text))); // In PHP5 we will use the str_ireplace function instead of needing strtolower: // $stripped_length = strlen(str_ireplace($badwords, '', $text)); // If the two lengths are different, the pos contained a badword - simple as that! if ($original_length $stripped_length) { return true; } else { return false; } } and that's it - I pass any string I need to this whenever someone posts a message, subject, etc etc and it hasn't failed me yet :) (unless the bad word isn't in your list of course!) -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OK SQL experts...
I think you want to remove the single quotes around the field names. SELECT * FROM my_table WHERE (field_1 LIKE '%$keyword%' OR field_2 LIKE '%$keyword%' OR field_3 LIKE '%$keyword%') AND status = 'active'; I STFW and RTFM and I still can't figure out why this returns a 1064 parse error: SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active'; Anyone? TIA! - B1ff Lamer -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OK SQL experts...
The parenthesis are OK. The query might take a long time to run with 3 LIKE statements. Backticks, single quotes, or nothing at all makes no difference. I believe the parsing error is due to my parentheses or AND/OR structure. Any thoughts on that? On Apr 23, 2004, at 8:32 AM, John W. Holmes wrote: From: Brian Dunning [EMAIL PROTECTED] I STFW and RTFM and I still can't figure out why this returns a 1064 parse error: SELECT * FROM 'my_table' WHERE ('field_1' LIKE '%$keyword%' OR 'field_2' LIKE '%$keyword%' OR 'field_3' LIKE '%$keyword%') AND 'status' = 'active';
[PHP] Shared session ? (frames application)
I am wondering if it is possible to let two or more scripts share a common session id ? I am guessing not, but would like to be proved wrong. This is the situation cut down about as small as I could make it. Five files: index.php, login-form.inc, frames.inc, left.php, main.php index.php - ? session_name('cesh'); session_start(); $function = $_POST['function']; if (!isset($function) || $function='') { include login-form.inc; die; } //test, user always valid function validuser () { return true; } if ($function == 'login') { if (!validuser($_POST['user'], $_POST['pass'])) { include login-form.inc; die; } } $_SESSION['user'] = $user; $_SESSION['foo'] = 'bar'; include frames.inc; ? - login-form.inc - htmlbody form method=POST user input type=text name=userbr pass input type=text name=passbr input type=submit value=Login input type=hidden name=function value=login /body/html ? die; ? - frames.inc - ? // get var used to pass session id to left and main scripts $sid = SID; $src = EOF frameset cols=350,* rows=* frameborder=1 frame src=left.php?$sid name=left frameborder=1 frame src=main.php?$sid name=main frameborder=1 noframes body bgcolor=#FF pphpMyAdmin is more friendly with a bframes-capable/b browser./p /body /noframes /frameset EOF; $src = str_replace(\n, , split ( \n, $src )); ? html script type=text/javascript !-- ? foreach ($src as $line) { echo document.writeln('${line}');\n; } ? //-- /script noscript ? foreach ($src as $line) { echo ${line} . \n; } ? /noscript /html - left.php - htmlbody Leftbr Is it possible to access (read/write/set/unset) the variables of session ?=$_GET['cesh']?br ? /body/html - main.php - htmlbody Mainbr Is it possible to access (read/write/set/unset) the variables of session ?=$_GET['cesh']?br ? /body/html - -- Richard A. DeVenezia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] adult content censoring
Richard Davey wrote: and that's it - I pass any string I need to this whenever someone posts a message, subject, etc etc and it hasn't failed me yet :) (unless the bad word isn't in your list of course!) To guard against 'lame' impressions of words to be filtered, you might also check all combinations of variations of lettering of each undesired word. You can do this programmatically without have to list them all. i.e. l replaced with digit 1 or any l looking characters with byte code 128 o replace with digit 0 or any o looking characters with byte code 128 f replaced with any f looking characters with byte code 128 Read a spample erectile dysfunction or pain medication mail to get the idea. Definition: spample - Spam samples; a sampling of spam. -- Richard A. DeVenezia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] adult content censoring
* Thus wrote Richard Davey ([EMAIL PROTECTED]): Hello Andy, Sunday, April 25, 2004, 3:22:29 PM, you wrote: AB i have to make an adult content censoring system so people cant post bad AB words on any public viewable posts. i know preg_replace and possibaly AB preg_match would be a huge help but im wondering how i would put all the bad AB words in a file (textfile) 1 word on a line and have it look through the AB file for the words? when it finds a match then it will either replace the AB word with * but better yet tell the user that content in the post was AB rejected because of bad content and take them back to the form with the AB stuff they typed in it... The way I do it on a piece of forum software I wrote on a VERY popular web site was as follows: Create an include file which contains all your badwords in an array, like: $badword[] = 'well'; $badword[] = 'you'; $badword[] = 'get'; $badword[] = 'the'; $badword[] = 'idea'; Then I have a simple function as follows: function APL_Func_BadWord ($text) { global $badwords; // This will check our given text against the badword list. It does it slightly differently // in that instead of firing up the regular expression engine, we use a more simple but just as effective technique: One advantage with using preg*, is you can have more flexible matching instead of having a real large list of bad words: $badword[] = '/suck(er|ing|ed)?/i'; Also instead of str_replace scanning the whole string 5 time to replace the 5 items, its only scanned once, replacing up to five things. So depending on how large your list of words are and how large the content is you scanning, preg_* might be a little more efficient. And then there is the possiblity that the users might get smart and start entering things like: s-u-c-k One way to fix that is to replace all Non-word characters in the subject string with null: preg_replace('/\W/', '') Of course that wont work if they use L337 or html tags. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Shared session ? (frames application)
Richard A. DeVenezia wrote: I am wondering if it is possible to let two or more scripts share a common session id ? I am guessing not, but would like to be proved wrong. I might get you wrong, but unless you take some precausions all scripts on a single domain share common session id. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP /MySQL problem on SMP machines
* Thus wrote Lasse Laursen ([EMAIL PROTECTED]): Hi all, We just installed PHP 4.3.6 on FreeBSD 5.2.1 on some SMP machines and we are experiencing some weird problems. ... The database backend is MySQL 4.0.18 and is run on a seperate dedicated server. What mysqlclient is php linked to? php -i | grep Client API I would make sure you're using a 4.x version. Last night some problems occured - when we queried the databases for simple queries that _should_ return some rows (and worked minutes before) the database simply returned 0 rows. A restart og the mysqld and the php processes solved the problems but they return at random. A couple things to check: - the output of mysql_error(), it usually solves 90% of query problems. - if myismchk was ran on the table(s) mysql can get confused about the indexes (until the table(s) are flushed) Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Call to external function
Jeff McKeon wrote: No... PHP and JavaScript are executing at different time and at different place. Besides, they are executed by different programs. Are you trying to measure execution time of a query?? Look at: http://www.php.net/microtime No, I'm trying to get a little animation on the left frame to start when a query begins a pull (when the page begins to load) and then stop the animation when the page and data are fully loaded. I suppose that the action is triggered by a link. Then you can put the 'start' javascript code in onclick event of that link. The 'stop' code would go into onload event of the document body tag. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] adult content censoring
Hello Curt, Sunday, April 25, 2004, 4:28:37 PM, you wrote: CZ Also instead of str_replace scanning the whole string 5 time to CZ replace the 5 items, its only scanned once, replacing up to five CZ things. My method *did* only scan the string once and str_replace is definitely faster than preg_replace. But I agree with the preg use for more complex word catching, but even using that method you could spend ages building up a definitive badwords array. I guess it depends how anal you want to be ;) (heh) -- Best regards, Richard Davey http://www.phpcommunity.org/wiki/296.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] adult content censoring
* Thus wrote Richard Davey ([EMAIL PROTECTED]): Hello Curt, Sunday, April 25, 2004, 4:28:37 PM, you wrote: CZ Also instead of str_replace scanning the whole string 5 time to CZ replace the 5 items, its only scanned once, replacing up to five CZ things. My method *did* only scan the string once and str_replace is definitely faster than preg_replace. I was implying that internally php loops through each item in the array you pass and calls str_replace on the items. Thats why I added that it depends on the number of items and length of the string your searching. If you can take 50 element array down to 5, the overhead of preg wont matter as much. Curt -- I used to think I was indecisive, but now I'm not so sure. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] OR
BEEP wrong :) http://www.php.net/manual/en/language.operators.php#language.operators.precedence therefore: $a AND $b OR $c AND $d is not equal $a AND $b || $c AND $d but is equal to $a $b || $c $d -- red Evan Nemerson wrote: On Sunday 25 April 2004 12:14 am, Aidan Lister wrote: if (cond || cond2) OR if (cond OR cond2) What do you use, and why? Doesn't matter- personal preference. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] SSI and query string variables to PHP
Yes, I mean that php gets the server information for the request, but it doesn't get the QUERY_STRING variable. But it does get the UNESCAPED_QUERY_STRING variable...wierd, huh ? It might be that apache isn't sending that variable to php from an included file...not sure... That's why I'm asking everyone. Tim. At 01:22 AM 4/25/2004, Evan Nemerson wrote: On Saturday 24 April 2004 10:29 pm, Tim Traver wrote: Hi all, ok, this may be a dumb question, but I have a page that has server side includes that include a php script like this : !--#include virtual=schedule.php -- works fine, except the script doesn't appear to receive any of the query string information if that page has a query string on it... an example would be something like this : http://www.domain.com/index.shtml?myvariable=1 the php script should get $_REQUEST['myvariable']==1, but instead does not get any of the query information. The $_SERVER global gets the unescaped query string, but has no value for just the query string... um, huh? you mean it has the query string but it isn't parsed into the proper superglobals ($_GET, $_REQUEST)? Not really sure what you're looking for here so i'm going to just pretend this paragraph isn't here ;) any way around this without making the whole page a php script ? php.net/parse_str Thanks, Tim -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- The greatest mistake is to imagine that the human being is an autonomous individual. The secret freedom which you can supposedly enjoy under a despotic government is nonsense, because your thoughts are never entirely your own. Philosophers, writers, artists, even scientists, not only need encouragement and an audience, they need constant stimulation from other people. It is almost impossible to think without talking. If Defoe had really lived on a desert island, he could not have written Robinson Crusoe, nor would he have wanted to. Take away freedom of speech, and the creative faculties dry up. -George Orwell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php SimpleNet's Back ! http://www.simplenet.com
[PHP] Re: Shared session ? (frames application)
This is possible without problem. Just start your session in every script and forward the session id from your frameset (which is probably the first page to be called by the user) to each frame: frames.inc -- ? // start session here // ... frameset cols=350,* rows=* frameborder=1 frame src=left.php??= SID; ? name=left frameborder=1 frame src=main.php??= SID; ? name=main frameborder=1 /frameset ? Make sure to put the session start code at the top of EVERY page. Regards, Torsten Richard A. Devenezia [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I am wondering if it is possible to let two or more scripts share a common session id ? I am guessing not, but would like to be proved wrong. This is the situation cut down about as small as I could make it. Five files: index.php, login-form.inc, frames.inc, left.php, main.php index.php - ? session_name('cesh'); session_start(); $function = $_POST['function']; if (!isset($function) || $function='') { include login-form.inc; die; } file://test, user always valid function validuser () { return true; } if ($function == 'login') { if (!validuser($_POST['user'], $_POST['pass'])) { include login-form.inc; die; } } $_SESSION['user'] = $user; $_SESSION['foo'] = 'bar'; include frames.inc; ? - login-form.inc - htmlbody form method=POST user input type=text name=userbr pass input type=text name=passbr input type=submit value=Login input type=hidden name=function value=login /body/html ? die; ? - frames.inc - ? // get var used to pass session id to left and main scripts $sid = SID; $src = EOF frameset cols=350,* rows=* frameborder=1 frame src=left.php?$sid name=left frameborder=1 frame src=main.php?$sid name=main frameborder=1 noframes body bgcolor=#FF pphpMyAdmin is more friendly with a bframes-capable/b browser./p /body /noframes /frameset EOF; $src = str_replace(\n, , split ( \n, $src )); ? html script type=text/javascript !-- ? foreach ($src as $line) { echo document.writeln('${line}');\n; } ? file://-- /script noscript ? foreach ($src as $line) { echo ${line} . \n; } ? /noscript /html - left.php - htmlbody Leftbr Is it possible to access (read/write/set/unset) the variables of session ?=$_GET['cesh']?br ? /body/html - main.php - htmlbody Mainbr Is it possible to access (read/write/set/unset) the variables of session ?=$_GET['cesh']?br ? /body/html - -- Richard A. DeVenezia -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
php-general Digest 25 Apr 2004 17:27:52 -0000 Issue 2726
php-general Digest 25 Apr 2004 17:27:52 - Issue 2726 Topics (messages 184546 through 184574): SSI and query string variables to PHP 184546 by: Tim Traver 184547 by: Tim Traver 184552 by: Evan Nemerson 184554 by: Burhan Khalid 184573 by: Tim Traver Re: formatting a string 184548 by: Tom Rogers OR 184549 by: Aidan Lister 184550 by: daniel.electroteque.org 184551 by: Evan Nemerson 184553 by: Rainer Müller 184559 by: -{ Rene Brehmer }- 184572 by: Red Wingate Re: Fetching XML for parsing 184555 by: Burhan Khalid 184558 by: Patagonia Hosting Development Group Re: SMTP and GroupWise 184556 by: Burhan Khalid PHP /MySQL problem on SMP machines 184557 by: Lasse Laursen 184568 by: Curt Zirzow adult content censoring 184560 by: Andy B 184561 by: Richard Davey 184565 by: Richard A. DeVenezia 184566 by: Curt Zirzow 184570 by: Richard Davey 184571 by: Curt Zirzow Re: OK SQL experts... 184562 by: Daniel Clark 184563 by: Daniel Clark Shared session ? (frames application) 184564 by: Richard A. DeVenezia 184567 by: Marek Kilimajer 184574 by: Torsten Roehr Re: Call to external function 184569 by: Marek Kilimajer Administrivia: To subscribe to the digest, e-mail: [EMAIL PROTECTED] To unsubscribe from the digest, e-mail: [EMAIL PROTECTED] To post to the list, e-mail: [EMAIL PROTECTED] -- ---BeginMessage--- Hi all, ok, this may be a dumb question, but I have a page that has server side includes that include a php script like this : !--#include virtual=schedule.php -- works fine, except the script doesn't appear to receive any of the query string information if that page has a query string on it... an example would be something like this : http://www.domain.com/index.shtml?myvariable=1 the php script should get $_REQUEST['myvariable']==1, but instead does not get any of the query information. The $_SERVER global gets the unescaped query string, but has no value for just the query string... any way around this without making the whole page a php script ? Thanks, Tim ---End Message--- ---BeginMessage--- Hi all, ok, this may be a dumb question, but I have a page that has server side includes that include a php script like this : !--#include virtual=schedule.php -- works fine, except the script doesn't appear to receive any of the query string information if that page has a query string on it... an example would be something like this : http://www.domain.com/index.shtml?myvariable=1 the php script should get $_REQUEST['myvariable']==1, but instead does not get any of the query information. The $_SERVER global gets the unescaped query string, but has no value for just the query string... any way around this without making the whole page a php script ? Thanks, Tim ---End Message--- ---BeginMessage--- On Saturday 24 April 2004 10:29 pm, Tim Traver wrote: Hi all, ok, this may be a dumb question, but I have a page that has server side includes that include a php script like this : !--#include virtual=schedule.php -- works fine, except the script doesn't appear to receive any of the query string information if that page has a query string on it... an example would be something like this : http://www.domain.com/index.shtml?myvariable=1 the php script should get $_REQUEST['myvariable']==1, but instead does not get any of the query information. The $_SERVER global gets the unescaped query string, but has no value for just the query string... um, huh? you mean it has the query string but it isn't parsed into the proper superglobals ($_GET, $_REQUEST)? Not really sure what you're looking for here so i'm going to just pretend this paragraph isn't here ;) any way around this without making the whole page a php script ? php.net/parse_str Thanks, Tim -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- The greatest mistake is to imagine that the human being is an autonomous individual. The secret freedom which you can supposedly enjoy under a despotic government is nonsense, because your thoughts are never entirely your own. Philosophers, writers, artists, even scientists, not only need encouragement and an audience, they need constant stimulation from other people. It is almost impossible to think without talking. If Defoe had really lived on a desert island, he could not have written Robinson Crusoe, nor would he have wanted to. Take away freedom of speech, and the creative faculties dry up. -George Orwell ---End Message--- ---BeginMessage--- Tim Traver wrote: Hi all, ok, this may be a dumb question, but I have a page that has server side includes that include a php script like this : Please send a new message if you have a
Re: [PHP] SSI and query string variables to PHP
On Sunday 25 April 2004 09:56 am, Tim Traver wrote: Yes, I mean that php gets the server information for the request, but it doesn't get the QUERY_STRING variable. But it does get the UNESCAPED_QUERY_STRING variable...wierd, huh ? Yeah, especially since I've never heard of UNESCAPED_QUERY_STRING- but then again, neither has google- http://www.google.com/search?q=%22UNESCAPED_QUERY_STRING%22 Can you send a copy of the variable, or if you're comfortable a phpinfo()? It might be that apache isn't sending that variable to php from an included file...not sure... That's why I'm asking everyone. Tim. At 01:22 AM 4/25/2004, Evan Nemerson wrote: On Saturday 24 April 2004 10:29 pm, Tim Traver wrote: Hi all, ok, this may be a dumb question, but I have a page that has server side includes that include a php script like this : !--#include virtual=schedule.php -- works fine, except the script doesn't appear to receive any of the query string information if that page has a query string on it... an example would be something like this : http://www.domain.com/index.shtml?myvariable=1 the php script should get $_REQUEST['myvariable']==1, but instead does not get any of the query information. The $_SERVER global gets the unescaped query string, but has no value for just the query string... um, huh? you mean it has the query string but it isn't parsed into the proper superglobals ($_GET, $_REQUEST)? Not really sure what you're looking for here so i'm going to just pretend this paragraph isn't here ;) any way around this without making the whole page a php script ? php.net/parse_str Thanks, Tim -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- The greatest mistake is to imagine that the human being is an autonomous individual. The secret freedom which you can supposedly enjoy under a despotic government is nonsense, because your thoughts are never entirely your own. Philosophers, writers, artists, even scientists, not only need encouragement and an audience, they need constant stimulation from other people. It is almost impossible to think without talking. If Defoe had really lived on a desert island, he could not have written Robinson Crusoe, nor would he have wanted to. Take away freedom of speech, and the creative faculties dry up. -George Orwell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php SimpleNet's Back ! http://www.simplenet.com -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- The greatest mistake is to imagine that the human being is an autonomous individual. The secret freedom which you can supposedly enjoy under a despotic government is nonsense, because your thoughts are never entirely your own. Philosophers, writers, artists, even scientists, not only need encouragement and an audience, they need constant stimulation from other people. It is almost impossible to think without talking. If Defoe had really lived on a desert island, he could not have written Robinson Crusoe, nor would he have wanted to. Take away freedom of speech, and the creative faculties dry up. -George Orwell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP /MySQL problem on SMP machines
Hi Curt, Thanks for your email - please find answers below: Regards -- Lasse Laursen · VP, Hosting Technology · NetGroup A/S St. Kongensgade 40H · DK-1264 Copenhagen K, Denmark Phone: +45 3370 1526 · Fax: +45 3313 0066 - Don't be fooled by cheap finnish imitations - BSD is the One True Code - Original Message - From: Curt Zirzow [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Sunday, April 25, 2004 5:52 PM Subject: Re: [PHP] PHP /MySQL problem on SMP machines * Thus wrote Lasse Laursen ([EMAIL PROTECTED]): Hi all, We just installed PHP 4.3.6 on FreeBSD 5.2.1 on some SMP machines and we are experiencing some weird problems. ... The database backend is MySQL 4.0.18 and is run on a seperate dedicated server. What mysqlclient is php linked to? php -i | grep Client API I would make sure you're using a 4.x version. webnode2# ./php -i | grep Client API trtd class=eClient API version /tdtd class=v3.23.49 /td/tr That could be one of the problems - how do I specify that I wish to use the 4.x API? Last night some problems occured - when we queried the databases for simple queries that _should_ return some rows (and worked minutes before) the database simply returned 0 rows. A restart og the mysqld and the php processes solved the problems but they return at random. A couple things to check: - the output of mysql_error(), it usually solves 90% of query problems. - if myismchk was ran on the table(s) mysql can get confused about the indexes (until the table(s) are flushed) No errors occur that give an mysql_error at any time. Queries on the database simply returns the wrong information... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP 5 and interfaces
I am looking to port some java code to PHP. I am looking at interfaces in PHP 5 and wondering if they support 'interface . extends .'. For example I have interface C and it extends Interface A and B.. ?php interface C extends A, B { . } ? Thanks, Brandon
Re: [PHP] OR
Hi Am So, 2004-04-25 um 16.00 schrieb -{ Rene Brehmer }-: According to historical records, on Sun, 25 Apr 2004 17:14:13 +1000 Aidan Lister wrote about [PHP] OR: [...] || |! ! ^ being OR, AND, NOR, and NAND (believe NOR is actually called XOR, can't remember ...) Just to help your mind: NOR: A | B | Y ---+---+--- 0 | 0 | 1 0 | 1 | 0 1 | 0 | 0 1 | 1 | 0 XOR: A | B | Y ---+---+--- 0 | 0 | 0 0 | 1 | 1 1 | 0 | 1 1 | 1 | 0 -- Regards Marco -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] adult content censoring
Depends on how badly the person wants to use adult languageevery bad words filter can be bypassed unless you are the filter. E.g: you screen the comments before allowing or disallowing it... My $0.2 Cheers, -Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php mail() scaleability
Using mail($to, $subject, $content, $headers) takes way too long when attempting to mail to 30k people. This seems to be a result of a socket being opened for each send. Is there a better way to approach this situation via php? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] substrings
Hi, all -- I must be having a brain fart as well as going blind because I can't find in the manual how to do this. Given a string like #AABBCC or #112233 how do I get the 2nd-3rd 4th-5th 6th-7th position substrings so I can break out the red, green, and blue values? All of the regular expressions seem to hinge on matching a separator, and the closest thing seems to be a preg_match(.(..)(..)(..),$color,$colors) ; $r = $colors[1] ; $g = $colors[2] ; $b = $colors[3] ; but it just seems like I should be able to return a list like ($r,$g,$b) = fn(operands,$color) ; or so. TIA HAND :-D -- David T-G [EMAIL PROTECTED] http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
[PHP] Re: php mail() scaleability
Hello, On 04/25/2004 04:18 PM, Josh Klobe wrote: Using mail($to, $subject, $content, $headers) takes way too long when attempting to mail to 30k people. This seems to be a result of a socket being opened for each send. Is there a better way to approach this situation via php? Under Unix/Linux, PHP itself does not open any sockets to queue messages with the mail function. If you are using Unix/Linux with sendmail there are some options that can be tweaked to make it just queue the message instead of trying to deliver the message immediately. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] substrings
$color = '#aabbcc'; if (strlen($color) == 7) { echo ' r: ' . substr($color, 1, 2); echo ' g: ' . substr($color, 3, 2); echo ' b: ' . substr($color, 5, 2); } elseif (strlen($color) == 4) { echo ' r: ' . str_repeat(substr($color, 1, 1), 2); echo ' g: ' . str_repeat(substr($color, 2, 1), 2); echo ' b: ' . str_repeat(substr($color, 3, 1), 2); } Sunday, April 25, 2004, 10:00:30 PM, thus was written: Hi, all -- I must be having a brain fart as well as going blind because I can't find in the manual how to do this. Given a string like #AABBCC or #112233 how do I get the 2nd-3rd 4th-5th 6th-7th position substrings so I can break out the red, green, and blue values? All of the regular expressions seem to hinge on matching a separator, and the closest thing seems to be a preg_match(.(..)(..)(..),$color,$colors) ; $r = $colors[1] ; $g = $colors[2] ; $b = $colors[3] ; but it just seems like I should be able to return a list like ($r,$g,$b) = fn(operands,$color) ; or so. TIA HAND :-D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] substr == SOLVED (was Re: [PHP] substrings)
Richard, et al -- ...and then Richard Harb said... % % $color = '#aabbcc'; % % if (strlen($color) == 7) { %echo ' r: ' . substr($color, 1, 2); [snip] D'oh! I knew it should be substr but I could never find it! I was up to page 1098 or such and muddling through all of the PCRE doc when I gave up and asked for help :-) Thanks HAND :-D -- David T-G [EMAIL PROTECTED] http://justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg! pgp0.pgp Description: PGP signature
Re: [PHP] Re: php mail() scaleability
Manuel Lemos wrote: Hello, On 04/25/2004 04:18 PM, Josh Klobe wrote: Using mail($to, $subject, $content, $headers) takes way too long when attempting to mail to 30k people. This seems to be a result of a socket being opened for each send. Is there a better way to approach this situation via php? Under Unix/Linux, PHP itself does not open any sockets to queue messages with the mail function. If you are using Unix/Linux with sendmail there are some options that can be tweaked to make it just queue the message instead of trying to deliver the message immediately. Okay, I'll bite. What options? cheers, Travis -- Travis Low mailto:[EMAIL PROTECTED] http://www.dawnstar.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Fetching XML for parsing
rb is correct, b should be used to ensure portability between operating systems with different line endings. Quoted from http://us2.php.net/fopen For portability, it is strongly recommended that you always use the 'b' flag when opening files with fopen() Jason -Original Message- From: Burhan Khalid [mailto:[EMAIL PROTECTED] Sent: Sunday, April 25, 2004 4:51 AM To: Patagonia Hosting Development Group; [EMAIL PROTECTED] Subject: Re: [PHP] Fetching XML for parsing Patagonia Hosting Development Group wrote: That may be the exact problem. I was not figuring that one out. Thi is my fopen and XML parser code: $xml_parser = xml_parser_create(); xml_set_element_handler($xml_parser, startElement, endElement); xml_set_character_data_handler($xml_parser, characterData); if (!($fp = fopen($uFile,rb))) { Are you sure about rb? Shouldn't that just be r? -- 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] SSI and query string variables to PHP
Hmmm after doing more research on it, it appears that this server variable only appears in SSI documents. And I didn't quote the variable correctly, its QUERY_STRING_UNESCAPED I guess that SSI does not send through the querystring to the included script. I might have to just use the QUERY_STRING_UNESCAPED variable and populate the $_REQUEST array myself, cause the QUERY_STRING variable is empty... Tim. At 10:52 AM 4/25/2004, Evan Nemerson wrote: On Sunday 25 April 2004 09:56 am, Tim Traver wrote: Yes, I mean that php gets the server information for the request, but it doesn't get the QUERY_STRING variable. But it does get the UNESCAPED_QUERY_STRING variable...wierd, huh ? Yeah, especially since I've never heard of UNESCAPED_QUERY_STRING- but then again, neither has google- http://www.google.com/search?q=%22UNESCAPED_QUERY_STRING%22 Can you send a copy of the variable, or if you're comfortable a phpinfo()? It might be that apache isn't sending that variable to php from an included file...not sure... That's why I'm asking everyone. Tim. At 01:22 AM 4/25/2004, Evan Nemerson wrote: On Saturday 24 April 2004 10:29 pm, Tim Traver wrote: Hi all, ok, this may be a dumb question, but I have a page that has server side includes that include a php script like this : !--#include virtual=schedule.php -- works fine, except the script doesn't appear to receive any of the query string information if that page has a query string on it... an example would be something like this : http://www.domain.com/index.shtml?myvariable=1 the php script should get $_REQUEST['myvariable']==1, but instead does not get any of the query information. The $_SERVER global gets the unescaped query string, but has no value for just the query string... um, huh? you mean it has the query string but it isn't parsed into the proper superglobals ($_GET, $_REQUEST)? Not really sure what you're looking for here so i'm going to just pretend this paragraph isn't here ;) any way around this without making the whole page a php script ? php.net/parse_str Thanks, Tim -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- The greatest mistake is to imagine that the human being is an autonomous individual. The secret freedom which you can supposedly enjoy under a despotic government is nonsense, because your thoughts are never entirely your own. Philosophers, writers, artists, even scientists, not only need encouragement and an audience, they need constant stimulation from other people. It is almost impossible to think without talking. If Defoe had really lived on a desert island, he could not have written Robinson Crusoe, nor would he have wanted to. Take away freedom of speech, and the creative faculties dry up. -George Orwell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php SimpleNet's Back ! http://www.simplenet.com -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- The greatest mistake is to imagine that the human being is an autonomous individual. The secret freedom which you can supposedly enjoy under a despotic government is nonsense, because your thoughts are never entirely your own. Philosophers, writers, artists, even scientists, not only need encouragement and an audience, they need constant stimulation from other people. It is almost impossible to think without talking. If Defoe had really lived on a desert island, he could not have written Robinson Crusoe, nor would he have wanted to. Take away freedom of speech, and the creative faculties dry up. -George Orwell -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php SimpleNet's Back ! http://www.simplenet.com
Re: [PHP] substrings
On Sunday 25 April 2004 01:00 pm, David T-G wrote: Hi, all -- I must be having a brain fart as well as going blind because I can't find in the manual how to do this. Given a string like #AABBCC or #112233 how do I get the 2nd-3rd 4th-5th 6th-7th position substrings so I can break out the red, green, and blue values? php.net/substr? All of the regular expressions seem to hinge on matching a separator, and the closest thing seems to be a preg_match(.(..)(..)(..),$color,$colors) ; $r = $colors[1] ; $g = $colors[2] ; $b = $colors[3] ; but it just seems like I should be able to return a list like ($r,$g,$b) = fn(operands,$color) ; or so. TIA HAND :-D -- Evan Nemerson [EMAIL PROTECTED] http://coeusgroup.com/en -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: php mail() scaleability
Hello, On 04/25/2004 05:43 PM, Travis Low wrote: Using mail($to, $subject, $content, $headers) takes way too long when attempting to mail to 30k people. This seems to be a result of a socket being opened for each send. Is there a better way to approach this situation via php? Under Unix/Linux, PHP itself does not open any sockets to queue messages with the mail function. If you are using Unix/Linux with sendmail there are some options that can be tweaked to make it just queue the message instead of trying to deliver the message immediately. Okay, I'll bite. What options? There are several options that may suite you. Check sendmail man page for DeliveryMode option. You may also want to take a look at this class that comes with a sub-class specialized in deliverying messages with sendmail. It provide a delivery_mode class variable that lets you override the sendmail default delivery mode. If you want to try this class but do not want to change your scripts much, you can also use a wrapper function that comes with this class named sendmail_mail(). It emulates the mail() function except that you can change these options. You just need to include the class files and change the mail() calls to sendmail_mail() calls without any need to change parameters. http://www.phpclasses.org/mimemessage -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: php mail() scaleability
Take a look at the Mail Queue class from PEAR, it enables you to put mail in the Queue instead of real time delivery. http://pear.php.net/packages.php?catpid=14catname=Mail Jason -Original Message- From: Travis Low [mailto:[EMAIL PROTECTED] Sent: Sunday, April 25, 2004 2:43 PM To: [EMAIL PROTECTED] Subject: Re: [PHP] Re: php mail() scaleability Manuel Lemos wrote: Hello, On 04/25/2004 04:18 PM, Josh Klobe wrote: Using mail($to, $subject, $content, $headers) takes way too long when attempting to mail to 30k people. This seems to be a result of a socket being opened for each send. Is there a better way to approach this situation via php? Under Unix/Linux, PHP itself does not open any sockets to queue messages with the mail function. If you are using Unix/Linux with sendmail there are some options that can be tweaked to make it just queue the message instead of trying to deliver the message immediately. Okay, I'll bite. What options? cheers, Travis -- Travis Low mailto:[EMAIL PROTECTED] http://www.dawnstar.com -- 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] Re: php mail() scaleability
Hello, On 04/25/2004 06:03 PM, Jason Sheets wrote: Take a look at the Mail Queue class from PEAR, it enables you to put mail in the Queue instead of real time delivery. http://pear.php.net/packages.php?catpid=14catname=Mail This is a bit of an overkill as it attempts to provide an inefficient solution replicate the dedicated solution built-in sendmail for queueing messages that can be called with a few lines of code, thus without needing a large PHP package. -- Regards, Manuel Lemos PHP Classes - Free ready to use OOP components written in PHP http://www.phpclasses.org/ PHP Reviews - Reviews of PHP books and other products http://www.phpclasses.org/reviews/ Metastorage - Data object relational mapping layer generator http://www.meta-language.net/metastorage.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php