php-general Digest 28 Mar 2007 12:42:38 -0000 Issue 4702
php-general Digest 28 Mar 2007 12:42:38 - Issue 4702 Topics (messages 251502 through 251533): Re: pear returns prompt 251502 by: Chris Re: Optimization of all mysql databases on a server 251503 by: itoctopus changing array to a string 251504 by: Richard Kurth 251505 by: Chris 251506 by: Peter Lauri 251508 by: Richard Kurth using for loop in function 251507 by: Richard Kurth 251510 by: Chris 251512 by: Jim Lucas 251531 by: Myron Turner PHP 5.2.1: Some scripts are being parsed, but most aren't 251509 by: Eddie 251511 by: Hap-Hang Yu 251513 by: Mario Guenterberg 251532 by: Myron Turner 251533 by: Mario Guenterberg How can i convert one object to another. Convert Exception object to MyException Object. 251514 by: Mathijs 251518 by: Zoltán Németh 251525 by: Jochem Maas Re: Language detection with PHP 251515 by: Satyam 251530 by: Robin Vickery Zend Guard Performance Problem 251516 by: Sancar Saran 251517 by: Chris 251519 by: Sancar Saran 251526 by: Jochem Maas 251529 by: Chris HELO command when sending email using PHP 251520 by: Angelo Zanetti 251521 by: demo 251522 by: Angelo Zanetti 251523 by: demo 251524 by: demo PDO mssql + multiple rowsets 251527 by: Javier Ruiz Re: POST + QUERY 251528 by: Dan Shirah 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: php-general@lists.php.net -- ---BeginMessage--- Farid Hamjavar wrote: Greetings, Linux Redhat AS 4 with PHP 5.1.6 When I execute pear, I get my prompt back: Ask the pear list - http://pear.php.net/support/lists.php -- Postgresql php tutorials http://www.designmagick.com/ ---End Message--- ---BeginMessage--- You're right, it was running from a browser, you need to use set_time_limit. -- itoctopus - http://www.itoctopus.com Chris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Jochem Maas wrote: Tijnema ! wrote: On 3/26/07, Chris [EMAIL PROTECTED] wrote: itoctopus wrote: The purpose of this script is to optimize all associated tables in all databases on a mysql server. This script is working great, you can put in a CRON and run it every day. Feel free to throw in your 2 cents! It's going to time out if you have any large databases or tables. php will not timeout on the commandline unless you actually specify a timeout - unlike php as used as a webserver SAPI. Considering the amount of html in the script I guessed (maybe incorrectly) it was for running from a browser - which is why I mentioned about the timeout issue. A command line script isn't going to have br/'s or tables or anything (well, none that I've written recently do). -- Postgresql php tutorials http://www.designmagick.com/ ---End Message--- ---BeginMessage--- When I submit the for below it gives me an array that looks like this array(5) { [0]= string(1) 3 [1]= string(1) 4 [2]= string(1) 5 [3]= string(1) 6 [4]= string(1) 7 } I would like to convert it to a string like this 3,4,5,6,7 form action=test.php method=post table trtd colspan=2 align=leftinput name=subscriptions[] value=3 type=checkboxtest message /td/trtrtd colspan=2 align=leftinput name=subscriptions[] value=4 type=checkboxtest message /td/trtrtd colspan=2 align=leftinput name=subscriptions[] value=5 type=checkboxtest message /td/trtrtd colspan=2 align=leftinput name=subscriptions[] value=6 type=checkboxtest message /td/trtrtd colspan=2 align=leftinput name=subscriptions[] value=7 type=checkboxtest message /td/tr /table input type=hidden name=doit value=yes input type=submit name=submit /form ---End Message--- ---BeginMessage--- Richard Kurth wrote: When I submit the for below it gives me an array that looks like this array(5) { [0]= string(1) 3 [1]= string(1) 4 [2]= string(1) 5 [3]= string(1) 6 [4]= string(1) 7 } I would like to convert it to a string like this 3,4,5,6,7 $ids = implode(',', $_POST['subscriptions']); -- Postgresql php tutorials http://www.designmagick.com/ ---End Message--- ---BeginMessage--- -Original Message- From: Richard Kurth [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 28, 2007 6:12 AM To: php-general@lists.php.net Subject: [PHP] changing array to a string When I submit the for below it gives me an array that looks like this array(5) { [0]= string(1) 3 [1]= string(1) 4 [2]= string(1) 5 [3]= string(1) 6 [4]= string(1) 7 } I would like to convert it to a string like this 3,4,5,6,7 form action=test.php method=post table trtd colspan=2 align=leftinput name=subscriptions[] value=3 type=checkboxtest message /td/trtrtd colspan=2 align=leftinput
Re: [PHP] Language detection with PHP
- Original Message - From: Zoltán Németh [EMAIL PROTECTED] In formal english, it's not allowed to use 've 'm etc, I'm should be written as I am. So that's not gonna work i think. But words like and are really english i think :) Keep in mind that this is quite a hard way i think, but i don't have a better solution. Just for example, Dutch and Afrikaans are not very different, so it's really hard to see which of the 2 the text is written in. Tijnema ps. If you can't get the difference between Dutch and Afrikaans, guess for Dutch :) It's a lot more used then Afrikaans. yeah, looking for very frequently used words seems better idea. greets Zoltán Németh In Spanish, as it happens with many languages that use diacritical marks, in informal chatting you often skip them. This has a long tradition in the internet since years ago the support for those extra characters was non-existent and today it is still somewhat patchy. I used to have two modes of writing in Spanish, formal writing with all proper accents, tilde and umlauts and email mode, without any of those. Nowadays, with support for languages using the Roman alphabet widely available, there is no need to omit diacritical marks, but you will often find them missing, particularly in comments to blogs and other informal writing, just because of laziness or carelessness or simply lack of formal education and in that I include foreigners who more or less handle the language but not the minor details. If English had accents, I would probably skip them. So, using a spelling dictionary is not a good idea unless you can count your input to be properly written. A text in Spanish with its accents missing will give you lots of errors, and we use just one sort of accent (acute) plus tilde and umlaut. The French use three sorts of accents, there is a far higher chance of getting misspellings. I don't know how abundant accents are in Magyar, for me Zoltan Nemeth is the same as Zoltán Németh, but the first is a misspelling. This problem also affect the frequency of individual letters. Should you first convert accented vowels to their plain version? Because if you find accented letters, it is a sure sign that it is not English, but if there is none, it doesn't mean it is English, it might be some non-English text without the correct accents. Should you count 'a' and 'á' separate or add them together because people often omit the accent? So, I also vote for the frequently used words approach and against the lowest number of misspellings. And I would first convert everything to plain, with no accents, both for the needle and the haystack. Satyam PS: also, it is accepted practice to omit accents on uppercase letters such as in headings. It is not gramatically correct but a typographical convention which the printing industry has been using for ages: the accents simply don't fit nicely. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Zend Guard Performance Problem
Hi, Recently we bought Zend Guard and because of Zend encoder we have to use another Opcode cacher other than APC. After searching net I found eAccelerator. After installing eAccelerator with Zend Guard I saw more than %30 percent performance lost against Normal PHP + APC. Here my setup ;eAccelarator zend_extension=/usr/lib/php5/20060613+lfs/eaccelerator.so eaccelerator.shm_size=16 eaccelerator.cache_dir=/tmp/eaccelerator eaccelerator.enable=1 eaccelerator.optimizer=1 eaccelerator.check_mtime=1 eaccelerator.debug=0 eaccelerator.filter= eaccelerator.shm_max=0 eaccelerator.shm_ttl=0 eaccelerator.shm_prune_period=0 eaccelerator.shm_only=0 eaccelerator.compress=1 eaccelerator.compress_level=9 [Zend] zend_extension_manager.optimizer=/usr/local/Zend/lib/Optimizer-3.2.6 zend_extension_manager.optimizer_ts=/usr/local/Zend/lib/Optimizer_TS-3.2.6 zend_optimizer.version=3.2.6 zend_extension=/usr/local/Zend/lib/ZendExtensionManager.so zend_extension_ts=/usr/local/Zend/lib/ZendExtensionManager_TS.so E accelerator gives %100 boost for normal php and not much as APC. Is anyone have any idea about this ? Any suggestion to another opcode cacher and or Zend Guard options. Regards Sancar -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Zend Guard Performance Problem
Sancar Saran wrote: Hi, Recently we bought Zend Guard and because of Zend encoder we have to use another Opcode cacher other than APC. After searching net I found eAccelerator. After installing eAccelerator with Zend Guard I saw more than %30 percent performance lost against Normal PHP + APC. Wouldn't it be better to talk to Zend directly about this? Since you've purchased their software they give you support and are pretty helpful. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can i convert one object to another. Convert Exception object to MyException Object.
2007. 03. 28, szerda keltezéssel 08.55-kor Mathijs ezt írta: Hello there, I am trying to convert one object to another, something like clone. For example. --- class MyException extends Exception { // My functions etc.. etc.. } function ExceptionHandler($exception) { // Convert an NoN MyException to an MyException } set_exception_handler('ExceptionHandler'); --- Then when i do a: throw new Exception('My Message', 1); why not use throw new MyException('My Message', 1); and then you don't have to convert it greets Zoltán Németh And i don't catch it my self, it will get into the ExceptionHandler. Now i have some special methods within MyException to handle stuff. And i want to copy/convert the $exception (Exception) object to a MyException object to use its methods. Thx in advanced. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Zend Guard Performance Problem
On Wednesday 28 March 2007 11:36, Chris wrote: Sancar Saran wrote: Hi, Recently we bought Zend Guard and because of Zend encoder we have to use another Opcode cacher other than APC. After searching net I found eAccelerator. After installing eAccelerator with Zend Guard I saw more than %30 percent performance lost against Normal PHP + APC. Wouldn't it be better to talk to Zend directly about this? Since you've purchased their software they give you support and are pretty helpful. Really ???, Owww how can I miss this Maybe you did not notice they sell own Expensive opcode cache... If I understand your point of view, I can guess your reply. If you had rich enogh to buy a encoder, you can buy that zend cache. Thank you... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HELO command when sending email using PHP
Hi all. I am sending emails using the SMTP connection with PHP using the HTMLMimeMail class. Now there is a setting there for the HELO command text, can anyone explain to me what this is and what it should be set to? TIA. -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 469 1052 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Zend Guard Performance Problem
Sancar Saran wrote: On Wednesday 28 March 2007 11:36, Chris wrote: Sancar Saran wrote: Hi, Recently we bought Zend Guard and because of Zend encoder we have to use another Opcode cacher other than APC. After searching net I found eAccelerator. After installing eAccelerator with Zend Guard I saw more than %30 percent performance lost against Normal PHP + APC. Wouldn't it be better to talk to Zend directly about this? Since you've purchased their software they give you support and are pretty helpful. Really ???, Owww how can I miss this Maybe you did not notice they sell own Expensive opcode cache... If I understand your point of view, I can guess your reply. If you had rich enogh to buy a encoder, you can buy that zend cache. your assumption, as to what he really meant, is unfounded - the mindset required to go from what he said to what your assuming he said is not becoming of anyone who wants to call himself a programmer. go to Zend, you gave them money so you'll find they will give you advice, and explain your problem - quite probably they will have a solution that will satify you and if they just throw the 'buy ZendCache' advice in your face *then* you can BITCH AT THEM for their 'take-your-money-and-leave-out-to-dry' attitude not people on this list (who, generally, have nothing to do with Zend). right now you have no idea what their stance might be, you might ask them and they'll come back at you with 'use APC, but change ini setting X Y and Z' Thank you... your welcome. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELO command when sending email using PHP
please check the RFC 821, it shows the SMTP protocol. HELO domain.com it should fill your Mail server domain in order to prevent email going through most of anti-spam. - Original Message - From: Angelo Zanetti [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Wednesday, March 28, 2007 5:10 PM Subject: [PHP] HELO command when sending email using PHP Hi all. I am sending emails using the SMTP connection with PHP using the HTMLMimeMail class. Now there is a setting there for the HELO command text, can anyone explain to me what this is and what it should be set to? TIA. -- Angelo Zanetti Systems developer *Telephone:* +27 (021) 469 1052 *Mobile:* +27 (0) 72 441 3355 *Fax:*+27 (0) 86 681 5885 * Web:* http://www.zlogic.co.za *E-Mail:* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELO command when sending email using PHP
demo wrote: please check the RFC 821, it shows the SMTP protocol. HELO domain.com it should fill your Mail server domain in order to prevent email going through most of anti-spam. Thanks, so if Im running localhost, the HELO command will also be localhost? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELO command when sending email using PHP
by the way, here is php issues maillist not EMAIL issues:) if any problem with SMTP or email, please contact me directly -- http://tssoft.3322.org:8080/2.1/ demo:demodemo it's my email server developped by MSVC - Original Message - From: Angelo Zanetti [EMAIL PROTECTED] To: demo [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Wednesday, March 28, 2007 5:33 PM Subject: Re: [PHP] HELO command when sending email using PHP demo wrote: please check the RFC 821, it shows the SMTP protocol. HELO domain.com it should fill your Mail server domain in order to prevent email going through most of anti-spam. Thanks, so if Im running localhost, the HELO command will also be localhost? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDO mssql + multiple rowsets
Hi! I want to use PDO in my apps for connecting to several RDBSs, one of them, sql server 2000 and 2005. I tried to use as DSN something like mssql:... (as I've seen in the php manual pages) but I get a PDOException with the message Unable to open PDO connection [wrapped: could not find driver]. I can work well with the mssql built-in functions (like mssql_connect, mssql_query and so on...) and even I can almost work perfectly using in my dsn dblib: So first question: is the PDO's driver mssql deprecated or is it me doing something wrong in the PHP installation? BTW, I use php-5.2.1 In case that the answer to the first question is that mssql is no more used as a PDO driver, I have a problem... I have stored procedures in sql server that return multiple rowsets, I've seen that PDO offers functionability to manage this, but not for the dblib driver... if I try to use the $stmt-nextRowSet() method, I get an exception like Driver does not support this function: driver does not support multiple rowsets What can I do then to work with my stored procs? Thanks in advance
Re: [PHP] How can i convert one object to another. Convert Exception object to MyException Object.
Mathijs wrote: Hello there, I am trying to convert one object to another, something like clone. For example. --- class MyException extends Exception { // My functions etc.. etc.. } function ExceptionHandler($exception) { // Convert an NoN MyException to an MyException } set_exception_handler('ExceptionHandler'); --- Then when i do a: throw new Exception('My Message', 1); lets assume you can't throw a MyException to start with then, although it does beg the question why. secondly if the Exception reaches ExceptionHandler what is the point of converting it? it would seem to me that rethrowing a MyException at that point would only result in an uncaught exception, no? anyway here is some untest stuff, although going by the manual it's gonig to be a partial solution (given that the methods or Exception are final) depending on what exactly you do/want with MyException: class MyWrapperException extends MyException { private $mytrace; function __construct($e) { parent::__construct(); // no idea if these will be set properly $this-message = $e-getMessage(); $this-code = $e-getCode(); $this-file = $e-getFile(); $this-line = $e-getLine(); // it doesn't seem possible to override the stack trace of // an exception $this-mytrace = $e-getTrace(); } } function ExceptionHandler($e) { $my = new MyWrapperException($e); // do something with $my } And i don't catch it my self, it will get into the ExceptionHandler. Now i have some special methods within MyException to handle stuff. And i want to copy/convert the $exception (Exception) object to a MyException object to use its methods. Thx in advanced. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] HELO command when sending email using PHP
localhost is ok if u just send mail in the LAN. if you send mail in the internet, it may not be ok, bcoz it will be cut by anti-spam. most smtp servers always validate your HELO area and your DNS and check if them match. - Original Message - From: Angelo Zanetti [EMAIL PROTECTED] To: demo [EMAIL PROTECTED] Cc: php-general@lists.php.net Sent: Wednesday, March 28, 2007 5:33 PM Subject: Re: [PHP] HELO command when sending email using PHP demo wrote: please check the RFC 821, it shows the SMTP protocol. HELO domain.com it should fill your Mail server domain in order to prevent email going through most of anti-spam. Thanks, so if Im running localhost, the HELO command will also be localhost? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] POST + QUERY
using mssql_fetch_assoc worked out great. I had actually typed it in before but the code formatting didn't change the color of the text like it normally does for my mssql functions so I assumed it wasn't valid and deleted it. Thanks to everyone for your help! On 3/27/07, Jim Lucas [EMAIL PROTECTED] wrote: Dan Shirah wrote: Okay, I thought this was VERY simple, but I cannot wrap my mind around what I am doing wrong. echo $_POST['max_id']; *The echo returns the correct result *if($_POST['max_id'] ='') { *This is suppose to run the below query if $_POST['max_id'] is not blank* $max_id = $_POST['max_id']; *Sets my POST value to a variable* $info = SELECT * FROM payment_request WHERE id = '$max_id'; *Selects record from my database by the matching ID's* $result_info = mssql_query($info) or die(mssql_error()); *Puts the query results into a variable* $row_info = ifx_fetch_row($result_info); *Makes a row in an array for all the returned fields from my query* $my_info = $row_info['my_value']; input type=Text value=?php echo $my_info; ? size=20 maxlength=16 name=my_value *However, this box returns no data.* I should be using if($_POST['max_id'] ='') { and notif($_POST['max_id'] !=='') { correct? Since it is a comparative function just the = should be correct. Can someone take a look at this solution and tell me if this would be a descent solution for his problem? I use this logic all over my code base, let me know if it is efficient, clean, well structured, etc... if ( isset($_POST['max_id']) ) { $max_id = (int)$_POST['max_id']; if ( empty($max_id) ) { die('not a valid id'); # or some other, more graceful, way of catching the error } $SQL = SELECT * FROM payment_request WHERE id = '{$max_id}'; if ( ( $result_info = mssql_query($SQL) ) === false ) { die(mssql_error()); # again, maybe something more graceful here } if ( mssql_num_rows( $result_info ) == 0 ) { die('nothing to display'); # again, maybe something more graceful here } else { while ( $row_info = mssql_fetch_array($result_info) ) { echo 'input type=Text value='.$row_info['my_value']. ' size=20 maxlength=16 name=my_value'; } } } -- Enjoy, Jim Lucas Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree. - Rush
Re: [PHP] Language detection with PHP
On 28/03/07, Satyam [EMAIL PROTECTED] wrote: if you find accented letters, it is a sure sign that it is not English That's a rather naïve approach. Written accents in English may be rather passé, but they do exist. -robin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Zend Guard Performance Problem
On 3/28/07, Sancar Saran [EMAIL PROTECTED] wrote: On Wednesday 28 March 2007 11:36, Chris wrote: Sancar Saran wrote: Hi, Recently we bought Zend Guard and because of Zend encoder we have to use another Opcode cacher other than APC. After searching net I found eAccelerator. After installing eAccelerator with Zend Guard I saw more than %30 percent performance lost against Normal PHP + APC. Wouldn't it be better to talk to Zend directly about this? Since you've purchased their software they give you support and are pretty helpful. Really ???, Owww how can I miss this Maybe you did not notice they sell own Expensive opcode cache... If I understand your point of view, I can guess your reply. If you had rich enogh to buy a encoder, you can buy that zend cache. If you have a performance drop of that much something is going wrong with the interaction between zend apc. Two sets of people can solve this: - zend - apc. Zend is the obvious choice because they have access to their source code. Plus you paid for their software - which includes support. They might just go Option X in APC doesn't work well with Zend Guard - change this setting Or they might go Hey, that's really crap, no idea what's going on there - give us access to your server or send us a backtrace Or they might say something else. You don't know until you ask. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using for loop in function
Richard Kurth wrote: The function below will create a group of checkboxes it will also check the checkbox that is stored in the table field that is in $select_value this works fine if there is only one value in the variable but if there is more stored like 1,2,3,4 it will not work. I am trying to figure out how to use the following for loop to add the number to each checkbox and if they match mark the checkbox checked $ExplodeIt = explode(,,$select_value,,); $Count = count($ExplodeIt); for ($i=0; $i $Count; $i++) { } $select_value = 1,2,3,4; $ExplodeIt = explode(,,$select_value,,); Using print_r(), you will get Array ( [0] = 1,2,3,4 ) count($ExplodeIt) = 1 $ExplodeIt = explode(,,$select_value); Using print_r(), you will get: Array ( [0] = 1 [1] = 2 [2] = 3 [3] = 4 ) count($ExplodeIt) = 4 -- _ Myron Turner http://www.room535.org http://www.bstatzero.org http://www.mturner.org/XML_PullParser/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5.2.1: Some scripts are being parsed, but most aren't
Mario Guenterberg wrote: On Tue, Mar 27, 2007 at 10:22:40PM -0700, Eddie wrote: Hi all, Previously, I had installed Apache 1.3.37 with PHP 5.2.1 as a static module on Ubuntu 6.06. I am having a problem where, for some reason, some of my PHP scripts just show source code, while some are parsed. Hi... I have a problem something similar. Any scripts would be parsed, any would be downloaded in fireofx 2.x. I use Ubuntu 6.10. My solution is to start the ancient Mozilla browser, with this browser works everything fine. I think it is a firefox problem?! My server is apache 2.0.55 with php 5.2.1. Greetings Mario It's hard to see how this could be a browser issue. Firefox does not parse the scripts. The scripts are parsed on the server, under Apache. The server outputs the result of the parsing and the browser displays the result. -- _ Myron Turner http://www.room535.org http://www.bstatzero.org http://www.mturner.org/XML_PullParser/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5.2.1: Some scripts are being parsed, but most aren't
On Wed, Mar 28, 2007 at 07:20:37AM -0500, Myron Turner wrote: It's hard to see how this could be a browser issue. Firefox does not parse the scripts. The scripts are parsed on the server, under Apache. The server outputs the result of the parsing and the browser displays the result. I know that the browser does not parse the scripts. But what the hell is the problem? I have changed the apache log settings to debug and nothing to see in the log files. The amusing of this is the old mozilla works fine with the same script. Firefox pop up a download window. The script is well formed, ?php ? tags are included. I would not be surprised when I see the source of the script in firefox. But a download window??? The problem is very irregularly. Sometimes the effect steps on new scripts, sometimes on old scripts that worked before. Greetings Mario -- - | havelsoft.com - Ihr Service Partner für Open Source | | Tel: 033876-21 966 | | Notruf: 0173-277 33 60 | | http://www.havelsoft.com| | | | Inhaber: Mario Günterberg | | Mützlitzer Strasse 19 | | 14715 Märkisch Luch | - signature.asc Description: Digital signature
Re: [PHP] PHP 5.2.1: Some scripts are being parsed, but most aren't
2007. 03. 28, szerda keltezéssel 14.42-kor Mario Guenterberg ezt írta: On Wed, Mar 28, 2007 at 07:20:37AM -0500, Myron Turner wrote: It's hard to see how this could be a browser issue. Firefox does not parse the scripts. The scripts are parsed on the server, under Apache. The server outputs the result of the parsing and the browser displays the result. I know that the browser does not parse the scripts. But what the hell is the problem? I have changed the apache log settings to debug and nothing to see in the log files. The amusing of this is the old mozilla works fine with the same script. Firefox pop up a download window. The script is well formed, ?php ? tags are included. I would not be surprised when I see the source of the script in firefox. But a download window??? the download window is maybe because of incorrect content-type headers. it is possible that the older browser does not take care about that header, so the content is displayed ok, but the newer browser reads the header, cannot interpret it and so offers the download window check out what headers are the script is sending out greets Zoltán Németh The problem is very irregularly. Sometimes the effect steps on new scripts, sometimes on old scripts that worked before. Greetings Mario -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP 5.2.1: Some scripts are being parsed, but most aren't
On Wed, Mar 28, 2007 at 01:50:39PM +0100, Colin Guthrie wrote: Should get you some output... check the headers, check the content etc. I've checked twice the big apache log files and found some segmentation faults! Mhm, with a vanilla apache 2.2.4 the problem did not emerge. I would change the default apache 2.0.55 from ubuntu to vanilla apache 2.2.4. Greetings and thanks Mario -- - | havelsoft.com - Ihr Service Partner für Open Source | | Tel: 033876-21 966 | | Notruf: 0173-277 33 60 | | http://www.havelsoft.com| | | | Inhaber: Mario Günterberg | | Mützlitzer Strasse 19 | | 14715 Märkisch Luch | - signature.asc Description: Digital signature
[PHP] Re: PHP 5.2.1: Some scripts are being parsed, but most aren't
Mario Guenterberg wrote: On Wed, Mar 28, 2007 at 07:20:37AM -0500, Myron Turner wrote: It's hard to see how this could be a browser issue. Firefox does not parse the scripts. The scripts are parsed on the server, under Apache. The server outputs the result of the parsing and the browser displays the result. I know that the browser does not parse the scripts. But what the hell is the problem? I have changed the apache log settings to debug and nothing to see in the log files. The amusing of this is the old mozilla works fine with the same script. Firefox pop up a download window. The script is well formed, ?php ? tags are included. I would not be surprised when I see the source of the script in firefox. But a download window??? The problem is very irregularly. Sometimes the effect steps on new scripts, sometimes on old scripts that worked before. Could this be some Apache thing related to gzip compression of delivery or something? e.g. perhaps firefox says it will accept gzip therefore apache somehow decided to send a gziped source file (which ff will silently ungzip). But mozilla, being older, does not advertise that it accepts gzip and therefore apache follows a different path that leads to the scripts being handled correctly. The above should serve as an example as I doubt that is the real cause but you have to think laterally to solve this one... i usually test things by telnetting to port 80 telnet host 80 GET /myscript.php HTTP/1.1 Host: www.myservername.com cr cr Should get you some output... check the headers, check the content etc. A slightly more userfriendly approach would be to use the firebug plugin for firefox or livehttpheaders plugin and look at what the server is supplying to you. Hope that helps. Col -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Language detection with PHP
On 3/28/07, Robin Vickery [EMAIL PROTECTED] wrote: On 28/03/07, Satyam [EMAIL PROTECTED] wrote: if you find accented letters, it is a sure sign that it is not English That's a rather naïve approach. Written accents in English may be rather passé, but they do exist. -robin What about names? if somebody writes Zoltán Németh, then you have your accents, but it still might be english :) Tijnema -- 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] Timezone offset
On 3/28/07, Chris Boget [EMAIL PROTECTED] wrote: My server's timezone is set to (GMT) Greenwish Mean Time : Dublin, Edinburgh, Lisbon, London. But when I echo out date( 'O' ), it's returning the offset as +0100 and not +. Why? I would think that it should return +. Am I wrong? thnx, Chris What about DST? Tijnema -- 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] Timezone offset
2007. 03. 28, szerda keltezéssel 10.24-kor Chris Boget ezt írta: My server's timezone is set to (GMT) Greenwish Mean Time : Dublin, Edinburgh, Lisbon, London. But when I echo out date( 'O' ), it's returning the offset as +0100 and not +. Why? I would think that it should return +. Am I wrong? maybe because of DST? (it summer time now which I think is +0100) greets Zoltán Németh thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timezone offset
On 3/28/07, Chris Boget [EMAIL PROTECTED] wrote: My server's timezone is set to (GMT) Greenwish Mean Time : Dublin, Edinburgh, Lisbon, London. But when I echo out date( 'O' ), it's returning the offset as +0100 and not +. Why? I would think that it should return +. Am I wrong? What about DST? Hmm, I didn't think the UK observed DST already. When did that happen? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timezone offset
On 3/28/07, Chris Boget [EMAIL PROTECTED] wrote: On 3/28/07, Chris Boget [EMAIL PROTECTED] wrote: My server's timezone is set to (GMT) Greenwish Mean Time : Dublin, Edinburgh, Lisbon, London. But when I echo out date( 'O' ), it's returning the offset as +0100 and not +. Why? I would think that it should return +. Am I wrong? What about DST? Hmm, I didn't think the UK observed DST already. When did that happen? thnx, Chris DST is +1 since last saturday :) Tijnema -- 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] Timezone offset
- Original Message - From: Chris Boget [EMAIL PROTECTED] My server's timezone is set to (GMT) Greenwish Mean Time : Dublin, Edinburgh, Lisbon, London. There you have why, you set it to GreenwiSh, which is kind of Greenwich but not quite. I think that being on the western end of Europe, those countries decided to adopt a more pan-European time zone, even if that does not match precisely their astronomical hour. That makes cross border businesses easier by having common working hours. It might also have to do with whether it is Savings Time or not. I remember going to the Greenwich observatory and the big clock there didn't show the local time at all. (and the line carved on the floor is not 0 longitude either, that line is more than a hundred meters east of the real geographical 0), Satyam But when I echo out date( 'O' ), it's returning the offset as +0100 and not +. Why? I would think that it should return +. Am I wrong? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.20/736 - Release Date: 27/03/2007 16:38 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timezone offset
Since about the US and most of the world that still do daylight savings started doing so, which was bout WWII. Most of Europe does, we changed this past weekend. We don't match the US in the dates, but we do it. In the Southern Hemisphere they do it the opposite way, since summer and winter come in opposite months of the calendar, so time differences with countries in different hemispheres (north south) might move about 2 hours along the year. Satyam - Original Message - From: Chris Boget [EMAIL PROTECTED] To: Tijnema ! [EMAIL PROTECTED] Cc: PHP General php-general@lists.php.net Sent: Wednesday, March 28, 2007 4:35 PM Subject: Re: [PHP] Timezone offset On 3/28/07, Chris Boget [EMAIL PROTECTED] wrote: My server's timezone is set to (GMT) Greenwish Mean Time : Dublin, Edinburgh, Lisbon, London. But when I echo out date( 'O' ), it's returning the offset as +0100 and not +. Why? I would think that it should return +. Am I wrong? What about DST? Hmm, I didn't think the UK observed DST already. When did that happen? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.446 / Virus Database: 268.18.20/736 - Release Date: 27/03/2007 16:38 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Timezone offset
My server's timezone is set to (GMT) Greenwish Mean Time : Dublin, Edinburgh, Lisbon, London. But when I echo out date( 'O' ), it's returning the offset as +0100 and not +. Why? I would think that it should return +. Am I wrong? thnx, Chris -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem with XSLT importStyleSheet
I've been trying to use PHP/XSLT on my desktop, running Fedora-6 Linux (with all current updates). The function importStyleSheet() seems to cause a Segmentation Violation, as eg in the following script from http://ie2.php.net/manual/en/function.xsl-xsltprocessor-construct.php // Example 2520. Creating an XSLTProcessor ?php $doc = new DOMDocument(); $xsl = new XSLTProcessor(); $doc-load($xsl_filename); $xsl-importStyleSheet($doc); $doc-load($xml_filename); echo $xsl-transformToXML($doc); ? [EMAIL PROTECTED] Test]# php ex2520.php // Example 2520. Creating an XSLTProcessor Segmentation fault Or this script from http://www.phpbuilder.com/manual/en/function.xsl-xsltprocessor-transform-to-xml.php ?php $xsl = new DOMDocument('1.0','UTF-8'); $xml = new DOMDocument('1.0','UTF-8'); $xml-loadXML('collection.xml'); $xsl-loadXML('collection.xsl'); $xsl-documentURI = 'collection.xsl'; $xslProc = new XSLTProcessor(); $xslProc-importStyleSheet($xsl); ? [EMAIL PROTECTED] Test]# php test29.php Segmentation fault I'd be very grateful if someone could check if these scripts work for you, so I can see if it is a problem with Fedora PHP, or with PHP itself, (or if I am doing something silly, which is quite probable). -- Timothy Murphy e-mail (80k only): tim /at/ birdsnest.maths.tcd.ie tel: +353-86-2336090, +353-1-2842366 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Job Opportunity
10 LAMP Developer (Linux, Apache, MySQL, and PHP/Perl or Python): Dealing with website-content management, security. For a prestigious online New York newspaper. It has to be ONSITE ONLY I also pay for referral fees. NYC, 6+ months on going $65/hr. * Responsibilities: * * Writing application and related database objects to enable users* * dynamic interaction with the nytimes.com web site * Integrating a diverse set of data sources including related databases, search engines, and XML data * Integrating feeds from 3rd parties into the nytimes.com content management system The ideal candidate must have high standards with regard to the finished product and must be concerned about the quality and maintainability of the underlying software. In addition, the ideal candidate possess the ability to design systems, communicate and work effectively with others, write scalable and high quality code, and deliver work on schedule. Necessary skills: * B.S./B.A. in Computer Science or a degree in a related field plus Computer Science coursework * 3-6 years web development work experience * Unix proficiency * Experience with one or more scripting languages such as Perl, PHP and Python * Strong working knowledge of RDBMS, SQL and basic database optimization concepts * Experience working with XML, XSL, XPath * Comfort with Regular Expressions * Ability to communicate effectively with business side clients to gather and translate functional specs * Working knowledge of HTML, Javascript * Experience working as part of a team * Strong verbal and written communication skills Desired skills: * Formal software development methodology * Experience writing shared and reusable components of code * Experience designing and tuning applications that can scale * Some background in a structured programming language, such as Java or C/C++ * Oracle-specific SQL, PL/SQL * Use of source control _ Efrain Sarmiento Technical Recruiter MISI company p: 212.355.5585 x332 f: 212.751.5964 c: 917.365.5656 [EMAIL PROTECTED] Informed Usability | Innovative Solutions | Reliable Sourcing www.misicompany.com http://www.misicompany.com/ _ The information contained in this message is sent in the strictest confidence for the addressee only. It is intended only for the use of the addressee and may contain legally privileged/confidential/proprietary information. If you have received this email in error you are requested to preserve its confidentiality and advise the sender.
Re: [PHP] PHP 5.2.1: Some scripts are being parsed, but most aren't
Zoltán Németh wrote: 2007. 03. 28, szerda keltezéssel 14.42-kor Mario Guenterberg ezt írta: On Wed, Mar 28, 2007 at 07:20:37AM -0500, Myron Turner wrote: It's hard to see how this could be a browser issue. Firefox does not parse the scripts. The scripts are parsed on the server, under Apache. The server outputs the result of the parsing and the browser displays the result. I know that the browser does not parse the scripts. But what the hell is the problem? I have changed the apache log settings to debug and nothing to see in the log files. The amusing of this is the old mozilla works fine with the same script. Firefox pop up a download window. The script is well formed, ?php ? tags are included. I would not be surprised when I see the source of the script in firefox. But a download window??? the download window is maybe because of incorrect content-type headers. it is possible that the older browser does not take care about that header, so the content is displayed ok, but the newer browser reads the header, cannot interpret it and so offers the download window check out what headers are the script is sending out greets Zoltán Németh The problem is very irregularly. Sometimes the effect steps on new scripts, sometimes on old scripts that worked before. Greetings Mario I think you have to keep in mind that the headers would not affect the actual content being sent to the browser from the server. If the script is parsed as php on the server, it will be sent as text/html to the browser and displayed as parsed. But if the server does not parse the script then the browser will receive a copy of the script itself and depending then on whether the browser recognizes the content-type as displayable, it will either display it or ask if you want to download it. -- _ Myron Turner http://www.room535.org http://www.bstatzero.org http://www.mturner.org/XML_PullParser/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP 5.2.1: Some scripts are being parsed, but most aren't
I've seen an issue similar to this a few times recently. It involved a phpBB board I log onto periodically. It seems that the server is really slow and after what seems to be a timeout period, sometimes I'll get a download request in Firefox. If I let it download, I get an empty file. I was worried that it was flaking and was actually sending PHP source code, but it didn't. This seems to only happen if the server times out. Like maybe the server is sending the PHP script to the PHP engine and not getting a response back as fast as it would like so it's assuming the engine failed. I've seen it happen once on another server, but this other server (again with phpBB) seems to be a bit quicker so only saw the issue once. But it appeared to be similar circumstances.. some kind of timeout interpretting the PHP script. Not sure if it's a web server issue. If maybe there's a setting in Apache to say wait another 5 seconds for script interpretting to be done and it wouldn't happen anymore. Don't know and don't have time to research. Just wanted to share a similar experience in case it gives any clues as to why yours is doing what it's doing. -TG = = = Original message = = = Zolt~~n N~~meth wrote: 2007. 03. 28, szerda keltez~~ssel 14.42-kor Mario Guenterberg ezt ~~rta: On Wed, Mar 28, 2007 at 07:20:37AM -0500, Myron Turner wrote: It's hard to see how this could be a browser issue. Firefox does not parse the scripts. The scripts are parsed on the server, under Apache. The server outputs the result of the parsing and the browser displays the result. I know that the browser does not parse the scripts. But what the hell is the problem? I have changed the apache log settings to debug and nothing to see in the log files. The amusing of this is the old mozilla works fine with the same script. Firefox pop up a download window. The script is well formed, ?php ? tags are included. I would not be surprised when I see the source of the script in firefox. But a download window??? the download window is maybe because of incorrect content-type headers. it is possible that the older browser does not take care about that header, so the content is displayed ok, but the newer browser reads the header, cannot interpret it and so offers the download window check out what headers are the script is sending out greets Zolt~~n N~~meth The problem is very irregularly. Sometimes the effect steps on new scripts, sometimes on old scripts that worked before. Greetings Mario I think you have to keep in mind that the headers would not affect the actual content being sent to the browser from the server. If the script is parsed as php on the server, it will be sent as text/html to the browser and displayed as parsed. But if the server does not parse the script then the browser will receive a copy of the script itself and depending then on whether the browser recognizes the content-type as displayable, it will either display it or ask if you want to download it. -- _ Myron Turner http://www.room535.org http://www.bstatzero.org http://www.mturner.org/XML_PullParser/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php ___ Sent by ePrompter, the premier email notification software. Free download at http://www.ePrompter.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] logging erros and user access to logs
Németh Zoltán wrote: 2007. 03. 15, csütörtök keltezéssel 16.08-kor Jason Joines ezt írta: Richard Lynch wrote: On Thu, March 15, 2007 2:47 pm, Jason Joines wrote: Richard Lynch wrote: On Thu, March 15, 2007 8:25 am, Jason Joines wrote: Richard Lynch wrote: Get the errors OFF the web page (display_errors OFF) and into the ?php error_reporting(E_PARSE); ini_set('display_errors','On'); ini_set('display_startup_errors','On'); include('mypage.php'); ? Then when debugging was done, just delete the debug script. I moved it to a test server and could get it to work but only if display_errors was set to on in the global php.ini file. I can't do that on the production server. The manual says display_errors can be overridden in a script. I used ini_get() to see if the value was actually being changed, it was. However, it still doesn't print the errors unless the global ini is set. Any ideas as to why it's not working? Put ?php phpinfo();? into the mypage.php and see if its Master and Local values are different for display_errors. If they are, then it worked, and you SHOULD see the errors. Well they weren't different so I guess it didn't work. Seems odd to me that get_ini would show it has having been changed but phpinfo doesn't. Sounds like a bug to me -- They ought to at least agree on what the setting is, even if you weren't allowed to change it... Check the bug reports and file one, I guess: http://bugs.php.net I thought I might try a modification of your virtual hosts suggestion. Perhaps create a virtual host with the same document root as the main virtual host but turn display_errors on globally for the debug vhost using phpflag. First I tried it in a .htaccess file and then in my main apache config file, httpd.conf. Each time resulted in the error: Invalid command 'phpflag', perhaps mis-spelled or defined by a module not included in the server configuration. you misspelled it, there is no phpflag command actually. there is php_flag command and php_value command which you can use in .htaccess files (php_flag for flags which can have On/Off states only, php_value for others) hope that helps Zoltán Németh I'm starting to think that all of the ini override stuff was implemented in a later version of PHP than I'm using. Haven't figured out when it was implemented yet though. Jason === Thanks, that was it. Now I can turn on display_errors in the apache config files or htaccess via php_flag. However, I never did get ini_set to work. Jason === -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timezone offset
Satyam wrote: - Original Message - From: Chris Boget [EMAIL PROTECTED] My server's timezone is set to (GMT) Greenwish Mean Time : Dublin, Edinburgh, Lisbon, London. There you have why, you set it to GreenwiSh, which is kind of Greenwich but not quite. I think that being on the western end of Europe, those countries decided to adopt a more pan-European time zone, even if that does not match precisely their astronomical hour. That makes cross border businesses easier by having common working hours. UK's timezone is GMT (+) while most other western European countries like Spain, France, Germany, etc are in GMT +1000. It might also have to do with whether it is Savings Time or not. This year, we all changed to DST last Sunday morning. -- * Zoner PhotoStudio 8 - Your Photos perfect, shared, organised! www.zoner.com/zps You can download your free version. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Displaying files from database
Hi. I'm storing an uploaded file into a MySQL database. I want the file to then be downloaded and viewed. Uploading looks like: snippet if (is_uploaded_file($file) $filename) { $handle = fopen ($file, 'r'); $resume[data] = base64_encode (fread ($handle, filesize ($file))); fclose($handle); $resume[type] = $_FILES['resume']['type']; $resume[size] = $_FILES['resume']['size']; } /snippet It loads into the database fine. If it's a word document, it merely spits out plain text. If it's a PDF, it says it can't open it. Downloading looks like: snippet $app = applications ($_GET[id]); header (Status: 200 OK); header (Cache-Control: must-revalidate, post-check=0, pre-check=0); header (Content-Length: .$app[size][0]); header (Content-Type: .$app[type][0]); header (Content-Disposition: attachment; filename=Resume-.$app [full][0]); echo $app[resume][0]; exit; /snippet What am I doing wrong?!! =D Thanks in advance. ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying files from database
On 3/28/07, Philip Thompson [EMAIL PROTECTED] wrote: Hi. I'm storing an uploaded file into a MySQL database. I want the file to then be downloaded and viewed. Uploading looks like: snippet if (is_uploaded_file($file) $filename) { $handle = fopen ($file, 'r'); $resume[data] = base64_encode (fread ($handle, filesize ($file))); fclose($handle); $resume[type] = $_FILES['resume']['type']; $resume[size] = $_FILES['resume']['size']; } /snippet It loads into the database fine. If it's a word document, it merely spits out plain text. If it's a PDF, it says it can't open it. Downloading looks like: snippet $app = applications ($_GET[id]); header (Status: 200 OK); header (Cache-Control: must-revalidate, post-check=0, pre-check=0); header (Content-Length: .$app[size][0]); header (Content-Type: .$app[type][0]); header (Content-Disposition: attachment; filename=Resume-.$app [full][0]); echo $app[resume][0]; exit; /snippet What am I doing wrong?!! =D Thanks in advance. ~Philip You base64_encode your file when reading, you should also base64_decode i think. so: echo base64_decode($app[resume][0]); And you get $app from $_GET, and later use it as an array. I hope you did some database actions between :) Tijnema -- 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] Timezone offset
On 3/28/07, Seak, Teng-Fong [EMAIL PROTECTED] wrote: Satyam wrote: - Original Message - From: Chris Boget [EMAIL PROTECTED] My server's timezone is set to (GMT) Greenwish Mean Time : Dublin, Edinburgh, Lisbon, London. There you have why, you set it to GreenwiSh, which is kind of Greenwich but not quite. I think that being on the western end of Europe, those countries decided to adopt a more pan-European time zone, even if that does not match precisely their astronomical hour. That makes cross border businesses easier by having common working hours. UK's timezone is GMT (+) while most other western European countries like Spain, France, Germany, etc are in GMT +1000. It might also have to do with whether it is Savings Time or not. This year, we all changed to DST last Sunday morning. You're right... I said saturday, but it was acutally sunday:) Saturday after midnight :) I live in the netherlands, and in winter time my time zone is CET (UTC/GMT + 1), now in summer time, my time zone is CEST (UTC/GMT + 2) I think that makes all difference in the problem. Tijnema -- * Zoner PhotoStudio 8 - Your Photos perfect, shared, organised! www.zoner.com/zps You can download your free version. -- 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] RHEL 5 PHP php-5.1.6-7.el5.src.rpm using freetds-0.63-1.2.el4.rf.x86_64.rpm Won't rpm
I can't use yum so that leaves me with making the rpm myself after hours of pain I am sending this email in hopes that someone can help. Download php-5.1.6-7.el5.src.rpm after exploding the rpm I put these 2 lines in the rpm. I am not sure if It should be in both places or not, in an ideal world someone would build a x86_64 rhel 5 rpm for me, but here I am just asking for help unless you already have it built. I need to connect to a MSSQL 2000 database When the rpm is building rpmbuild -bb /usr/src/redhat/SPECS/php.spec I get the below error msg , Thank you for using PHP. config.status: creating php5.spec config.status: creating main/build-defs.h config.status: creating scripts/phpize config.status: creating scripts/man1/phpize.1 config.status: creating scripts/php-config config.status: creating scripts/man1/php-config.1 config.status: creating sapi/cli/php.1 config.status: creating main/php_config.h config.status: executing default commands + --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d --disable-debug --with-pic --disable-rpath --without-pear --with-bz2 --with-curl --with-exec-dir=/usr/bin --with-freetype-dir=/usr --with-png-dir=/usr --enable-gd-native-ttf --without-gdbm --with-gettext --with-sybase-ct=/usr/local/freetds --with-gmp --with-iconv --with-jpeg-dir=/usr --with-openssl --with-png --with-pspell --with-expat-dir=/usr --with-pcre-regex=/usr --with-zlib --with-layout=GNU --enable-exif --enable-ftp --enable-magic-quotes --enable-sockets --enable-sysvsem --enable-sysvshm --enable-sysvmsg --enable-track-vars --enable-trans-sid --enable-yp --enable-wddx --with-kerberos --enable-ucd-snmp-hack --with-unixODBC=shared,/usr --enable-memory-limit --enable-shmop --enable-calendar --enable-dbx --enable-dio --with-mime-magic=/etc/httpd/conf/magic --without-sqlite --with-libxml-dir=/usr --with-xml --enable-force-cgi-redirect --enable-pcntl --with-imap=shared --with-imap-ssl --enable-mbstring=shared --enable-mbstr-enc-trans --enable-mbregex --with-ncurses=shared --with-gd=shared --enable-bcmath=shared --enable-dba=shared --with-db4=/usr --with-xmlrpc=shared --with-ldap=shared --with-mysql=shared,/usr --with-mysqli=shared,/usr/bin/mysql_config --enable-dom=shared --with-dom-xslt=/usr --with-dom-exslt=/usr --with-pgsql=shared --with-snmp=shared,/usr --enable-soap=shared --with-xsl=shared,/usr --enable-xmlreader=shared --enable-xmlwriter=shared --enable-fastcgi --enable-pdo=shared --with-pdo-odbc=shared,unixODBC,/usr --with-pdo-mysql=shared,/usr --with-pdo-pgsql=shared,/usr --with-pdo-sqlite=shared,/usr /var/tmp/rpm-tmp.15318: line 77: --with-config-file-path=/etc: No such file or directory error: Bad exit status from /var/tmp/rpm-tmp.15318 (%build) RPM build errors: Bad exit status from /var/tmp/rpm-tmp.15318 (%build) Line 77 is done ; ./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu \ --target=x86_64-redhat-linux-gnu \ --program-prefix= \ --prefix=/usr \ --exec-prefix=/usr \ --bindir=/usr/bin \ --sbindir=/usr/sbin \ --sysconfdir=/etc \ --datadir=/usr/share \ --includedir=/usr/include \ --libdir=/usr/lib64 \ --libexecdir=/usr/libexec \ --localstatedir=/var \ --sharedstatedir=/usr/com \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --cache-file=../config.cache \ --with-libdir=lib64 \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ -LINE 77 === What I gather it is talking about this below. # Generate files lists and stub .ini files for each subpackage for mod in pgsql mysql mysqli odbc ldap snmp xmlrpc imap \ mbstring ncurses gd dom xsl soap bcmath dba xmlreader xmlwriter \ pdo pdo_mysql pdo_pgsql pdo_odbc pdo_sqlite; do cat $RPM_BUILD_ROOT%{_sysconfdir}/php.d/${mod}.ini EOF ; Enable ${mod} extension module extension=${mod}.so EOF cat files.${mod} EOF %attr(755,root,root) %{_libdir}/php/modules/${mod}.so %config(noreplace) %attr(644,root,root) %{_sysconfdir}/php.d/${mod}.ini === php.spec+ # bison-1.875-2 seems to produce a broken parser; workaround. mkdir Zend cp ../Zend/zend_{language,ini}_{parser,scanner}.[ch] Zend ln -sf ../configure %configure \ --cache-file=../config.cache \ --with-libdir=%{_lib} \ --with-config-file-path=%{_sysconfdir} \ --with-config-file-scan-dir=%{_sysconfdir}/php.d \ --disable-debug \ --with-pic \ --disable-rpath \ --without-pear \ --with-bz2 \ --with-curl \ --with-exec-dir=%{_bindir} \ --with-freetype-dir=%{_prefix} \ --with-png-dir=%{_prefix} \ --enable-gd-native-ttf \ --without-gdbm \ --with-gettext \
Re: [PHP] Displaying files from database
Philip Thompson wrote: Hi. I'm storing an uploaded file into a MySQL database. I want the file to then be downloaded and viewed. Uploading looks like: Assuming you actually have a good reason *why* you are storing uploaded files in your database, how has the table been set-up? What is the table type and the column you are storing this file in? Is PHP set to automatically magic quote the data on insert? If so, you're in for a world of pain, so disable it. if (is_uploaded_file($file) $filename) { $handle = fopen ($file, 'r'); You should always fopen with 'rb' for binary safe, system-portable handling. Downloading looks like: snippet $app = applications ($_GET[id]); header (Status: 200 OK); header (Cache-Control: must-revalidate, post-check=0, pre-check=0); header (Content-Length: .$app[size][0]); header (Content-Type: .$app[type][0]); header (Content-Disposition: attachment; filename=Resume-.$app[full][0]); echo $app[resume][0]; exit; /snippet What am I doing wrong?!! =D Thanks in advance. What are the size of these files? First of all, you need to base DECODE your data before sending to the client. Secondly, check if SQL is automatically escaping the data, which will cause you no end of trouble. Third, if your files are larger than the maximum amount of memory a single PHP script can use on your server, your way of doing this will fail, because you are echoing out the data. Actually storing the files as files, and then using passthru() to send them to the browser avoids this limitation. As it stands, if there is a 4MB file, each call to your script for it will use 4MB of memory minimum, so I hope you've got a dogs-bollocks server there, or a pitifully low traffic site ;) Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk Never trust a computer you can't throw out of a window -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying files from database
On Mar 28, 2007, at 12:59 PM, Tijnema ! wrote: On 3/28/07, Philip Thompson [EMAIL PROTECTED] wrote: Hi. I'm storing an uploaded file into a MySQL database. I want the file to then be downloaded and viewed. Uploading looks like: snippet if (is_uploaded_file($file) $filename) { $handle = fopen ($file, 'r'); $resume[data] = base64_encode (fread ($handle, filesize ($file))); fclose($handle); $resume[type] = $_FILES['resume']['type']; $resume[size] = $_FILES['resume']['size']; } /snippet It loads into the database fine. If it's a word document, it merely spits out plain text. If it's a PDF, it says it can't open it. Downloading looks like: snippet $app = applications ($_GET[id]); header (Status: 200 OK); header (Cache-Control: must-revalidate, post-check=0, pre-check=0); header (Content-Length: .$app[size][0]); header (Content-Type: .$app[type][0]); header (Content-Disposition: attachment; filename=Resume-.$app [full][0]); echo $app[resume][0]; exit; /snippet What am I doing wrong?!! =D Thanks in advance. ~Philip You base64_encode your file when reading, you should also base64_decode i think. so: echo base64_decode($app[resume][0]); And you get $app from $_GET, and later use it as an array. I hope you did some database actions between :) Tijnema Yup, that was it - I needed to add the decode... of course the obvious. It works! And yes, I prevent SQL injection and other stuff - that's just not shown here. Thanks for the advice! =D ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem with XSLT importStyleSheet
On 3/28/07, Timothy Murphy [EMAIL PROTECTED] wrote: I've been trying to use PHP/XSLT on my desktop, running Fedora-6 Linux (with all current updates). The function importStyleSheet() seems to cause a Segmentation Violation, as eg in the following script from http://ie2.php.net/manual/en/function.xsl-xsltprocessor-construct.php // Example 2520. Creating an XSLTProcessor ?php $doc = new DOMDocument(); $xsl = new XSLTProcessor(); $doc-load($xsl_filename); $xsl-importStyleSheet($doc); $doc-load($xml_filename); echo $xsl-transformToXML($doc); ? [EMAIL PROTECTED] Test]# php ex2520.php // Example 2520. Creating an XSLTProcessor Segmentation fault Or this script from http://www.phpbuilder.com/manual/en/function.xsl-xsltprocessor-transform-to-xml.php ?php $xsl = new DOMDocument('1.0','UTF-8'); $xml = new DOMDocument('1.0','UTF-8'); $xml-loadXML('collection.xml'); $xsl-loadXML('collection.xsl'); $xsl-documentURI = 'collection.xsl'; $xslProc = new XSLTProcessor(); $xslProc-importStyleSheet($xsl); ? [EMAIL PROTECTED] Test]# php test29.php Segmentation fault I'd be very grateful if someone could check if these scripts work for you, so I can see if it is a problem with Fedora PHP, or with PHP itself, (or if I am doing something silly, which is quite probable). I have no problem with testing, i'm running home-made linux system with PHP5 PHP6 (Apache). Also running PHP5 under windows (Apache). Just need an example XSL/XML file to test:) Could you send one? (Off-list maybe because attachments are giving trouble sometimes on this list) Tijnema -- Timothy Murphy e-mail (80k only): tim /at/ birdsnest.maths.tcd.ie tel: +353-86-2336090, +353-1-2842366 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland -- 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] logging erros and user access to logs
Jason Joines-3 wrote: Richard Lynch wrote: On Thu, March 15, 2007 8:25 am, Jason Joines wrote: Richard Lynch wrote: Get the errors OFF the web page (display_errors OFF) and into the ?php error_reporting(E_PARSE); ini_set('display_errors','On'); ini_set('display_startup_errors','On'); include('mypage.php'); ? Then when debugging was done, just delete the debug script. I moved it to a test server and could get it to work but only if display_errors was set to on in the global php.ini file. I can't do that on the production server. The manual says display_errors can be overridden in a script. I used ini_get() to see if the value was actually being changed, it was. However, it still doesn't print the errors unless the global ini is set. Any ideas as to why it's not working? Put ?php phpinfo();? into the mypage.php and see if its Master and Local values are different for display_errors. If they are, then it worked, and you SHOULD see the errors. Well they weren't different so I guess it didn't work. Seems odd to me that get_ini would show it has having been changed but phpinfo doesn't. Jason === -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php phpinfo() only reflects values set in php.ini (globally), http.conf (f.e. per vhost) or .htaccess (per folder and below) and only if phpinfo is called from inside that folder/vhost. ini_set is only in the scope of your script. so you can't test the effects of your ini_set values using phpinfo() at all. you have to test the behaviour of the script or put a corresponding echo ini_get('...') after your ini_set. -- View this message in context: http://www.nabble.com/logging-erros-and-user-access-to-logs-tf3403238.html#a9718409 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] logging erros and user access to logs
On 3/28/07, Juergen Wind [EMAIL PROTECTED] wrote: Jason Joines-3 wrote: Richard Lynch wrote: On Thu, March 15, 2007 8:25 am, Jason Joines wrote: Richard Lynch wrote: Get the errors OFF the web page (display_errors OFF) and into the ?php error_reporting(E_PARSE); ini_set('display_errors','On'); ini_set('display_startup_errors','On'); include('mypage.php'); ? Then when debugging was done, just delete the debug script. I moved it to a test server and could get it to work but only if display_errors was set to on in the global php.ini file. I can't do that on the production server. The manual says display_errors can be overridden in a script. I used ini_get() to see if the value was actually being changed, it was. However, it still doesn't print the errors unless the global ini is set. Any ideas as to why it's not working? Put ?php phpinfo();? into the mypage.php and see if its Master and Local values are different for display_errors. If they are, then it worked, and you SHOULD see the errors. Well they weren't different so I guess it didn't work. Seems odd to me that get_ini would show it has having been changed but phpinfo doesn't. Jason === -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php phpinfo() only reflects values set in php.ini (globally), http.conf (f.e. per vhost) or .htaccess (per folder and below) and only if phpinfo is called from inside that folder/vhost. ini_set is only in the scope of your script. so you can't test the effects of your ini_set values using phpinfo() at all. you have to test the behaviour of the script or put a corresponding echo ini_get('...') after your ini_set. You can simply put the phpinfo() at the end of your script. It will show the ini_set items. If you don't believe me, try this script: ?php ini_set(allow_url_fopen,Off); phpinfo(); ? Under local value it will show you Off, and on master value it will show On (Atleast that's how i configured it :) ) Tijnema -- View this message in context: http://www.nabble.com/logging-erros-and-user-access-to-logs-tf3403238.html#a9718409 Sent from the PHP - General mailing list archive at Nabble.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] logging erros and user access to logs
Juergen Wind wrote: phpinfo() only reflects values set in php.ini (globally), http.conf (f.e. per vhost) or .htaccess (per folder and below) and only if phpinfo is called from inside that folder/vhost. ini_set is only in the scope of your script. so you can't test the effects of your ini_set values using phpinfo() at all. you have to test the behaviour of the script or put a corresponding echo ini_get('...') after your ini_set. to make it clear: my comment was meant for a separate file with phpinfo(); in it. but you can put phpinfo inside your script (after ini_set of course) like so: ?php ini_set('display_errors', 'Off'); error_reporting( E_ALL ); ini_set('error_log', 'LocalPhpErr.log'); ini_set('session.save_path', '/bad'); phpinfo(4); // core only session_start(); ? -- View this message in context: http://www.nabble.com/logging-erros-and-user-access-to-logs-tf3403238.html#a9718417 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Displaying files from database
On Mar 28, 2007, at 1:36 PM, Richard Davey wrote: Philip Thompson wrote: Hi. I'm storing an uploaded file into a MySQL database. I want the file to then be downloaded and viewed. Uploading looks like: Assuming you actually have a good reason *why* you are storing uploaded files in your database, how has the table been set-up? What is the table type and the column you are storing this file in? Is PHP set to automatically magic quote the data on insert? If so, you're in for a world of pain, so disable it. Storing in the database to keep the data all together. Don't want to deal with storing it elsewhere and keeping up with it. It's a first for me to do it this way. The column is type LONGBLOB. if (is_uploaded_file($file) $filename) { $handle = fopen ($file, 'r'); You should always fopen with 'rb' for binary safe, system-portable handling. I actually had it that way. When I gave the example, I had tested it both ways to see if that was where the problem was occurring. It's back to 'rb'. Downloading looks like: snippet $app = applications ($_GET[id]); header (Status: 200 OK); header (Cache-Control: must-revalidate, post-check=0, pre-check=0); header (Content-Length: .$app[size][0]); header (Content-Type: .$app[type][0]); header (Content-Disposition: attachment; filename=Resume-.$app [full][0]); echo $app[resume][0]; exit; /snippet What am I doing wrong?!! =D Thanks in advance. What are the size of these files? First of all, you need to base DECODE your data before sending to the client. Secondly, check if SQL is automatically escaping the data, which will cause you no end of trouble. Third, if your files are larger than the maximum amount of memory a single PHP script can use on your server, your way of doing this will fail, because you are echoing out the data. I limit the upload size, so I know that it *should* never reach the limit. Actually storing the files as files, and then using passthru() to send them to the browser avoids this limitation. As it stands, if there is a 4MB file, each call to your script for it will use 4MB of memory minimum, so I hope you've got a dogs-bollocks server there, or a pitifully low traffic site ;) Cheers, Rich ~Philip -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Date/time format?
Hi Everyone, First off, I'm using PHP 5.2.0 and apache 1.3.33 I am trying to figure out what format a string is in in a database. It's a timecard system that I have found on-line and I am attempting to figure out how to write a script that would give me everyones timecard for the month on one screen I can print out for accounting to use. Below is an example of one of the lines in the database, What I'm really interested in is how it represents the day. user dayjob_name minutes sequence root 1171774800 Production technology Manager 990 3 I have not been able to find ANY info about that format, other then other people using it in blogs. I think I can figure out the rest as I go if I know how to decode the day. Any help or pointers to the M would be GREATLY appreciated! :) -- Jason Pruim [EMAIL PROTECTED] Production Technology Manager MQC Specialist (2005 certified) 3251 132nd Ave Holland MI 49424 616.399.2355 www.raoset.com “Give me your tired, your poor, Your huddled masses yearning to breathe free, The wretched refuse of your teeming shore. Send these, the homeless tempest-tost to me, I lift my lamp beside the golden door!” From “The New Colossus,” by Emma Lazarus smime.p7s Description: S/MIME cryptographic signature
Re: [PHP] Date/time format?
Jason Pruim wrote: Hi Everyone, First off, I'm using PHP 5.2.0 and apache 1.3.33 I am trying to figure out what format a string is in in a database. It's a timecard system that I have found on-line and I am attempting to figure out how to write a script that would give me everyones timecard for the month on one screen I can print out for accounting to use. Below is an example of one of the lines in the database, What I'm really interested in is how it represents the day. user dayjob_name minutes sequence root 1171774800 Production technology Manager 990 3 Could it be Feb 18, 2007 ?? If so, then that is just the unix timestamp. echo date('r', 1171774800); more data functions at: http://www.php.net/date -B I have not been able to find ANY info about that format, other then other people using it in blogs. I think I can figure out the rest as I go if I know how to decode the day. Any help or pointers to the M would be GREATLY appreciated! :) -- Jason Pruim [EMAIL PROTECTED] Production Technology Manager MQC Specialist (2005 certified) 3251 132nd Ave Holland MI 49424 616.399.2355 www.raoset.com “Give me your tired, your poor, Your huddled masses yearning to breathe free, The wretched refuse of your teeming shore. Send these, the homeless tempest-tost to me, I lift my lamp beside the golden door!” From “The New Colossus,” by Emma Lazarus -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date/time format?
Jason Pruim wrote: Hi Everyone, First off, I'm using PHP 5.2.0 and apache 1.3.33 I am trying to figure out what format a string is in in a database. It's a timecard system that I have found on-line and I am attempting to figure out how to write a script that would give me everyones timecard for the month on one screen I can print out for accounting to use. Below is an example of one of the lines in the database, What I'm really interested in is how it represents the day. user dayjob_name minutes sequence root 1171774800 Production technology Manager 990 3 Looks like epoch time. Use date(Y-m-d,$epochtime); to get a standard date string out of it. www.php.net/date/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date/time format?
2007. 03. 28, szerda keltezéssel 15.35-kor Jason Pruim ezt írta: Hi Everyone, First off, I'm using PHP 5.2.0 and apache 1.3.33 I am trying to figure out what format a string is in in a database. It's a timecard system that I have found on-line and I am attempting to figure out how to write a script that would give me everyones timecard for the month on one screen I can print out for accounting to use. Below is an example of one of the lines in the database, What I'm really interested in is how it represents the day. user dayjob_name minutes sequence root 1171774800 Production technology Manager 990 3 I have not been able to find ANY info about that format, other then other people using it in blogs. I think I can figure out the rest as I go if I know how to decode the day. Any help or pointers to the M would be GREATLY appreciated! :) what does strtotime return for that string? greets Zoltán Németh -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date/time format?
Zoltán Németh wrote: 2007. 03. 28, szerda keltezéssel 15.35-kor Jason Pruim ezt írta: Hi Everyone, First off, I'm using PHP 5.2.0 and apache 1.3.33 I am trying to figure out what format a string is in in a database. It's a timecard system that I have found on-line and I am attempting to figure out how to write a script that would give me everyones timecard for the month on one screen I can print out for accounting to use. Below is an example of one of the lines in the database, What I'm really interested in is how it represents the day. user dayjob_name minutes sequence root 1171774800 Production technology Manager 990 3 I have not been able to find ANY info about that format, other then other people using it in blogs. I think I can figure out the rest as I go if I know how to decode the day. Any help or pointers to the M would be GREATLY appreciated! :) what does strtotime return for that string? It's already a time, strtotime should return FALSE. It probably can't parse that string to a time. Travis D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Date/time format?
Jason wrote: Hi Everyone, First off, I'm using PHP 5.2.0 and apache 1.3.33 I am trying to figure out what format a string is in in a database. It's a timecard system that I have found on-line and I am attempting to figure out how to write a script that would give me everyones timecard for the month on one screen I can print out for accounting to use. Below is an example of one of the lines in the database, What I'm really interested in is how it represents the day. user dayjob_name minutes sequence root 1171774800 Production technology Manager 990 3 I have not been able to find ANY info about that format, other then other people using it in blogs. I think I can figure out the rest as I go if I know how to decode the day. Any help or pointers to the M would be GREATLY appreciated! :) That is a UNIX timestamp, which is the type of date that the php date() function takes as a 2nd parameter. So for example, ?php echo date(m/d/Y, $row['day']) // Output: 02/18/2007 ? You can also format it in the query like so: mysql SELECT FROM_UNIXTIME(day) AS theDate FROM myTable; Output: 2007-02-18 00:00:00 If you want to insert new records in the table you can either use time() in php, or UNIX_TIMESTAMP(NOW()) in the query. HTH, -B -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Upgrade: 5 or 6
Hi all. I've reading on some sites [1,2] that PHP 6 is comming soon... What should I do? Migrate my server and apps to PHP 5 now and, later to PHP 6, or wait some more time and migrate all to PHP 6? TIA -- Davi Vidal [EMAIL PROTECTED] [EMAIL PROTECTED] -- Agora com fortune: The main thing is the play itself. I swear that greed for money has nothing to do with it, although heaven knows I am sorely in need of money. - Feodor Dostoyevsky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Firefox Extension (Firefox 2.x.x.x)
If you're like me, you spend your fair share of time going to the PHP website to check specs, changes, or even to refresh your brain with PHP's functions. So today I threw together a simple plugin for Firefox 2 that will let you type in the name of the function and be brought right to the function page. Or, if you mistype it, it will provide suggestions. How does it work so awesome? Because it uses the PHP search engine and Mozilla's OSD. All I did was whip it together as a plugin. Download and installation instructions: http://isawit.com/php_search.php Hope it saves everyone a microsecond or two. We now return you to your regularly-scheduled, SPAM-filled inbox. -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107
Re: [PHP] Date/time format?
2007. 03. 28, szerda keltezéssel 14.48-kor Travis Doherty ezt írta: Zoltán Németh wrote: 2007. 03. 28, szerda keltezéssel 15.35-kor Jason Pruim ezt írta: Hi Everyone, First off, I'm using PHP 5.2.0 and apache 1.3.33 I am trying to figure out what format a string is in in a database. It's a timecard system that I have found on-line and I am attempting to figure out how to write a script that would give me everyones timecard for the month on one screen I can print out for accounting to use. Below is an example of one of the lines in the database, What I'm really interested in is how it represents the day. user dayjob_name minutes sequence root 1171774800 Production technology Manager 990 3 I have not been able to find ANY info about that format, other then other people using it in blogs. I think I can figure out the rest as I go if I know how to decode the day. Any help or pointers to the M would be GREATLY appreciated! :) what does strtotime return for that string? It's already a time, strtotime should return FALSE. It probably can't parse that string to a time. sorry I meant strftime ;) greets Zoltán Németh Travis D -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Upgrade: 5 or 6
On 3/28/07, Davi [EMAIL PROTECTED] wrote: Hi all. I've reading on some sites [1,2] that PHP 6 is comming soon... What should I do? Migrate my server and apps to PHP 5 now and, later to PHP 6, or wait some more time and migrate all to PHP 6? TIA I think you should migrate to PHP5 now, as i think it will take some time before a real PHP6 release is coming. I don't know where you useit for. Is it development or productional? For development you could work with a CVS Snapshot, but that's not recommended for productional. But of course if you don't have any problems with the PHP you are currently using (I guess PHP 4.x), then it's not really needed to upgrade. Tijnema -- Davi Vidal [EMAIL PROTECTED] [EMAIL PROTECTED] -- Agora com fortune: The main thing is the play itself. I swear that greed for money has nothing to do with it, although heaven knows I am sorely in need of money. - Feodor Dostoyevsky -- 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] Firefox Extension (Firefox 2.x.x.x)
On 3/28/07, Daniel Brown [EMAIL PROTECTED] wrote: If you're like me, you spend your fair share of time going to the PHP website to check specs, changes, or even to refresh your brain with PHP's functions. So today I threw together a simple plugin for Firefox 2 that will let you type in the name of the function and be brought right to the function page. Or, if you mistype it, it will provide suggestions. How does it work so awesome? Because it uses the PHP search engine and Mozilla's OSD. All I did was whip it together as a plugin. Download and installation instructions: http://isawit.com/php_search.php Hope it saves everyone a microsecond or two. We now return you to your regularly-scheduled, SPAM-filled inbox. Hmm, i just keep using my regular way, going to www.php.net/function misspelled items are corrected, suggestions are provided :) Tijnema -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Firefox Extension (Firefox 2.x.x.x)
Quoting Tijnema ! [EMAIL PROTECTED]: On 3/28/07, Daniel Brown [EMAIL PROTECTED] wrote: If you're like me, you spend your fair share of time going to the PHP website to check specs, changes, or even to refresh your brain with PHP's functions. So today I threw together a simple plugin for Firefox 2 that will let you type in the name of the function and be brought right to the function page. Or, if you mistype it, it will provide suggestions. How does it work so awesome? Because it uses the PHP search engine and Mozilla's OSD. All I did was whip it together as a plugin. Download and installation instructions: http://isawit.com/php_search.php Hope it saves everyone a microsecond or two. We now return you to your regularly-scheduled, SPAM-filled inbox. Hmm, i just keep using my regular way, going to www.php.net/function misspelled items are corrected, suggestions are provided :) Thanks for the extention. It does save a few seconds. I appreciate it. Siavash Miri Computer Programmer Simon Fraser University Tijnema -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 -- 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] PHP Upgrade: 5 or 6
Tijnema ! wrote: On 3/28/07, Davi [EMAIL PROTECTED] wrote: Hi all. I've reading on some sites [1,2] that PHP 6 is comming soon... What should I do? Migrate my server and apps to PHP 5 now and, later to PHP 6, or wait some more time and migrate all to PHP 6? TIA I think you should migrate to PHP5 now, as i think it will take some time before a real PHP6 release is coming. I don't know where you useit for. Is it development or productional? For development you could work with a CVS Snapshot, but that's not recommended for productional. But of course if you don't have any problems with the PHP you are currently using (I guess PHP 4.x), then it's not really needed to upgrade. I agree and disagree - I agree with you should migrate to PHP5 *NOW* (my emphasis added) and I disagree with then it's not really needed to upgrade. (unless you don't care about security.) Ilia Alshanetsky gave a great talk on this topic recently, http://ilia.ws/talks/ scroll to the bottom to (PDF) Migrating to PHP 5.2.1. Travis Doherty -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] logging erros and user access to logs
Tijnema ! wrote: You can simply put the phpinfo() at the end of your script. It will show the ini_set items. If you don't believe me, try this script: ?php ini_set(allow_url_fopen,Off); phpinfo(); ? Under local value it will show you Off, and on master value it will show On (Atleast that's how i configured it :) ) Tijnema that just came into my mind when i hit the submit button ;) but as the OP told us he coulndt see any effect in phpinfo i thought he used phpinfo in a separate file. -- View this message in context: http://www.nabble.com/logging-erros-and-user-access-to-logs-tf3403238.html#a9721912 Sent from the PHP - General mailing list archive at Nabble.com. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP Upgrade: 5 or 6
On 3/28/07, Travis Doherty [EMAIL PROTECTED] wrote: Tijnema ! wrote: On 3/28/07, Davi [EMAIL PROTECTED] wrote: Hi all. I've reading on some sites [1,2] that PHP 6 is comming soon... What should I do? Migrate my server and apps to PHP 5 now and, later to PHP 6, or wait some more time and migrate all to PHP 6? TIA I think you should migrate to PHP5 now, as i think it will take some time before a real PHP6 release is coming. I don't know where you useit for. Is it development or productional? For development you could work with a CVS Snapshot, but that's not recommended for productional. But of course if you don't have any problems with the PHP you are currently using (I guess PHP 4.x), then it's not really needed to upgrade. I agree and disagree - I agree with you should migrate to PHP5 *NOW* (my emphasis added) and I disagree with then it's not really needed to upgrade. (unless you don't care about security.) Ilia Alshanetsky gave a great talk on this topic recently, http://ilia.ws/talks/ scroll to the bottom to (PDF) Migrating to PHP 5.2.1. Travis Doherty I said if you don't have any problems, so also no problems with security :) Tijnema -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Firefox Extension (Firefox 2.x.x.x)
Daniel Brown wrote: If you're like me, you spend your fair share of time going to the PHP website to check specs, changes, or even to refresh your brain with PHP's functions. So today I threw together a simple plugin for Firefox 2 that will let you type in the name of the function and be brought right to the function page. Or, if you mistype it, it will provide suggestions. How does it work so awesome? Because it uses the PHP search engine and Mozilla's OSD. All I did was whip it together as a plugin. Download and installation instructions: http://isawit.com/php_search.php Hope it saves everyone a microsecond or two. We now return you to your regularly-scheduled, SPAM-filled inbox. Since you mention FF, I will just add that this is possible without using an extension. And a plus, is that it is compatible with pre FF 2.x. Not all, but most versions. Open your bookmarks manager In the 'Quick Searches' folder create a new bookmark. In FF 2.x you don't have a 'Quick Searches' folder (at least I didn't on a fresh install), don't worry. It will work from any folder. Just better to be a little more organized. Enter the following information: (the key is the 'keyword' field) Name: PHP.net Location: http://www.php.net/%s Keyword: php Description: Type php search term in the addressbar to perform a PHP.net search Press 'Ok' Close your bookmarks manager Now, open a new tab, enter 'php date' This should redirect you to the php.net website and display you your results. -- Enjoy, Jim Lucas Different eyes see different things. Different hearts beat on different strings. But there are times for you and me when all such things agree. - Rush -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Problem with XSLT importStyleSheet
posted mailed Tijnema ! wrote: I've been trying to use PHP/XSLT on my desktop, running Fedora-6 Linux (with all current updates). The function importStyleSheet() seems to cause a Segmentation Violation, Thanks for your response. I have no problem with testing, i'm running home-made linux system with PHP5 PHP6 (Apache). Also running PHP5 under windows (Apache). Just need an example XSL/XML file to test:) Could you send one? (Off-list maybe because attachments are giving trouble sometimes on this list) Actually, the first example I gave comes from what I assume is the official PHP manual at http://ie.php.net/xsl%22%3E. There are 3 files, collection.xml, collection.xsl and the actual PHP script, Example 2526 (which I call ex2526.php), from http://ie.php.net/manual/en/function.xsl-xsltprocessor-transform-to-xml.php All 3 files are very short, so I give them here: collection cd titleFight for your mind/title artistBen Harper/artist year1995/year /cd cd titleElectric Ladyland/title artistJimi Hendrix/artist year1997/year /cd /collection xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xsl:param name=owner select=Nicolas Eliaszewicz'/ xsl:output method=html encoding=iso-8859-1 indent=no/ xsl:template match=collection Hey! Welcome to xsl:value-of select=$owner/'s sweet CD collection! xsl:apply-templates/ /xsl:template xsl:template match=cd h1xsl:value-of select=title//h1 h2by xsl:value-of select=artist/ - xsl:value-of select=year//h2 hr / /xsl:template /xsl:stylesheet ?php // Load the XML source $xml = new DOMDocument; $xml-load('collection.xml'); $xsl = new DOMDocument; $xsl-load('collection.xsl'); // Configure the transformer $proc = new XSLTProcessor; $proc-importStyleSheet($xsl); // attach the xsl rules echo $proc-transformToXML($xml); ? Now I get [EMAIL PROTECTED] Test]# php ex2526.php Segmentation fault I tried a few other examples, but all those with importStyleSheet() in them caused the same Segmentation fault. -- Timothy Murphy e-mail (80k only): tim /at/ birdsnest.maths.tcd.ie tel: +353-86-2336090, +353-1-2842366 s-mail: School of Mathematics, Trinity College, Dublin 2, Ireland -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Firefox Extension (Firefox 2.x.x.x)
Jim Lucas wrote: Now, open a new tab, enter 'php date' I've been using this since FF implemented it. I have others too: ggl for google, mysql for mysql manual search etc. I know FF has a google search bar but it just takes up space when I can type F6 + ggl something pretty damn quick ;) Col. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] crontab, PHP and MACOSX
Hello all, I don't know if it's the correct list, but as a php script is involved I try to start a set up a crontab job with crontab -e, which should start a php script: */10* * * * cd /Users/yvan/Sites/est-pac/ ; /usr/bin/php /Users/yvan/Sites/est-pac/controller.php but nothing happens, and in the /etc/crontab or in /private/etc/crontab the job is not listed. As I am using Mac OS 10.4.9, should I use launchd? or does someone use crontab with a mac? I try a GUI application called CronniX to setup the job but without success. Any hints? Thanks in advance for your time and help. cheers yvan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] PDO mssql + multiple rowsets
I too have been having problems getting the PDO dblib for mssql to play well (getting the same error actually). If you find a reason or work around for it I would appreciate hearing about it. Thinking of going the odbc route myself if I can't get it to work. Respectfully, Ligaya Turmelle -Original Message- From: Javier Ruiz [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 28, 2007 8:21 PM To: php-general@lists.php.net Subject: [PHP] PDO mssql + multiple rowsets Hi! I want to use PDO in my apps for connecting to several RDBSs, one of them, sql server 2000 and 2005. I tried to use as DSN something like mssql:... (as I've seen in the php manual pages) but I get a PDOException with the message Unable to open PDO connection [wrapped: could not find driver]. I can work well with the mssql built-in functions (like mssql_connect, mssql_query and so on...) and even I can almost work perfectly using in my dsn dblib: So first question: is the PDO's driver mssql deprecated or is it me doing something wrong in the PHP installation? BTW, I use php-5.2.1 In case that the answer to the first question is that mssql is no more used as a PDO driver, I have a problem... I have stored procedures in sql server that return multiple rowsets, I've seen that PDO offers functionability to manage this, but not for the dblib driver... if I try to use the $stmt-nextRowSet() method, I get an exception like Driver does not support this function: driver does not support multiple rowsets What can I do then to work with my stored procs? Thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Firefox Extension (Firefox 2.x.x.x)
On Mar 28, 2007, at 3:53 PM, Jim Lucas wrote: Daniel Brown wrote: If you're like me, you spend your fair share of time going to the PHP website to check specs, changes, or even to refresh your brain with PHP's functions. So today I threw together a simple plugin for Firefox 2 that will let you type in the name of the function and be brought right to the function page. Or, if you mistype it, it will provide suggestions. How does it work so awesome? Because it uses the PHP search engine and Mozilla's OSD. All I did was whip it together as a plugin. Download and installation instructions: http://isawit.com/ php_search.php Hope it saves everyone a microsecond or two. We now return you to your regularly-scheduled, SPAM-filled inbox. Since you mention FF, I will just add that this is possible without using an extension. And a plus, is that it is compatible with pre FF 2.x. Not all, but most versions. Open your bookmarks manager In the 'Quick Searches' folder create a new bookmark. In FF 2.x you don't have a 'Quick Searches' folder (at least I didn't on a fresh install), don't worry. It will work from any folder. Just better to be a little more organized. Enter the following information: (the key is the 'keyword' field) Name: PHP.net Location: http://www.php.net/%s Keyword: php Description: Type php search term in the addressbar to perform a PHP.net search Press 'Ok' Close your bookmarks manager Now, open a new tab, enter 'php date' This should redirect you to the php.net website and display you your results. That's pretty cool, although I'll stick with Textmate's Ctrl-H on the word in the editor to bring up the help docs in a mini-browser instead of having to switch to FF while I'm editing. erik jones [EMAIL PROTECTED] software developer 615-296-0838 emma(r)
RE: [PHP] PDO mssql + multiple rowsets
It Is doable. The native mssql/dblib extension does support that features. I just have'nt had the time to code it for pdo_dblib. - Frank I too have been having problems getting the PDO dblib for mssql to play well (getting the same error actually). If you find a reason or work around for it I would appreciate hearing about it. Thinking of going the odbc route myself if I can't get it to work. Respectfully, Ligaya Turmelle -Original Message- From: Javier Ruiz [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 28, 2007 8:21 PM To: php-general@lists.php.net Subject: [PHP] PDO mssql + multiple rowsets Hi! I want to use PDO in my apps for connecting to several RDBSs, one of them, sql server 2000 and 2005. I tried to use as DSN something like mssql:... (as I've seen in the php manual pages) but I get a PDOException with the message Unable to open PDO connection [wrapped: could not find driver]. I can work well with the mssql built-in functions (like mssql_connect, mssql_query and so on...) and even I can almost work perfectly using in my dsn dblib: So first question: is the PDO's driver mssql deprecated or is it me doing something wrong in the PHP installation? BTW, I use php-5.2.1 In case that the answer to the first question is that mssql is no more used as a PDO driver, I have a problem... I have stored procedures in sql server that return multiple rowsets, I've seen that PDO offers functionability to manage this, but not for the dblib driver... if I try to use the $stmt-nextRowSet() method, I get an exception like Driver does not support this function: driver does not support multiple rowsets What can I do then to work with my stored procs? Thanks in advance -- 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] crontab, PHP and MACOSX
Yvan wrote: Hello all, I don't know if it's the correct list, but as a php script is involved I try to start a set up a crontab job with crontab -e, which should start a php script: */10* * * * cd /Users/yvan/Sites/est-pac/ ; /usr/bin/php /Users/yvan/Sites/est-pac/controller.php but nothing happens, and in the /etc/crontab or in /private/etc/crontab the job is not listed. As I am using Mac OS 10.4.9, should I use launchd? or does someone use crontab with a mac? I try a GUI application called CronniX to setup the job but without success. Any hints? Thanks in advance for your time and help. cheers yvan It wouldn't appear in /etc/crontab, which is a system level file. My Mac is being repaired but aren't /etc and private/etc the same directory? Check your mail by typing mail and reading your mail. If there's an error it should/may be reported there (again I'm not sure about OS X). Otherwise, or in addition, check your system error logs. -- _ Myron Turner http://www.room535.org http://www.bstatzero.org http://www.mturner.org/XML_PullParser/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] crontab, PHP and MACOSX
Yvan wrote: Hello all, I don't know if it's the correct list, but as a php script is involved Nope, not the right list. Cron isn't running - which has absolutely nothing to do with php. I try to start a set up a crontab job with crontab -e, which should start a php script: */10* * * * cd /Users/yvan/Sites/est-pac/ ; /usr/bin/php /Users/yvan/Sites/est-pac/controller.php You don't need the cd command, change it to: /usr/bin/php /Users/yvan/Sites/est-pac/controller.php also add a MAILTO=your_email_Address.com at the top of the file in case it's throwing any errors. No idea where mac puts cron files but on linux systems it's usually /var/spool/cron/your_user_name (I'm guessing *bsd is the same but ask them). If you're still having problems I'd suggest asking a mac list. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] crontab, PHP and MACOSX
On March 28, 2007, [EMAIL PROTECTED] wrote: this question really has nothing to do with php ... that said. on standard unix systems, user-level crontabs (which is what you're writing with the crontab -e command) are found in /var/spool/cron/user. there's also generally a cron log in /var/log/. you should check the cron log file to confirm that the cron is running. if there isn't a cron log file you might want to look in /etc/syslog.conf to see where it says cron messages are being put. if a cron runs a job but the job fails for some reason, mail is sent to the user under which the cron is being run. anything output to stdout is also sent to that user. i.e., check the mail of the user under which you're running this cron. [this assumes that your system is configured to handle local mail.] [the above are for standard unix systems, i've never actually touched macOSX.] - Rick Shell command as cron jobs work and errors are also send to the local mail, but php scripts are not executed, is their any permission issues ? the same con job work fine on a centos box. Thank anyway for the hints yvan Original Message Date: Wednesday, March 28, 2007 03:55:09 PM -0700 From: Yvan [EMAIL PROTECTED] To: php-general@lists.php.net Cc: Subject: [PHP] crontab, PHP and MACOSX Hello all, I don't know if it's the correct list, but as a php script is involved I try to start a set up a crontab job with crontab -e, which should start a php script: */10* * * * cd /Users/yvan/Sites/est-pac/ ; /usr/bin/php /Users/yvan/Sites/est-pac/controller.php but nothing happens, and in the /etc/crontab or in /private/etc/crontab the job is not listed. As I am using Mac OS 10.4.9, should I use launchd? or does someone use crontab with a mac? I try a GUI application called CronniX to setup the job but without success. Any hints? Thanks in advance for your time and help. cheers yvan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- End Original Message -- -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] crontab, PHP and MACOSX
On March 28, 2007, Chris wrote: Yvan wrote: Hello all, I don't know if it's the correct list, but as a php script is involved Nope, not the right list. Cron isn't running - which has absolutely nothing to do with php. I try to start a set up a crontab job with crontab -e, which should start a php script: */10* * * * cd /Users/yvan/Sites/est-pac/ ; /usr/bin/php /Users/yvan/Sites/est-pac/controller.php You don't need the cd command, change it to: /usr/bin/php /Users/yvan/Sites/est-pac/controller.php also add a MAILTO=your_email_Address.com at the top of the file in case it's throwing any errors. No idea where mac puts cron files but on linux systems it's usually /var/spool/cron/your_user_name (I'm guessing *bsd is the same but ask them). If you're still having problems I'd suggest asking a mac list. There is a lot of require_once(' ') in the script and if i am not in the correct folder the script won't work. ok i will ask a mac list, sorry for the noise thanks yvan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] crontab, PHP and MACOSX
Shell command as cron jobs work and errors are also send to the local mail, but php scripts are not executed Does running the command manually work? If not, there's your problem. If it does, then it's a cron issue. Still something you should ask about on a mac mailing list. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] crontab, PHP and MACOSX
There is a lot of require_once(' ') in the script and if i am not in the correct folder the script won't work. That is something php related ;) Change your require to something like this: require(dirname(__FILE__) . '/other_file_name.php'); -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Timezone offset
Seak, Teng-Fong wrote: Satyam wrote: - Original Message - From: Chris Boget [EMAIL PROTECTED] My server's timezone is set to (GMT) Greenwish Mean Time : Dublin, Edinburgh, Lisbon, London. There you have why, you set it to GreenwiSh, which is kind of Greenwich but not quite. I think that being on the western end of Europe, those countries decided to adopt a more pan-European time zone, even if that does not match precisely their astronomical hour. That makes cross border businesses easier by having common working hours. UK's timezone is GMT (+) while most other western European countries like Spain, France, Germany, etc are in GMT +1000. I'm sure you mean +0100 - +10 is Australia and other places ;) -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RHEL 5 PHP php-5.1.6-7.el5.src.rpm using freetds-0.63-1.2.el4.rf.x86_64.rpm Won't rpm
./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu \ --target=x86_64-redhat-linux-gnu \ --program-prefix= \ --prefix=/usr \ --exec-prefix=/usr \ --bindir=/usr/bin \ --sbindir=/usr/sbin \ --sysconfdir=/etc \ --datadir=/usr/share \ --includedir=/usr/include \ --libdir=/usr/lib64 \ --libexecdir=/usr/libexec \ --localstatedir=/var \ --sharedstatedir=/usr/com \ --mandir=/usr/share/man \ --infodir=/usr/share/info \ --cache-file=../config.cache \ --with-libdir=lib64 \ --with-config-file-path=/etc \ --with-config-file-scan-dir=/etc/php.d \ -LINE 77 Remove the trailing \ You only need the \ if you're adding more options after that line (it continues that command basically) - the last line shouldn't have it. -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP Upgrade: 5 or 6
I'm migrating my company to PHP 5 (from PHP4) now. I've played with PHP6 a while ago and the only thing I can remember about it is that it obsoletes a not so few functions and has a stricter coding rules. -- itoctopus - http://www.itoctopus.com Davi [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Hi all. I've reading on some sites [1,2] that PHP 6 is comming soon... What should I do? Migrate my server and apps to PHP 5 now and, later to PHP 6, or wait some more time and migrate all to PHP 6? TIA -- Davi Vidal [EMAIL PROTECTED] [EMAIL PROTECTED] -- Agora com fortune: The main thing is the play itself. I swear that greed for money has nothing to do with it, although heaven knows I am sorely in need of money. - Feodor Dostoyevsky -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] using for loop in function
I don't quite understand why you're naming the checbox, you can easily go for name={$name}[]; -- itoctopus - http://www.itoctopus.com Jim Lucas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Richard Kurth wrote: The function below will create a group of checkboxes it will also check the checkbox that is stored in the table field that is in $select_value this works fine if there is only one value in the variable but if there is more stored like 1,2,3,4 it will not work. I am trying to figure out how to use the following for loop to add the number to each checkbox and if they match mark the checkbox checked $ExplodeIt = explode(,,$select_value,,); $Count = count($ExplodeIt); for ($i=0; $i $Count; $i++) { } function checkbox($sqlu,$name,$value1,$value2,$select_value){ $name_result = safe_query($sqlu); while($rowu=mysql_fetch_array($name_result)){ echo trtd colspan=\2\ align=\left\input type='checkbox' name=' . $name . [ . $rowu[$value1] . ]' value=\$rowu[$value1]\; if($select_value==$rowu[$value1]) { echo checked$rowu[$value2]\n/td/trBR; }else{ echo $rowu[$value2]\n/td/trBR; } } } I have used in_array as a way of doing what you are looking for. function checkbox($sqlu,$name,$value1,$value2,$select_value){ $name_result = safe_query($sqlu); while ( $rowu = mysql_fetch_array($name_result) ) { $checked = ''; if ( in_array($rowu[$value1], $select_value) ) { $checked = ' checked=checked'; } echo HTML tr td colspan=2 align=left input type=checkbox name={$name}[{$rowu[$value1]}] value={$rowu[$value1]} {$checked} /{$rowu[$value2]} /td /tr HTML; } } Personally, I would change your SQL query to return only the two columns that you are wanting to display. And also use the mysql_fetch_assoc() SELECT id AS colA, name AS colB FROM myTable; and not this SELECT * FROM myTable; This would then allow me to write your function this way. function checkbox($sqlu,$name,$selected=array()){ if ( ( $name_result = safe_query($sqlu) ) === false ) { die('something went wrong'); } while ( $rowu = mysql_fetch_assoc($name_result) ) { $checked = ''; if ( in_array($rowu['colA'], $selected) ) { $checked = ' checked=checked'; } echo HTML tr td colspan=2 align=left inputtype=checkbox name={$name}[{$rowu['colA']}] value={$rowu['colA']} {$checked} /{$rowu['colB']} /td /tr HTML; } } Hope this helps -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] changing array to a string
join is also an alias for implode in case you're having trouble remembering the name, so you can go for $ids = join(',', $_POST['subscriptions']); -- itoctopus - http://www.itoctopus.com Chris [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Richard Kurth wrote: When I submit the for below it gives me an array that looks like this array(5) { [0]= string(1) 3 [1]= string(1) 4 [2]= string(1) 5 [3]= string(1) 6 [4]= string(1) 7 } I would like to convert it to a string like this 3,4,5,6,7 $ids = implode(',', $_POST['subscriptions']); -- Postgresql php tutorials http://www.designmagick.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] need help on project-Creating Database
Team, I am in need of your help. I have tried over the years to do this. But, I am not getting it correct. What I want to do is build site that has team management for your roster of players, and display stats in a nut shell. As far as stats, I have about 5 years worth of data that I want to store in a database. I want to display it by all means. Years, players, teams etc. Then, I also want to be able to manage the players and the teams only with the current active year. My wish list is here: http://www.theufl.com/ufl_project.htm Please email privately if needed. This is a dream of mine to finish for my website. I want to do all the work and learn it. I know of databases just never really gone all out on one. Can you please tell me what tables and fields I would need in order to do this. I have a word doc going that shows a projected database. If you are interested in seeing it please let me know so I can email you off the list, as I am not able to send out attachments. :-) Your alls help would be greatly appreciated Karl Karl James (TheSaint) mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] [EMAIL PROTECTED] www.theufl.com http://www.theufl.com/
Re: [PHP] using for loop in function
itoctopus wrote: I don't quite understand why you're naming the checbox, you can easily go for name={$name}[]; -- itoctopus - http://www.itoctopus.com Jim Lucas [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] Richard Kurth wrote: The function below will create a group of checkboxes it will also check the checkbox that is stored in the table field that is in $select_value this works fine if there is only one value in the variable but if there is more stored like 1,2,3,4 it will not work. I am trying to figure out how to use the following for loop to add the number to each checkbox and if they match mark the checkbox checked $ExplodeIt = explode(,,$select_value,,); $Count = count($ExplodeIt); for ($i=0; $i $Count; $i++) { } function checkbox($sqlu,$name,$value1,$value2,$select_value){ $name_result = safe_query($sqlu); while($rowu=mysql_fetch_array($name_result)){ echo trtd colspan=\2\ align=\left\input type='checkbox' name=' . $name . [ . $rowu[$value1] . ]' value=\$rowu[$value1]\; if($select_value==$rowu[$value1]) { echo checked$rowu[$value2]\n/td/trBR; }else{ echo $rowu[$value2]\n/td/trBR; } } } I have used in_array as a way of doing what you are looking for. function checkbox($sqlu,$name,$value1,$value2,$select_value){ $name_result = safe_query($sqlu); while ( $rowu = mysql_fetch_array($name_result) ) { $checked = ''; if ( in_array($rowu[$value1], $select_value) ) { $checked = ' checked=checked'; } echo HTML tr td colspan=2 align=left input type=checkbox name={$name}[{$rowu[$value1]}] value={$rowu[$value1]} {$checked} /{$rowu[$value2]} /td /tr HTML; } } Personally, I would change your SQL query to return only the two columns that you are wanting to display. And also use the mysql_fetch_assoc() SELECT id AS colA, name AS colB FROM myTable; and not this SELECT * FROM myTable; This would then allow me to write your function this way. function checkbox($sqlu,$name,$selected=array()){ if ( ( $name_result = safe_query($sqlu) ) === false ) { die('something went wrong'); } while ( $rowu = mysql_fetch_assoc($name_result) ) { $checked = ''; if ( in_array($rowu['colA'], $selected) ) { $checked = ' checked=checked'; } echo HTML tr td colspan=2 align=left inputtype=checkbox name={$name}[{$rowu['colA']}] value={$rowu['colA']} {$checked} /{$rowu['colB']} /td /tr HTML; } } Hope this helps could be that the OP has more then one field/array called $name[] this way ne can have $name['this'] $name['that'] etc... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PDO and buffered queries
HI all. The PHP.net manual is somewhat unclear on this point, so I thought I'd ask here. Does PDO automatically buffer queries the way that the mysql_* extension does, in order to allow multiple result sets open at the same time? Or is that something that has to be set on the connection, and if so, is that available for all drivers? I ask because I am running into a problem with a query segfaulting on me, but only under PHP 5.1 with PDO from pecl. It ran fine in PHP 5.2.0. The only mention in the manual on this subject is: http://us2.php.net/manual/en/ref.pdo-mysql.php If this attribute is set to TRUE on a PDOStatement, the MySQL driver will use the buffered versions of the MySQL API. If you're writing portable code, you should use PDOStatement::fetchAll() instead. The sample code there suggests that nothing does buffered queries except the MySQL driver. I find no mention of that anywhere else, though, one way or another. Of course, using fetchAll(), as it suggests, means that I only get arrays, not objects. (Unless I'm misreading those docs, too.) Any PDO experts out there able to shed some light on the situation? I'm thoroughly confused at this point, and the manual is quite unclear on all of the important details I care about. :-) -- Larry Garfield AIM: LOLG42 [EMAIL PROTECTED] ICQ: 6817012 If nature has made any one thing less susceptible than all others of exclusive property, it is the action of the thinking power called an idea, which an individual may exclusively possess as long as he keeps it to himself; but the moment it is divulged, it forces itself into the possession of every one, and the receiver cannot dispossess himself of it. -- Thomas Jefferson -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php