Re: Re[2]: [PHP] Pirate PHP books online?
On 24/07/07, tedd [EMAIL PROTECTED] wrote: How about Rasmus Lerdorf, Lord of the Code I think we could go on and on with this. Php Fiction? Rasmus's List? Codin' in the Rain? Dotan Cohen http://lyricslist.com/ http://what-is-what.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Object instance and session
Hi all, i've a self-defined class describing an user. In the login page i create an instance of the user object and store it in $_SESSION['user']. When accessing $_SESSION['user'] from other pages (of course I do require('user.php'); and session_start();) i got this errors: Warning: mysqli::query() [function.mysqli-query]: Couldn't fetch mysqli in /home/httpd/html/uss_tyco3/user.php on line 390 Warning: user::get_unita_row() [function.user-get-unita-row]: Couldn't fetch mysqli in /home/httpd/html/uss_tyco3/user.php on line 391 Fatal error: Call to a member function fetch_assoc() on a non-object in /home/httpd/html/uss_tyco3/user.php on line 396 The constructor is: function __construct ($nick, $pwd) { $conn = new mysqli (localhost, , *, tyco); $this-conn = $conn; $query = SELECT * FROM `users` WHERE `nick`='$nick'; $res = $conn-query($query); if (!$res-num_rows) { /* The nick isn't registered */ $this-log(Nick inesistente: $nick); return 1; } $row = $res-fetch_assoc(); $res-free_result(); if ($row['password'] != $pwd) { /* Wrong password */ $this-log(Password errata, nick: $nick); return 2; } $query = INSERT INTO `online` (`user`) VALUES ('$nick') ON ; $query .= DUPLICATE KEY UPDATE `time`='.time().'; $conn-query ($query); if ($conn-error) { /* Error in mysql query */ $this-log($conn-error); return FALSE; } $this-nick = $nick; $this-pwd = $pwd; $this-admin = (bool)$row['admin']; $this-master = (bool)$row['master']; $this-log(Login: $nick); } The method i'm calling when getting those errors is: function get_unita_row () { $query = SELECT * FROM `unita` WHERE `id`='$this-unita'; $res = $this-conn-query($query); if ($this-conn-error) { $this-log($this-conn-error); return FALSE; } $row = $res-fetch_assoc(); $res-free_result(); return $row; } Any hint? Thanks, Stefano -- Email.it, the professional e-mail, gratis per te: http://www.email.it/f Sponsor: 250 biglietti da visita Gratis + 42 modelli e Etichette per Indirizzo Gratis + Porta biglietti Gratis -Offerta limitata! Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=6782d=24-7 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Smarty template for parent-child form
Is there a template that presents a parent-child forms, for example, an invoice object which has a header(invoice no, date, customer code, invoice total) and multiple items (item no, item name, quantity, price, amount)? -- @~@ Might, Courage, Vision, SINCERITY. / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Xubuntu 7.04) Linux 2.6.22.1 ^ ^ 19:12:01 up 12 days 21:16 1 user load average: 0.06 0.06 0.02 news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Object instance and session
Stefano Esposito wrote: Hi all, i've a self-defined class describing an user. In the login page i create an instance of the user object and store it in $_SESSION['user']. When accessing $_SESSION['user'] from other pages (of course I do require('user.php'); and session_start();) i got this errors: Warning: mysqli::query() [function.mysqli-query]: Couldn't fetch mysqli in /home/httpd/html/uss_tyco3/user.php on line 390 Warning: user::get_unita_row() [function.user-get-unita-row]: Couldn't fetch mysqli in /home/httpd/html/uss_tyco3/user.php on line 391 Fatal error: Call to a member function fetch_assoc() on a non-object in /home/httpd/html/uss_tyco3/user.php on line 396 snip code Any hint? You are trying to store a resource (MySQLi connection) in the session. This is not possible. You need to implement __sleep and __wakeup methods in your class to properly close and re-create the connection on each request. See here for more: http://php.net/oop5.magic -Stut -- http://stut.net/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Smarty template for parent-child form
Man-wai Chang wrote: Is there a template that presents a parent-child forms, for example, an invoice object which has a header(invoice no, date, customer code, invoice total) and multiple items (item no, item name, quantity, price, amount)? Go to http://smarty.php.net/manual/en/language.function.foreach.php What you do is assign the items to an array called, say, items. Then you use foreach in the template to iterate the array, just like you would in PHP itself. Example 7-8 (Contacts) is pretty close to what you're doing. Regards, Chad -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: header( 'refresh' ), form data, and IE
On 7/23/07, Daniel Kasak [EMAIL PROTECTED] wrote: Thanks for the response Dan. Us Dans have to stick together :) On Mon, 2007-07-23 at 17:37 -0700, Dan wrote: Then validate the field obviously! $description = ; $categoryid = ; if(isset($_POST['description'])) $description = ?description=$_POST['description']; if(isset($_POST['categoryid'])) { if($description != ) $categoryid = ; else $categoryid = ?; // if a description has been entered you'll need an symbol otherwise a ? $category .= categoryid=$_POST['categoryid']; // append category to itself with the posted info } H. Yeah I thought it would come to that. I was hoping for a quick nasty fix. I didn't test this it's just off the top of my head, also you should sanitize the input before you do anythign with it really, but that's another issue. Also this is really something that you should be doing with ajax rather than having the page reloading, and passing variables back, etc. This is the EXACT purpose that Ajax as made for, validation of info. Check out XAJAX it's very simple to use but powerfull when you need it. I will try to make some time for investigating ajax. I'm mostly developing in Perl, and doing nice GUI stuff ( ie no web stuff - this is a once-off maintenance thing ), so I'll a little out of my comfort zone ... Thanks again for your help. -- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: [EMAIL PROTECTED] website: http://www.nusconsulting.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hello, Dans! Dan K., is there any reason the validation can't reside within the same script as the form, then forward on success? A very simple example: ? if($_POST) { // Check to ensure that your variables are all correct, // then use header(Location: successful-target.php?var1=avar2=b); // And then, on forwarding, remember to exit; } ? FORM METHOD=POST ACTION=?=$_SERVER['PHP_SELF'];? INPUT TYPE=TEXT NAME=var1 VALUE=?=$_POST['var1'];?BR / INPUT TYPE=TEXT NAME=var2 VALUE=?=$_POST['var2'];?BR / INPUT TYPE=SUBMIT VALUE=GO! /FORM Since the user will start with a blank form, and the $_POST values won't already be set, the values in the form will be blank on the initial page load, but for unsuccessful attempts, they'll be populated with the correct data. ~ Dan^[3] -- 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] Pirate PHP books online?
[snip] Rasmus Lerdorf and the Deathly Hallows Rasmus Lerdorf and the Order of the PHP Rasmus Lerdorf and the Order of Function Arguments Rasmus Lerdorf, Lord of the Code Rasmus Lerdorf and the Half-Assed Coder [/snip] Rasmus Lerdorf and The Coders're Stoned Arrays 11 Lerdorf - A PHPdoc Autobiography PHP 5 - The Object Strikes Back Revenge of the Nerds II - PHP in Paradise PHP Too - Electric Boogaloo -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Help needed with Curl
I downloaded a copy of PHP Version 5.2.3 and installed it on Windows 2003. Everything seems to work fine except for Curl. -- PHP Version 5.2.3 cURL support enabled cURL Information libcurl/7.16.0 OpenSSL/0.9.8e zlib/1.2.3 -- It keeps returning this error message. Reason 'CURL error: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol' The code works one machine that has the following setup -- PHP Version 5.1.0 cURL support enabled cURL Information libcurl/7.14.0 OpenSSL/0.9.8b zlib/1.2.3 -- Do I need to download any other packages for Curl to work? What the heck am I missing? Thanks, Dave ** HTC Disclaimer: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: Pirate PHP books online?
Am 2007-07-21 01:08:39, schrieb Dotan Cohen: My reference to dead trees was not meant to imply an environmental reasoning behind my preference. But, if you insist, then the 'lost energy' is actually heating my workroom in winter. That means that I don't need to run a heater. Like me in Offenburg/Germany and Strasbourg/France. Greetings Michelle Konzack Systemadministrator Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSN LinuxMichi 0033/6/6192519367100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
[PHP] Re: Pirate PHP books online?
Am 2007-07-20 22:15:07, schrieb Tijnema: Old paper can be recycled, lost energy from computers can't ;) Tijnema - END OF REPLIED MESSAGE - Not realy right because I run three Sun Blade with 32 CPU's and with around 100 HDD's each and the Power Block tell me it has 6 kWatt... In Offenburg/Germany where I have one of this servers, my hausowner has installed a heatpump and we save the heat in a geothermal reservoir. So we have it availlable in the winter... or for warm water. No realy much losses... Greetings Michelle Konzack Systemadministrator Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSN LinuxMichi 0033/6/6192519367100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
[PHP] Re: Pirate PHP books online?
Am 2007-07-21 00:29:08, schrieb Tijnema: And it runs the airco in the summer ;) I do not wotk in summer since for 2 years my Dual-Opteron was gone because I had over 48°C im my appartement (no it was not in Marrakech/Morocco but Strasbourg/France) 7000 Euro cooked/burned/fucked! And this with eight 120mm PAPAST-Fan's Greetings Michelle Konzack Systemadministrator Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSN LinuxMichi 0033/6/6192519367100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
[PHP] Re: Pirate PHP books online?
Am 2007-07-19 19:41:32, schrieb Tijnema: One word: Useless! The watermark can be easily removed, and the guy who puts in on the net will simply remove it, and can't be traced :) Not realy except you know the WHOLE original text. I would put some weird (unknown) phrases into the text.. Greetings Michelle Konzack Systemadministrator Tamay Dogan Network Debian GNU/Linux Consultant -- Linux-User #280138 with the Linux Counter, http://counter.li.org/ # Debian GNU/Linux Consultant # Michelle Konzack Apt. 917 ICQ #328449886 50, rue de Soultz MSN LinuxMichi 0033/6/6192519367100 Strasbourg/France IRC #Debian (irc.icq.com) signature.pgp Description: Digital signature
[PHP] COM object project
I am using a COM object from one of our system venders and I am having problems using an in/out variable for one function on php 4.3.11. I can load the COM interface, return the typeinfo and even call the function successfully but I can't get a return value set for the variable. Here is the code I am using: $sessionid = (int) ; $C1COM = com_load(ConceptCOM); $val1 = $C1COM-OpenSession($sessionid); echo val1: ; print_r($val1); echo br; echo session: ; print_r($sessionid); echo br; This prints: val1: 1 session: 0 If I do the same thing using php 5 (just replace 'com_load' with 'new COM'), I get the expected result with a valid sessionid. Here is the typeinfo for the function: /* DISPID=10 */ /* VT_I4 [3] */ function opensession( /* VT_PTR [26] [in][out] -- VT_I4 [3] */ $sessionid ) { } I've tried different type casts, passing a variant, and different ways of calling the method; is there anything that I need to do to handle a VT_PTR type or a variable defined as in and out? Other then updating to php 5, can php 4 handle setting a method parameter within a COM object? The vender is willing to make some updates if needed but I don't want to have to do a major rewrite. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Help needed with Curl
Yes. The script is the same on both machines. I can pull up a web browser and connect to the ssl url that I'm trying to connect using php/curl. The only DLLs I need to add are libeay.dll, ssleay32.dll, right? I'm running Windows 2003 Server with IIS 6.0 -Original Message- From: Daniel Brown [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 24, 2007 9:01 AM To: Bosky, Dave Cc: php-general@lists.php.net Subject: Re: [PHP] Help needed with Curl On 7/24/07, Bosky, Dave [EMAIL PROTECTED] wrote: I downloaded a copy of PHP Version 5.2.3 and installed it on Windows 2003. Everything seems to work fine except for Curl. -- PHP Version 5.2.3 cURL support enabled cURL Information libcurl/7.16.0 OpenSSL/0.9.8e zlib/1.2.3 -- It keeps returning this error message. Reason 'CURL error: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol' The code works one machine that has the following setup -- PHP Version 5.1.0 cURL support enabled cURL Information libcurl/7.14.0 OpenSSL/0.9.8b zlib/1.2.3 -- Do I need to download any other packages for Curl to work? What the heck am I missing? Thanks, Dave ** HTC Disclaimer: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php That actually looks like an OpenSSL problem (despite the fact that PHP 5.2.3 does have a lot of poorly-made changes, in my opinion), suggesting that it's attempting to provide (or retrieve) something via an SSL/HTTPS connection where there is no encryption. Is the script you're attempting to run the exact same on both machines? Can Machine A connect to Machine B and vice-versa using cURL/SSL in combination with your script? What do the Apache logs say? -- 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] Help needed with Curl
On 7/24/07, Bosky, Dave [EMAIL PROTECTED] wrote: I downloaded a copy of PHP Version 5.2.3 and installed it on Windows 2003. Everything seems to work fine except for Curl. -- PHP Version 5.2.3 cURL support enabled cURL Information libcurl/7.16.0 OpenSSL/0.9.8e zlib/1.2.3 -- It keeps returning this error message. Reason 'CURL error: error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol' The code works one machine that has the following setup -- PHP Version 5.1.0 cURL support enabled cURL Information libcurl/7.14.0 OpenSSL/0.9.8b zlib/1.2.3 -- Do I need to download any other packages for Curl to work? What the heck am I missing? Thanks, Dave ** HTC Disclaimer: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php That actually looks like an OpenSSL problem (despite the fact that PHP 5.2.3 does have a lot of poorly-made changes, in my opinion), suggesting that it's attempting to provide (or retrieve) something via an SSL/HTTPS connection where there is no encryption. Is the script you're attempting to run the exact same on both machines? Can Machine A connect to Machine B and vice-versa using cURL/SSL in combination with your script? What do the Apache logs say? -- 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] Re: Smarty template for parent-child form
What you do is assign the items to an array called, say, items. Then you use foreach in the template to iterate the array, just like you would in PHP itself. Example 7-8 (Contacts) is pretty close to what you're doing. Need to take a look first. Thank you. I sincerely want to know how experts do it. :) -- @~@ Might, Courage, Vision, SINCERITY. / v \ Simplicity is Beauty! May the Force and Farce be with you! /( _ )\ (Xubuntu 7.04) Linux 2.6.22.1 ^ ^ 21:02:01 up 12 days 23:06 1 user load average: 0.03 0.06 0.01 news://news.3home.net news://news.hkpcug.org news://news.newsgroup.com.hk -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Help needed with Curl
On 7/24/07, Bosky, Dave [EMAIL PROTECTED] wrote: Yes. The script is the same on both machines. I can pull up a web browser and connect to the ssl url that I'm trying to connect using php/curl. The only DLLs I need to add are libeay.dll, ssleay32.dll, right? I'm running Windows 2003 Server with IIS 6.0 I believe so. In order to enable cURL on a Windows box, you have to copy libeay32.dll and ssleay32.dll from the DLL folder of the PHP/ binary package to the SYSTEM folder. (to be safe, you may want to do both C:\WINDOWS\SYSTEM\ and C:\WINDOWS\SYSTEM32\, but I think Windows allows you to `copy *.dll C:\%SYSTEM% - I'm a *nix guy, but I think I remember doing that on Windows a while back). Then edit php.ini to remove the semicolon from the front of this line: extension=php_curl.dll That *should* do it, but I'm sure you've already done all of that, so beyond that point, I'm not really sure what could be causing the protocol error. In either case, I think it's definitely an SSL error as opposed to a cURL/PHP one. Sorry I'm not being much help on this one -- 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] Re: problem with install php 5.2.3 on apache 2.2.4 in windows xp sp2
Could you Specifiy which error messages you were getting? --- Anton C. Swartz IV Phoenix Edge Network L.L.C. http://www.phpopenid.com - Owner PHPLogic Development Services http://www.phplogic.net - Co-Owner Necrogami http://www.necrogami.com - Personal Blog Based in Indianapolis, IN The Opposite of war is not Peace it is Creation. Don't let sin rule your body. After all, your body is bound to die, so dont obey its desires or let any part of it become slave to evil. Give yourselves to God, as people who have been raised from death to life. Make every part of your body a slavethat pleases God. Don't let sin keep ruling your lives.You are ruled by God's Kindness and not by the law. Romans 6:12-14 -Original Message- From: Ryan Lao [mailto:[EMAIL PROTECTED] Sent: Monday, July 23, 2007 10:36 PM To: php-general@lists.php.net Subject: [PHP] Re: problem with install php 5.2.3 on apache 2.2.4 in windows xp sp2 Arvin, You inserted the codes ?php phpinfo(); ? to your index.html file? arvin lee [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] system: windows xp sp 2 apache: apache_2.2.4-win32-x86-no_ssl PHP: php-5.2.3-win32-installer.msi i try to install php on my computer so that i can finish my homework, but after download these files nightmare begins. Install apache with default settings, install php with default settings. Restart apache server .While I modify index.html add ?php phpinfo(); ? , open 127.0.0.1 , apache server default page pops up with no change. Creat a new file named as phpinfo.php, modify httpd.conf , add line AddType application/x-httpd-php .php then restart apache. open broswer key in address 127.0.0.1/phpinfo.php ,it show me nothing. is there anyone can help ? PS. I have reinstall my windows system, nothing change.( Now I am using Appserv to finish my homewhere.) one thing, after install php 5.2.3 on apache server, when I stop apache server ,windows system show my two error message. -- 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.476 / Virus Database: 269.10.14/912 - Release Date: 7/22/2007 7:02 PM -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.16/914 - Release Date: 7/23/2007 7:45 PM -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[2]: [PHP] Help needed with Curl
Hi Daniel, Tuesday, July 24, 2007, 2:34:06 PM, you wrote: In order to enable cURL on a Windows box, you have to copy libeay32.dll and ssleay32.dll from the DLL folder of the PHP/ binary package to the SYSTEM folder. (to be safe, you may want to do both C:\WINDOWS\SYSTEM\ and C:\WINDOWS\SYSTEM32\, but I think Windows allows you to `copy *.dll C:\%SYSTEM% - I'm a *nix guy, but I think I remember doing that on Windows a while back). *Never* put PHP DLLs into the Windows System folder. It's neither required, nor sensible. Keep them where they belong - in your PHP folder. Then edit php.ini to remove the semicolon from the front of this line: extension=php_curl.dll He must have already done this to see the output in phpinfo. Dave - As well as the OpenSSL DLL do you also have a local certificate created? (curl-ca-bundle.crt by default) http://curl.netmirror.org/docs/sslcerts.html 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: Re[2]: [PHP] Help needed with Curl
On 7/24/07, Richard Davey [EMAIL PROTECTED] wrote: *Never* put PHP DLLs into the Windows System folder. It's neither required, nor sensible. Keep them where they belong - in your PHP folder. Heh which is why I prefer to stick with what I know which is not so much with Windows servers, to be honest. -- 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] Strategy when working with designer(s)?
0. The designers we work with frequently need to be told that 3 second feature you just suggested just added 300 hours to the project and destroyed 508 compliance, usually multiple times. That *must* happen before the client sees it, or you're screwed. It's never too early to get the Yea! I have always seen the programmer as the Leader* of the production of the project. He is the one to give the final word on what is Possible or not, and that is precisely what cause most problems (also known as scope of the project). *I am the programmer, maybe my perception of project hierachy is biased by my ego? ;) Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] Help needed with Curl
Hi Daniel, Tuesday, July 24, 2007, 3:57:11 PM, you wrote: On 7/24/07, Richard Davey [EMAIL PROTECTED] wrote: *Never* put PHP DLLs into the Windows System folder. It's neither required, nor sensible. Keep them where they belong - in your PHP folder. Heh which is why I prefer to stick with what I know which is not so much with Windows servers, to be honest. It's not just you - there are tutorials and mailing list posts all over the net that impart the same advice. So I'm not surprised that you recommended it, you probably picked it up as a byproduct of someone else's flawed recommendation long ago :) As a Linux person - think of the absolute *last* possible root only place that you could ever stick a PHP library into, with the most risk to security possible. That is the equivalent of C:\Windows\System. 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: Re[4]: [PHP] Help needed with Curl
On 7/24/07, Richard Davey [EMAIL PROTECTED] wrote: Hi Daniel, Tuesday, July 24, 2007, 3:57:11 PM, you wrote: On 7/24/07, Richard Davey [EMAIL PROTECTED] wrote: *Never* put PHP DLLs into the Windows System folder. It's neither required, nor sensible. Keep them where they belong - in your PHP folder. Heh which is why I prefer to stick with what I know which is not so much with Windows servers, to be honest. It's not just you - there are tutorials and mailing list posts all over the net that impart the same advice. So I'm not surprised that you recommended it, you probably picked it up as a byproduct of someone else's flawed recommendation long ago :) As a Linux person - think of the absolute *last* possible root only place that you could ever stick a PHP library into, with the most risk to security possible. That is the equivalent of C:\Windows\System. /me nods. Makes perfect sense to me when you put it that way. -- 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: Re[2]: [PHP] Help needed with Curl
No I don't have a local certificate created. I'm only need to do a post using xml-rpc and I have SSLVerifyPeer turned off. This turns off client certificate authentication $xmlrpc_client-setSSLVerifyPeer(0); -Original Message- From: Richard Davey [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 24, 2007 10:56 AM To: Daniel Brown Cc: Bosky, Dave; php-general@lists.php.net Subject: Re[2]: [PHP] Help needed with Curl Hi Daniel, Tuesday, July 24, 2007, 2:34:06 PM, you wrote: In order to enable cURL on a Windows box, you have to copy libeay32.dll and ssleay32.dll from the DLL folder of the PHP/ binary package to the SYSTEM folder. (to be safe, you may want to do both C:\WINDOWS\SYSTEM\ and C:\WINDOWS\SYSTEM32\, but I think Windows allows you to `copy *.dll C:\%SYSTEM% - I'm a *nix guy, but I think I remember doing that on Windows a while back). *Never* put PHP DLLs into the Windows System folder. It's neither required, nor sensible. Keep them where they belong - in your PHP folder. Then edit php.ini to remove the semicolon from the front of this line: extension=php_curl.dll He must have already done this to see the output in phpinfo. Dave - As well as the OpenSSL DLL do you also have a local certificate created? (curl-ca-bundle.crt by default) http://curl.netmirror.org/docs/sslcerts.html Cheers, Rich -- Zend Certified Engineer http://www.corephp.co.uk Never trust a computer you can't throw out of a window ** HTC Disclaimer: The information contained in this message may be privileged and confidential and protected from disclosure. If the reader of this message is not the intended recipient, or an employee or agent responsible for delivering this message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Thank you. ** -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re[4]: [PHP] Help needed with Curl
Hi Dave, Tuesday, July 24, 2007, 4:45:13 PM, you wrote: No I don't have a local certificate created. I'm only need to do a post using xml-rpc and I have SSLVerifyPeer turned off. This turns off client certificate authentication $xmlrpc_client-setSSLVerifyPeer(0); What does your PHP error log show-up? (if anything) I assume that the site you are sending the RPC request to requires it to be delivered over SSL? (is it the very same site that worked in the previous build of PHP, but not this one?) 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: Re[2]: [PHP] Pirate PHP books online?
On Tuesday 24 July 2007 06:12, tedd wrote: How about Rasmus Lerdorf, Lord of the Code I thought it was supposed to be based on a Potter book? How about Rasmus Lerdorf, Prisoner of ASP. -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pirate PHP books online?
On Tuesday 24 July 2007 06:02, Ryan A wrote: Instead of clip tags, I recommend that you configure your mail client to prepend a greater than sign to quotes. It's rather customary, if not standard. Sorry about that, its driving me crazy too. I have to manually do it if I want it (like above). It used to work before... then suddenly it just does not... anybody have any idea which setting I should tinker with in yahoo, please give me a shout. Options Mail Preferences Replying = Include full message should be the one. -- Crayon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Problem iterating over an array with foreach and a reference variable
I don't know if I'm doing something wrong or if this is a bug. Very simply: I created an array with values 1-5. I use a foreach loop to iterate over it to add 1 to the values. It correctly iterates over the array except for the last value. Code: ?php $test = array(1, 2, 3, 4, 5); print original: br; foreach ($test as $part) { print ($part) ; } print br changing: br; foreach ($test as $part) { print ($part - ; $part ++; print $part) ; } print brfinal:br; foreach ($test as $part) { print ($part) ; } print brvar dump:br; var_dump($test); ? Expected Output: original: (1) (2) (3) (4) (5) changing: (1 - 2) (2 - 3) (3 - 4) (4 - 5) (5 - 6) final: (2) (3) (4) (5) (6) var dump: array(5) { [0]= int(2) [1]= int(3) [2]= int(4) [3]= int(5) [4]= int(5) } Actual Output: original: (1) (2) (3) (4) (5) changing: (1 - 2) (2 - 3) (3 - 4) (4 - 5) (5 - 6) final: (2) (3) (4) (5) (5) var dump: array(5) { [0]= int(2) [1]= int(3) [2]= int(4) [3]= int(5) [4]= ?(5) } Any help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Pirate PHP books online?
Php Fiction? Rasmus's List? Codin' in the Rain? LOL! That was good! Thanks needed that! Cheers! R -- - The faulty interface lies between the chair and the keyboard. - Creativity is great, but plagiarism is faster! - Smile, everyone loves a moron. :-) - Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.
Re: Re[2]: [PHP] Pirate PHP books online?
On 24/07/07, Ryan A [EMAIL PROTECTED] wrote: Php Fiction? Rasmus's List? Codin' in the Rain? LOL! That was good! Thanks needed that! Of course, one should not forgot Debbie Does DocType... Dotan Cohen http://lyricslist.com/ http://what-is-what.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strategy when working with designer(s)?
On 24/07/07, Simon [EMAIL PROTECTED] wrote: I have always seen the programmer as the Leader* of the production of the project. He is the one to give the final word on what is Possible or not, and that is precisely what cause most problems (also known as scope of the project). The 'Leader' should be an IT Architect who understands both: a) what is feasible with the technology and b) the business problem that is being solved. His job is to build a design that the various 'workers' (Web Design / Scripting / DB etc) can then implement within the agreed budget and timescales. Simon says 1) Designer does his whole job and shows the design when finished and approved Well in a dream world that would be nice but I've never seen it happen in more than 20 years in the industry ... Alan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Variable problem?
Good afternoon list, Probably a no-brainer for the most of you but i'm in a pickle: i've set up a variable to receive in the body of the notification mail upon sending a form. The body of the mail should read like this: Obrigado por nos contatar, $contato_name. Recebemos sua mensagem e entraremos em contato em breve. (in english: tnx for contacting us, $contato_name. We received your message and will contact you shortly.) Where $contato_name is the name of the contact, as used in the form. The problem is that the message arrives without the $contato_name, so i get: Obrigado por nos contatar, . Recebemos sua mensagem e entraremos em contato em breve. Here's the script: ? // set your own preferences here # // Your email address $youremail = ; // Your web site title (John Doe's Site) $websitetitle = ; // Path to thanks for the message page $thankyoupage = ' '; // Send notification to sender (use false if not required) $sendnotification = true; // Continue with your error checking, output of form, et cetera. $contact_form_action = $_SERVER['PHP_SELF']; if ((isset($_POST[sendcontact])) ($_POST[sendcontact] == contactsent)) { $contacter_form_error = array(); if (empty($_POST['empresa_name'])){ $contacter_form_error[] = 'favor preencher nome da empresa'; } if (empty($_POST['contato_name'])){ $contacter_form_error[] = 'favor preencher nome do contato'; } if (empty($_POST['fone'])){ $contacter_form_error[] = 'favor preencher número do telefone'; } if (empty($_POST['contato_email'])){ $contacter_form_error[] = 'favor preencher seu e-mail'; } if (empty($_POST['produto'])){ $contacter_form_error[] = 'favor preencher o produto'; } if (empty($_POST['origem'])){ $contacter_form_error[] = 'favor preencher origem'; } if (empty($_POST['destino'])){ $contacter_form_error[] = 'favor preencher destino'; } if (empty($_POST['quantidade'])){ $contacter_form_error[] = 'favor preencher quantidade'; } if (empty($_POST['peso'])){ $contacter_form_error[] = 'favor preencher peso'; } if (empty($_POST['comprimento'])){ $contacter_form_error[] = 'favor preencher comprimento'; } if (empty($_POST['altura'])){ $contacter_form_error[] = 'favor preencher altura'; } if (empty($_POST['largura'])){ $contacter_form_error[] = 'favor preencher largura'; } else { $empresa_name = stripslashes($_POST['empresa_name']); $contato_email = stripslashes($_POST['contato_email']); $body =EOB Empresa: $_POST[empresa_name] Contato: $_POST[contato_name] Fone: $_POST[fone] Fax: $_POST[fax] Email: $_POST[contato_email] Produto: $_POST[produto] Origem: $_POST[origem] Destino: $_POST[destino] Quantidade: $_POST[quantidade] Peso: $_POST[peso] Comprimento: $_POST[comprimento] Altura: $_POST[altura] Largura: $_POST[largura] EOB; $subjectline = $websitetitle | Orçamento de empresa; $notification_message = Obrigado por nos contatar, $contato_name. Recebemos sua mensagem e entraremos em contato em breve.; $notification_subject = Obrigado por sua mensagem para $websitetitle.; mail($contato_email,$subjectline,$body, From: $contato_email); mail($contato_email, $notification_subject, $notification_message, From: $youremail); header(Location:$thankyoupage); } } ? // Print form field errors if present if (count($contacter_form_error)0){ print 'p id=bottomstrongAlgo está errado:/strong/p'.\n; print 'ul'.\n; foreach($contacter_form_error as $form_err) { print li class=\error\$form_err/li\n; } print '/ul'.\n; } ? form method=post id=contactform action=? print $contact_form_action; ? pTodos os campos obrigatórios são marcados com asteriscos (span class=required*/span)./p fieldset legendSeus Dados/legend label for=empresa_nameEmpresa span class=required*/span/label br / input type=text id=empresa_name name=empresa_name size=30 value=? print $empresa_name; ? / br / label for=contato_nameContato span class=required*/span/label br / input type=text id=contato_name name=contato_name size=30 value=? print $contato_name; ? / br / label for=foneNúmero do telefone span class=required*/span/label br / input type=text id=fone name=fone size=30 value=? print $fone; ? / br / label for=faxFax/label br / input type=text id=fax name=fax size=30 value=? print $fax; ? / br / label for=contato_emailE-mail span class=required*/span/label br / input type=text id=contato_email name=contato_email
[PHP] How can I install GD support for a php rpm
Hi! My php was installed as a module (libphp5.so) when I install Fedora Core 6. However, when I run phpinfo(), I found that it is -without-gd. I would like to ask how can add GD support without rebuilding the whole thing from source? Thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] About One To Many MYSQL TO XML WITH PHP
I am keep running in to a dead end with trying to convert mysql databse tables (more than 4) to XML with PHP. Initially I tried to convert two tables with the code that's attached to this email, however it's limited to printing out just a table row WHERE column='value'. I can relate two tables on database with two rows that share same relational data, so I can do that for one row. Do you know any website that might explain how to convert joined multiple tables(with every rows) to XML? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable problem?
[ For those of you who are going to get pissed for top-posting, find something better to bitch about. I'm in a rush, but trying to help. ;-P ] Luc, You're not defining $contato_name. Do this: $contato_name = $_POST['contato_name']; On 7/24/07, Luc [EMAIL PROTECTED] wrote: Good afternoon list, Probably a no-brainer for the most of you but i'm in a pickle: i've set up a variable to receive in the body of the notification mail upon sending a form. The body of the mail should read like this: Obrigado por nos contatar, $contato_name. Recebemos sua mensagem e entraremos em contato em breve. (in english: tnx for contacting us, $contato_name. We received your message and will contact you shortly.) Where $contato_name is the name of the contact, as used in the form. The problem is that the message arrives without the $contato_name, so i get: Obrigado por nos contatar, . Recebemos sua mensagem e entraremos em contato em breve. Here's the script: ? // set your own preferences here # // Your email address $youremail = ; // Your web site title (John Doe's Site) $websitetitle = ; // Path to thanks for the message page $thankyoupage = ' '; // Send notification to sender (use false if not required) $sendnotification = true; // Continue with your error checking, output of form, et cetera. $contact_form_action = $_SERVER['PHP_SELF']; if ((isset($_POST[sendcontact])) ($_POST[sendcontact] == contactsent)) { $contacter_form_error = array(); if (empty($_POST['empresa_name'])){ $contacter_form_error[] = 'favor preencher nome da empresa'; } if (empty($_POST['contato_name'])){ $contacter_form_error[] = 'favor preencher nome do contato'; } if (empty($_POST['fone'])){ $contacter_form_error[] = 'favor preencher número do telefone'; } if (empty($_POST['contato_email'])){ $contacter_form_error[] = 'favor preencher seu e-mail'; } if (empty($_POST['produto'])){ $contacter_form_error[] = 'favor preencher o produto'; } if (empty($_POST['origem'])){ $contacter_form_error[] = 'favor preencher origem'; } if (empty($_POST['destino'])){ $contacter_form_error[] = 'favor preencher destino'; } if (empty($_POST['quantidade'])){ $contacter_form_error[] = 'favor preencher quantidade'; } if (empty($_POST['peso'])){ $contacter_form_error[] = 'favor preencher peso'; } if (empty($_POST['comprimento'])){ $contacter_form_error[] = 'favor preencher comprimento'; } if (empty($_POST['altura'])){ $contacter_form_error[] = 'favor preencher altura'; } if (empty($_POST['largura'])){ $contacter_form_error[] = 'favor preencher largura'; } else { $empresa_name = stripslashes($_POST['empresa_name']); $contato_email = stripslashes($_POST['contato_email']); $body =EOB Empresa: $_POST[empresa_name] Contato: $_POST[contato_name] Fone: $_POST[fone] Fax: $_POST[fax] Email: $_POST[contato_email] Produto: $_POST[produto] Origem: $_POST[origem] Destino: $_POST[destino] Quantidade: $_POST[quantidade] Peso: $_POST[peso] Comprimento: $_POST[comprimento] Altura: $_POST[altura] Largura: $_POST[largura] EOB; $subjectline = $websitetitle | Orçamento de empresa; $notification_message = Obrigado por nos contatar, $contato_name. Recebemos sua mensagem e entraremos em contato em breve.; $notification_subject = Obrigado por sua mensagem para $websitetitle.; mail($contato_email,$subjectline,$body, From: $contato_email); mail($contato_email, $notification_subject, $notification_message, From: $youremail); header(Location:$thankyoupage); } } ? // Print form field errors if present if (count($contacter_form_error)0){ print 'p id=bottomstrongAlgo está errado:/strong/p'.\n; print 'ul'.\n; foreach($contacter_form_error as $form_err) { print li class=\error\$form_err/li\n; } print '/ul'.\n; } ? form method=post id=contactform action=? print $contact_form_action; ? pTodos os campos obrigatórios são marcados com asteriscos (span class=required*/span)./p fieldset legendSeus Dados/legend label for=empresa_nameEmpresa span class=required*/span/label br / input type=text id=empresa_name name=empresa_name size=30 value=? print $empresa_name; ? / br / label for=contato_nameContato span class=required*/span/label br / input type=text id=contato_name name=contato_name size=30 value=? print $contato_name; ? / br / label for=foneNúmero do telefone span class=required*/span/label br / input
Re: [PHP] Strategy when working with designer(s)?
The 'Leader' should be an IT Architect who understands both: In a dream world we can pay such a character, what I've seen so far is we invent one out of the guy that knows most: the programmer. (Instant promotion, same salary) From my experience, the project manager would ask the programmer if this and that are possible, and ask for a time estimate. Simon says 1) Designer does his whole job and shows the design when finished and approved Well in a dream world that would be nice but I've never seen it happen in more than 20 years in the industry ... Usually, the designer works with the programmer in advance, but the programmer works as a counsellor. The programmer is there to ensure the scope of the project won't go too far. But basically the only real work done is by the designer. As I said, it's a good thing the programmer gets prepared too in the meantime, makes the login prompts, change password, etc... BUT, I would Never code any client-side until the design is finished. Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable problem?
Good evening Daniel, It was foretold that on 24/7/2007 @ 17:47:46 GMT-0400 (which was 18:47:46 where I live) Daniel Brown would write: snipped a bit You're not defining $contato_name. Do this: $contato_name = $_POST['contato_name']; Yes!! Oh so simple for a non-newbie lol. It works like a charm Daniel. I'm really, really grateful!!! -- Best regards, Luc _ Powered by The Bat! version 3.99.3 with Windows XP (build 2600), version 5.1 Service Pack 2 and using the best browser: Opera. The pleasure of love is in loving. We are happier in the passion we feel than in that we inspire. - François, duc de La Rochefoucauld (1613–1680) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pirate PHP books online?
On 7/24/07, Michelle Konzack [EMAIL PROTECTED] wrote: Am 2007-07-19 19:41:32, schrieb Tijnema: One word: Useless! The watermark can be easily removed, and the guy who puts in on the net will simply remove it, and can't be traced :) Not realy except you know the WHOLE original text. I would put some weird (unknown) phrases into the text.. Greetings Michelle Konzack Systemadministrator Tamay Dogan Network Debian GNU/Linux Consultant See this example: http://rapidshare.com/files/44831440/watermark_text.pdf This is a simple watermark inside a PDF, I tried it with my OCR reader, and it parsed the text about warez (from wikipedia) fine, without reading the watermark. Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: header( 'refresh' ), form data, and IE
On 7/24/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/23/07, Daniel Kasak [EMAIL PROTECTED] wrote: Thanks for the response Dan. Us Dans have to stick together :) On Mon, 2007-07-23 at 17:37 -0700, Dan wrote: Then validate the field obviously! $description = ; $categoryid = ; if(isset($_POST['description'])) $description = ?description=$_POST['description']; if(isset($_POST['categoryid'])) { if($description != ) $categoryid = ; else $categoryid = ?; // if a description has been entered you'll need an symbol otherwise a ? $category .= categoryid=$_POST['categoryid']; // append category to itself with the posted info } H. Yeah I thought it would come to that. I was hoping for a quick nasty fix. I didn't test this it's just off the top of my head, also you should sanitize the input before you do anythign with it really, but that's another issue. Also this is really something that you should be doing with ajax rather than having the page reloading, and passing variables back, etc. This is the EXACT purpose that Ajax as made for, validation of info. Check out XAJAX it's very simple to use but powerfull when you need it. I will try to make some time for investigating ajax. I'm mostly developing in Perl, and doing nice GUI stuff ( ie no web stuff - this is a once-off maintenance thing ), so I'll a little out of my comfort zone ... Thanks again for your help. -- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: [EMAIL PROTECTED] website: http://www.nusconsulting.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php Hello, Dans! Dan K., is there any reason the validation can't reside within the same script as the form, then forward on success? A very simple example: ? if($_POST) { // Check to ensure that your variables are all correct, // then use header(Location: successful-target.php?var1=avar2=b); // And then, on forwarding, remember to exit; } ? FORM METHOD=POST ACTION=?=$_SERVER['PHP_SELF'];? INPUT TYPE=TEXT NAME=var1 VALUE=?=$_POST['var1'];?BR / INPUT TYPE=TEXT NAME=var2 VALUE=?=$_POST['var2'];?BR / INPUT TYPE=SUBMIT VALUE=GO! /FORM Since the user will start with a blank form, and the $_POST values won't already be set, the values in the form will be blank on the initial page load, but for unsuccessful attempts, they'll be populated with the correct data. ~ Dan^[3] -- Daniel P. Brown [office] (570-) 587-7080 Ext. 272 [mobile] (570-) 766-8107 Note that if you have E_NOTICE set in error reporting level, then this gives some warnings about undefined variables! Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I install GD support for a php rpm
On 7/24/07, Davis Chan [EMAIL PROTECTED] wrote: Hi! My php was installed as a module (libphp5.so) when I install Fedora Core 6. However, when I run phpinfo(), I found that it is -without-gd. I would like to ask how can add GD support without rebuilding the whole thing from source? Thanks. Build only the GD module from the PHP package, and add that to the modules to load in php.ini Tijnema -- Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: header( 'refresh' ), form data, and IE
On Tue, 2007-07-24 at 08:13 -0400, Daniel Brown wrote: Hello, Dans! Dan K., is there any reason the validation can't reside within the same script as the form, then forward on success? A very simple example: ? if($_POST) { // Check to ensure that your variables are all correct, // then use header(Location: successful-target.php?var1=avar2=b); // And then, on forwarding, remember to exit; } ? FORM METHOD=POST ACTION=?=$_SERVER['PHP_SELF'];? INPUT TYPE=TEXT NAME=var1 VALUE=?=$_POST['var1'];?BR / INPUT TYPE=TEXT NAME=var2 VALUE=?=$_POST['var2'];?BR / INPUT TYPE=SUBMIT VALUE=GO! /FORM Since the user will start with a blank form, and the $_POST values won't already be set, the values in the form will be blank on the initial page load, but for unsuccessful attempts, they'll be populated with the correct data. ~ Dan^[3] I've completely changed the way I was doing this now. Initially I implemented lots of checks for NULL values, as Dan[2] recommended, and this worked well apart from in the case of text areas. These broke things completely. I've now decided to shove all form data into session globals, and just refresh with a 'load_previous' flag in the URL. I my form constructor sees this flag, it populates things from session globals. Otherwise it resets the session globals with defaults. This seems to be the best solution ( ie the only one that's worked completely so far ). Thank you, both of you. Long live Dans! -- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: [EMAIL PROTECTED] website: http://www.nusconsulting.com.au -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Calling php-cgi.exe
I have written a small web server for windows. It works fine for static HTML files, but I would like to be able to run PHP scripts. Playing with php-cgi.exe on the command line I see that it returns the content type and the generated HTML from a script 'php-cgi.exe test.php'. From experimenting, I also see that I can pass the get vars like 'php-cgi.exe test.php var1=val1 var2=val2'. Is this the best way? How about POST info and do certain things need to be encoded a certain way? Is there a good document on this? TIA, Shawn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] can't open a file
Most likely the web server (Apache?) is not running as you (your username). Maybe it is, in which case take advice from the previous reply. It's most likely running as another user. On linux/unix there is a specific user for the web server depending upon what server. Apache is normally, httpd, apache or nobody. So that user would need permissions. As a test, give everyone permission to the dir, then run your script and see what user owns the created file. Then you can grant only that user write access to the file. -Shawn Crayon Shin Chan wrote: On Monday 23 July 2007 12:23, Ken Tozier wrote: The permissions for the test folder is set to me in a WebServer subfolder on Mac OS X. What exactly does permission ... set to me mean? Do I need to set permissons to something else to get this to work? If so, what permissions should I use? If you wanted to be able to create a file in the directory: /a/b/c/d then you would need 'execute' permission on each of the directory: /a /a/b /a/b/c /a/b/c/d in addition you need 'write' permission for the directory that the file is created in, ie: /a/b/c/d -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: strange stripos behavior
Too much beer to think through the logical progression of the operators, but maybe try: if (stripos($searchtext, '') !== false) { -Shawn Bruce Cowin wrote: I'm using PHP 5.1 on IIS. I have an app that uses MimeDecode to load mime files and I've built an object to parse them into their various parts; i.e., $msg-Body(), $msg-Sender(), etc. I'm using stripos() to look for a string (that I know is in my test files). It works if I search in $msg-Body(), but doesn't work if I build a variable and search it. i.e., this works: if (!stripos($msg-Body(), '') === false) { echo \n found in Body()\n; } but this doesn't (I've tried it with and without htmlentities()): $searchtext = htmlentities($msg-Sender()) . htmlentities($msg-To()) . htmlentities($msg-Cc()) . htmlentities($msg-Subject()) . htmlentities($msg-Body()); if (!stripos($searchtext, '') === false) { echo \nstring found!\n; } Does anyone have any ideas? Thanks. Regards, Bruce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: strange stripos behavior
Thanks for the suggestion. I ended up not building the search string and checking each part individually. FYI, I had noticed that it also depended on what order I built the search string; e.g., $searchstring = $msg-Body() . $msg-Subject()... worked ok but if I put $msg-Subject first it didn't. Is it possible that if $msg-Subject is null that it does something funny to the value in the $searchstring variable? Anyway, it's working now by not using a variable. Thanks again. Regards, Bruce Shawn McKenzie [EMAIL PROTECTED] 25/07/2007 12:33 p.m. Too much beer to think through the logical progression of the operators, but maybe try: if (stripos($searchtext, '') !== false) { -Shawn Bruce Cowin wrote: I'm using PHP 5.1 on IIS. I have an app that uses MimeDecode to load mime files and I've built an object to parse them into their various parts; i.e., $msg-Body(), $msg-Sender(), etc. I'm using stripos() to look for a string (that I know is in my test files). It works if I search in $msg-Body(), but doesn't work if I build a variable and search it. i.e., this works: if (!stripos($msg-Body(), '') === false) { echo \n found in Body()\n; } but this doesn't (I've tried it with and without htmlentities()): $searchtext = htmlentities($msg-Sender()) . htmlentities($msg-To()) . htmlentities($msg-Cc()) . htmlentities($msg-Subject()) . htmlentities($msg-Body()); if (!stripos($searchtext, '') === false) { echo \nstring found!\n; } Does anyone have any ideas? Thanks. Regards, Bruce -- 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] Strategy when working with designer(s)?
On Tuesday 24 July 2007, Simon wrote: 0. The designers we work with frequently need to be told that 3 second feature you just suggested just added 300 hours to the project and destroyed 508 compliance, usually multiple times. That *must* happen before the client sees it, or you're screwed. It's never too early to get the Yea! I have always seen the programmer as the Leader* of the production of the project. He is the one to give the final word on what is Possible or not, and that is precisely what cause most problems (also known as scope of the project). *I am the programmer, maybe my perception of project hierachy is biased by my ego? ;) Simon That may well be a factor, but it's still true. :-) The programmer doesn't have to be the PM. Very often programmers make lousy PMs. But the PM needs to have the programmer and the developer (HTML/CSS person) with them from day 0, and give both a voice. Short changing one and favoring the other will only make both miserable. (Because when the programmer comes back with the form you mocked up is logically impossible, here's how I was able to do it, you get to redesign it now, the developer, designer, and PM are all made miserable, too.) Not that I am speaking from personal experience of course, no, not at all... -- 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
Re: [PHP] Re: strange stripos behavior
OK, so I've had at least 2 more beers since the last reply, but I'll give a shot. I don't know what text is in your message, but here's my logic, so it would depend upon what was concatenated first: Your statement read: if (not) stripos($searchtext, ''), which means false, '' or 0 (which it could be if the first char in $searchtext) then compare that value 0 to false. You used ===, not == so it must also be same type. Integer 0 is not === to boolean false. -Shawn Bruce Cowin wrote: Thanks for the suggestion. I ended up not building the search string and checking each part individually. FYI, I had noticed that it also depended on what order I built the search string; e.g., $searchstring = $msg-Body() . $msg-Subject()... worked ok but if I put $msg-Subject first it didn't. Is it possible that if $msg-Subject is null that it does something funny to the value in the $searchstring variable? Anyway, it's working now by not using a variable. Thanks again. Regards, Bruce Shawn McKenzie [EMAIL PROTECTED] 25/07/2007 12:33 p.m. Too much beer to think through the logical progression of the operators, but maybe try: if (stripos($searchtext, '') !== false) { -Shawn Bruce Cowin wrote: I'm using PHP 5.1 on IIS. I have an app that uses MimeDecode to load mime files and I've built an object to parse them into their various parts; i.e., $msg-Body(), $msg-Sender(), etc. I'm using stripos() to look for a string (that I know is in my test files). It works if I search in $msg-Body(), but doesn't work if I build a variable and search it. i.e., this works: if (!stripos($msg-Body(), '') === false) { echo \n found in Body()\n; } but this doesn't (I've tried it with and without htmlentities()): $searchtext = htmlentities($msg-Sender()) . htmlentities($msg-To()) . htmlentities($msg-Cc()) . htmlentities($msg-Subject()) . htmlentities($msg-Body()); if (!stripos($searchtext, '') === false) { echo \nstring found!\n; } Does anyone have any ideas? Thanks. Regards, Bruce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: strange stripos behavior
For another guru, I have a question. I just checked the returns of this func on php.net to check myself and I see: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or . When would stripos() return ? Thanks! -Shawn Bruce Cowin wrote: Thanks for the suggestion. I ended up not building the search string and checking each part individually. FYI, I had noticed that it also depended on what order I built the search string; e.g., $searchstring = $msg-Body() . $msg-Subject()... worked ok but if I put $msg-Subject first it didn't. Is it possible that if $msg-Subject is null that it does something funny to the value in the $searchstring variable? Anyway, it's working now by not using a variable. Thanks again. Regards, Bruce Shawn McKenzie [EMAIL PROTECTED] 25/07/2007 12:33 p.m. Too much beer to think through the logical progression of the operators, but maybe try: if (stripos($searchtext, '') !== false) { -Shawn Bruce Cowin wrote: I'm using PHP 5.1 on IIS. I have an app that uses MimeDecode to load mime files and I've built an object to parse them into their various parts; i.e., $msg-Body(), $msg-Sender(), etc. I'm using stripos() to look for a string (that I know is in my test files). It works if I search in $msg-Body(), but doesn't work if I build a variable and search it. i.e., this works: if (!stripos($msg-Body(), '') === false) { echo \n found in Body()\n; } but this doesn't (I've tried it with and without htmlentities()): $searchtext = htmlentities($msg-Sender()) . htmlentities($msg-To()) . htmlentities($msg-Cc()) . htmlentities($msg-Subject()) . htmlentities($msg-Body()); if (!stripos($searchtext, '') === false) { echo \nstring found!\n; } Does anyone have any ideas? Thanks. Regards, Bruce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Pirate PHP books online?
At 12:13 AM +0800 7/25/07, Crayon Shin Chan wrote: On Tuesday 24 July 2007 06:12, tedd wrote: How about Rasmus Lerdorf, Lord of the Code I thought it was supposed to be based on a Potter book? Nah, let's make it a brain teaser. Where can these be found? The Little Rasmus O Rasmus, Rasmus, where art thou Rasmus? Rasmus?! Rasmus?! We don't need no stinking Rasmus. Reading, writing, and Rasmus Four score and seven Rasmus ago... In the beginning there was Rasmus, and it was good. We have nothing to Rasmus but Rasmus itself. Catch a Rasmus by it's toe.. In Rasmus we trust. Frankly Rasmus, I don't give a damn. The Rasmus Zone. The Howdy Rasmus show. Have Rasmus will Travel. The land that Rasmus forgot. Znane Rasmus Fifteen minutes of Rasmus. Sixty seconds over Rasmus. Sorry, I've been up for 48 hours -- it's a boy, 8 lb 9 oz -- time to get some sleep. Maybe tomorrow my son will finally decide on a name -- the ninth grand-kid. Maybe he'll name him Rasmus. God, I hope not. :-) Cheers, tedd -- --- http://sperling.com http://ancientstones.com http://earthstones.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: strange stripos behavior
On Tue, 2007-07-24 at 20:03 -0500, Shawn McKenzie wrote: For another guru, I have a question. I just checked the returns of this func on php.net to check myself and I see: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or . When would stripos() return ? It wouldn't. What it means is that if you use == to test the return value then you won't know if the string failed to match or if it matched at index 0. Instead you should use === false to check for failure. Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About One To Many MYSQL TO XML WITH PHP
kelvin, i dont see the attachement. -nathan On 7/24/07, Kelvin Park [EMAIL PROTECTED] wrote: I am keep running in to a dead end with trying to convert mysql databse tables (more than 4) to XML with PHP. Initially I tried to convert two tables with the code that's attached to this email, however it's limited to printing out just a table row WHERE column='value'. I can relate two tables on database with two rows that share same relational data, so I can do that for one row. Do you know any website that might explain how to convert joined multiple tables(with every rows) to XML? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About One To Many MYSQL TO XML WITH PHP
Kelvin Park wrote: I am keep running in to a dead end with trying to convert mysql databse tables (more than 4) to XML with PHP. Initially I tried to convert two tables with the code that's attached to this email, however it's limited to printing out just a table row WHERE column='value'. I can relate two tables on database with two rows that share same relational data, so I can do that for one row. Do you know any website that might explain how to convert joined multiple tables(with every rows) to XML? The php lists don't accept attachments. Forget about xml being involved - how would you tackle this problem in php or when displaying in a table (or css :P) layout? Answer that then you have your answer for xml :) -- 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 install GD support for a php rpm
Davis Chan wrote: Hi! My php was installed as a module (libphp5.so) when I install Fedora Core 6. However, when I run phpinfo(), I found that it is -without-gd. I would like to ask how can add GD support without rebuilding the whole thing from source? Thanks. install the php-gd rpm. -- 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] Re: strange stripos behavior
Yes, I understand that, but it said that this function may return 0 or . So I guess that is just a generic statement to illustrate the point. -Shawn Robert Cummings wrote: On Tue, 2007-07-24 at 20:03 -0500, Shawn McKenzie wrote: For another guru, I have a question. I just checked the returns of this func on php.net to check myself and I see: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or . When would stripos() return ? It wouldn't. What it means is that if you use == to test the return value then you won't know if the string failed to match or if it matched at index 0. Instead you should use === false to check for failure. Cheers, Rob. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Calling php-cgi.exe
On Tue, July 24, 2007 6:26 pm, Shawn McKenzie wrote: I have written a small web server for windows. It works fine for static HTML files, but I would like to be able to run PHP scripts. Playing with php-cgi.exe on the command line I see that it returns the content type and the generated HTML from a script 'php-cgi.exe test.php'. From experimenting, I also see that I can pass the get vars like 'php-cgi.exe test.php var1=val1 var2=val2'. Is this the best way? How about POST info and do certain things need to be encoded a certain way? Is there a good document on this? This might be best addressed on the internals list if nobody here replies. There are also other webservers with open source you could read. Apache, of course, but also smaller ones. Xitami maybe? Lighthttp? Also, whatever the CGI spec says, presumably applies to the PHP CGI. It's an oldie but a goodie. :-) -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] About One To Many MYSQL TO XML WITH PHP
On Tue, July 24, 2007 4:47 pm, Kelvin Park wrote: I am keep running in to a dead end with trying to convert mysql databse tables (more than 4) to XML with PHP. Initially I tried to convert two tables with the code that's attached to this email, however it's limited to printing out just a table row WHERE column='value'. I can relate two tables on database with two rows that share same relational data, so I can do that for one row. Do you know any website that might explain how to convert joined multiple tables(with every rows) to XML? Seems to me you could create a view in SQL with whatever you want, and then dump it to XML as one big fat table... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] How can I install GD support for a php rpm
On Tue, July 24, 2007 4:37 pm, Davis Chan wrote: Hi! My php was installed as a module (libphp5.so) when I install Fedora Core 6. However, when I run phpinfo(), I found that it is -without-gd. I would like to ask how can add GD support without rebuilding the whole thing from source? Thanks. FC6 almost for sure has some kind of php_gd_blah_blah_blah package you can just up2date install or whatever they are doing this week to suck in rpms. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Calling php-cgi.exe
OK, thanks. I thought since php.exe had help and documentation for command line args, so would the cgi have some pointers or best practices of what to pass and how. -Shawn Richard Lynch wrote: On Tue, July 24, 2007 6:26 pm, Shawn McKenzie wrote: I have written a small web server for windows. It works fine for static HTML files, but I would like to be able to run PHP scripts. Playing with php-cgi.exe on the command line I see that it returns the content type and the generated HTML from a script 'php-cgi.exe test.php'. From experimenting, I also see that I can pass the get vars like 'php-cgi.exe test.php var1=val1 var2=val2'. Is this the best way? How about POST info and do certain things need to be encoded a certain way? Is there a good document on this? This might be best addressed on the internals list if nobody here replies. There are also other webservers with open source you could read. Apache, of course, but also smaller ones. Xitami maybe? Lighthttp? Also, whatever the CGI spec says, presumably applies to the PHP CGI. It's an oldie but a goodie. :-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Variable problem?
On Tue, July 24, 2007 3:33 pm, Luc wrote: if (empty($_POST['altura'])){ $contacter_form_error[] = 'favor preencher altura'; } if (empty($_POST['largura'])){ $contacter_form_error[] = 'favor preencher largura'; } else { $empresa_name = stripslashes($_POST['empresa_name']); $contato_email = stripslashes($_POST['contato_email']); I think you're just missing $contato_name = $_POST['contato_name'] in here somewhere... I got kinda lost, though. That said, if you are using striplashes, you have magic_quotes_gpc on, and that's something you may want to turn off in the first place. Or consider checking if it's on in your code rather than assuming it's on. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pirate PHP books online?
On Tuesday 24 July 2007, tedd wrote: Sorry, I've been up for 48 hours -- it's a boy, 8 lb 9 oz -- time to get some sleep. Maybe tomorrow my son will finally decide on a name -- the ninth grand-kid. Maybe he'll name him Rasmus. God, I hope not. :-) Cheers, tedd Yay, congrats! -- 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
Re: [PHP] About One To Many MYSQL TO XML WITH PHP
have you been able to get it to work w/ a select from just 1 table ? if thats the case then you are prolby getting hung up thinking about it being 4 tables. you should get the system going for just 1 table. once you have that try it for the joined query; the php to process the result set and build the xml should be the same in both cases, except there will likely be more columns in the latter query. -nathan On 7/24/07, Richard Lynch [EMAIL PROTECTED] wrote: On Tue, July 24, 2007 4:47 pm, Kelvin Park wrote: I am keep running in to a dead end with trying to convert mysql databse tables (more than 4) to XML with PHP. Initially I tried to convert two tables with the code that's attached to this email, however it's limited to printing out just a table row WHERE column='value'. I can relate two tables on database with two rows that share same relational data, so I can do that for one row. Do you know any website that might explain how to convert joined multiple tables(with every rows) to XML? Seems to me you could create a view in SQL with whatever you want, and then dump it to XML as one big fat table... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Pirate PHP books online?
On Tue, 2007-07-24 at 21:09 -0400, tedd wrote: Sorry, I've been up for 48 hours -- it's a boy, 8 lb 9 oz -- time to get some sleep. Maybe tomorrow my son will finally decide on a name -- the ninth grand-kid. Maybe he'll name him Rasmus. God, I hope not. :-) Wooho! Congratulations Gramps! :) Cheers, Rob. -- ... SwarmBuy.com - http://www.swarmbuy.com Leveraging the buying power of the masses! ... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem iterating over an array with foreach and a reference variable
Chris Mika wrote: I don't know if I'm doing something wrong or if this is a bug. the problem is due ot reuse of the variable you define by reference in the second loop - cant really explain why its doing what you see but IIRC its not a bug, an artifact of the way references work. someone with a clearer head and a better understanding might be able to explain the instrincasies of what your seeing. see what happens if you add the unset() as given below (you will see that the code does what you expect with the unset() Very simply: I created an array with values 1-5. I use a foreach loop to iterate over it to add 1 to the values. It correctly iterates over the array except for the last value. Code: ?php $test = array(1, 2, 3, 4, 5); print original: br; foreach ($test as $part) { print ($part) ; } print br changing: br; foreach ($test as $part) { print ($part - ; $part ++; print $part) ; } unset($part); print brfinal:br; foreach ($test as $part) { print ($part) ; } print brvar dump:br; var_dump($test); ? Expected Output: original: (1) (2) (3) (4) (5) changing: (1 - 2) (2 - 3) (3 - 4) (4 - 5) (5 - 6) final: (2) (3) (4) (5) (6) var dump: array(5) { [0]= int(2) [1]= int(3) [2]= int(4) [3]= int(5) [4]= int(5) } Actual Output: original: (1) (2) (3) (4) (5) changing: (1 - 2) (2 - 3) (3 - 4) (4 - 5) (5 - 6) final: (2) (3) (4) (5) (5) var dump: array(5) { [0]= int(2) [1]= int(3) [2]= int(4) [3]= int(5) [4]= ?(5) } Any help? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: Re[2]: [PHP] Pirate PHP books online?
On 25/07/07, tedd [EMAIL PROTECTED] wrote: Sorry, I've been up for 48 hours -- it's a boy, 8 lb 9 oz -- time to get some sleep. Maybe tomorrow my son will finally decide on a name -- the ninth grand-kid. Maybe he'll name him Rasmus. God, I hope not. :-) Public congratulations. Our home was blessed with a baby girl just about 6 months ago. Therefore, we also do not sleep... Dotan Cohen http://lyricslist.com/ http://what-is-what.com/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strategy when working with designer(s)?
On Mon, July 23, 2007 3:00 pm, Steve Finkelstein wrote: This is more of a conceptual based inquiry. I'm currently working on some projects which require me to build system 'X' prior to any (X)HTML/CSS/graphics are available to me. A lot of the time, I just garble up default tables/forms/images to replace what the designer will be ultimately adjusting. It's certainly a lot simpler to have someone come to you with the CSS/HTML and then building on top of that. I was curious how do you folks who strictly do development and not designing, strategically work with a designer in this fashion? Do you have a skeleton you follow or preload some existing templates and then code around that? If there's even a book which focuses on such concepts, I'd be more than happy to purchase and read it. I'd just build it with a bunch of simple div's and not even worry at all about layout. The Designer will *still* come along and do something funky with more and more and more div's wrapped around div's wrapped around div's to force you to rebuild the dang thing anyway (sigh), but at least you have a clean start. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Better way to store data in memory?
On Mon, July 23, 2007 11:50 am, Richard Davey wrote: I'm building up some image data in my PHP script (ready for output to the browser). Having to do some complex per pixel manipulation, which is fine - but I'm just wondering is there a quicker / more efficient way of storing the pixel data than in an array? At the moment I hold it in $array[$x][$y], which makes the drawing loop painless, but it's creating an array with 307,200 elements which is proving to be quite slow. As I'm only storing fixed width byte values is there an alternative method? For example the ability to read/write to a chunk of memory instead? (so I can read out whole strips of data rather than one by one?) I was looking at the Shared Memory functions, but that isn't exactly what I need (I don't want it shared, I want it process specific) It's possible, maybe, that using imagecolorat and imagesetcolor (or whatever it is) would be faster than array access... You'd certainly save at least ONE 307,200 iteration at the end when you cram it into the image... It would be Really Nifty if the GD library provided functions to convert a pixel column to an array and vice versa, eh? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Problem compile 5.2.3 souce under SUSE 10.1
On Mon, July 23, 2007 9:48 am, Jeff Lanzarotta wrote: I am not sure if this is the right mailing list or not, but here goes... I am attempting to compile php 5.2.3 from source under SUSE 10.1. The compile is fine, it is the 'make test' that is failing... When I run 'make test' I am getting: = FAILED TEST SUMMARY - double to string conversion tests [Zend/tests/double_to_string.phpt] Bug #16069 (ICONV transliteration failure) [ext/iconv/tests/bug16069.phpt] iconv stream filter [ext/iconv/tests/iconv_stream_filter.phpt] strripos() offset integer overflow [ext/standard/tests/strings/strripos_offset.phpt] = I have sent the automatic report, but have not heard anything back. Does anyone have any ideas on how to fix this? Ignore it. :-) The PHP tests are in a constant state of flux and rarely, if ever, do you get 100% pass, at least in my experience. And if you are not actually using iconv, then you definitely don't care. Even if you ARE using iconv, it may not be a bug you'll ever trigger. You can, of course, research bug #16069 at http://bugs.php.net to see what it's all about and make an informed decision. That might be even better than just ignoring it. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] strange stripos behavior
Don't call htmlentities until the last possible micro-second before you echo the data to the HTML/browser. That way you can be sure the data you have is the data you think you have. On Sun, July 22, 2007 11:23 pm, Bruce Cowin wrote: I'm using PHP 5.1 on IIS. I have an app that uses MimeDecode to load mime files and I've built an object to parse them into their various parts; i.e., $msg-Body(), $msg-Sender(), etc. I'm using stripos() to look for a string (that I know is in my test files). It works if I search in $msg-Body(), but doesn't work if I build a variable and search it. i.e., this works: if (!stripos($msg-Body(), '') === false) { echo \n found in Body()\n; } but this doesn't (I've tried it with and without htmlentities()): $searchtext = htmlentities($msg-Sender()) . htmlentities($msg-To()) . htmlentities($msg-Cc()) . htmlentities($msg-Subject()) . htmlentities($msg-Body()); if (!stripos($searchtext, '') === false) { echo \nstring found!\n; } Does anyone have any ideas? Thanks. Regards, Bruce -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: strange stripos behavior
On Tue, July 24, 2007 8:30 pm, Robert Cummings wrote: On Tue, 2007-07-24 at 20:03 -0500, Shawn McKenzie wrote: For another guru, I have a question. I just checked the returns of this func on php.net to check myself and I see: This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE, such as 0 or . When would stripos() return ? It wouldn't, almost for sure. The language there is boiler-plate for this function and other functions that do return in some circumstances. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] RecursiveArrayIterator
On Sun, July 22, 2007 9:02 pm, Kevin Waterson wrote: This one time, at band camp, Nathan Nobbe [EMAIL PROTECTED] wrote: Thanks for the response. I was hoping to avoid this sort of recursion within userspace and keep it at a lower level. Should not the recursive iterator recurse so we dont need to be using user defined functions? printArrayKeysRecursively($innerRecursiveArrayIterator); // handle printing I don't understand this SPL stuff (and don't want to, as it just gives me a headache to even look at the function names) but you've got this: $foo = array( array ( 'a', 'b', 'c')); So of course your outer array has 0 = [inner array] in it. How you get some funky SPL thing to only dump out the inner array is beyond me... There is an array_collapse or somesuch that will sort of smush all the sub-arrays into one big array, which might do what you want. Or not. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: About XSLT/XML Pagination
On Sun, July 22, 2007 12:44 pm, Tony Marston wrote: also, is there any reason to leverage the validation features of xml while building a dynamic page? for instance assume data was drawn from a database to create 1 or more xml files. would it make sense to validate those new xml files prior to invoking the xslt processor, and optionally not invoke the transformation process if the xml data is found to be invalid? This would be overkill. If you are going to build and consume an XML document yourself there is no point in validating it. Remember that XML was originally designed as a format for data interchange, so validation is only necessary when you receive an XML document from a third party. It's conceivable that the contents of the database and/or the PHP code could be 'buggy' to create invalid XML... It might be best, however, to have some nice TEST scripts that built the XML nightly and validated it, rather than do it every time in production. YMMV -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] session_decode from session handler
On Sat, July 21, 2007 11:19 pm, Jeffery Fernandez wrote: I have a similar problem I am facing with session data stored in the database from the set_session_handler. What I am trying to do is show a list of online users and the page they are currenlty viewing. For this purpose I am query the sessions table to get the list of session and from that I loop through to get the session data of each online user. But for some reason, I cannot decode/un-serialise the session data. Any pointers ? Don't do that. :-) Instead of crawling through everybody's session data all the time, just have each page hit register the user's current page and timestamp in their DB profile. Then a simple SQL query against the DB tells you who is looking at what. The session data could easily get much much much to big to load/decode easily/quickly. A single update query on a pageview should not kill you. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Bundled GD compiling?
On Sun, July 22, 2007 5:56 am, Tijnema wrote: On 7/22/07, Hayden Livingston [EMAIL PROTECTED] wrote: I'm confused as to certain issues regarding the bundled version. The documentation says:: To use the recommended bundled version of the GD library (which was first bundled in PHP 4.3.0), use the configure option --with-gd. GD library requires libpng and libjpeg to compile. Note: When compiling PHP with libpng, you must use the same version that was linked with the GD library. This (to me) seems ambiguous. How am I suppose to know which libpng the bundled GD library used? So how should I configure? http://www.libgd.org/FAQ_PHP ./configure --with-gd -with-png-dir=/usr --with-jpeg-dir=/usr --with-freetype-dir=/usr' The FAQ says this is all the features? Thanks a bunch. THe bundled version of GD isn't compiled yet, it is the source code that is bundled, and GD will be compiled when you compile PHP, and so it will be allways the same libpng for GD and PHP :) If you compile things separately with different versions in between one compile and the next, and start mixing and matching your .so (or .dll) files, you can manage to get the PNG and GD out of sync. You have to be expert enough to do that, but not expert enough to realize how foolish it is... That limits the potential idiot pool quite a bit. :-) [I'm in it, however.] -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pirate PHP books online?
On Sat, July 21, 2007 3:34 am, Crayon Shin Chan wrote: On Saturday 21 July 2007 16:20, Jim Lucas wrote: more then likely, recycling a stack of newspapers would cost more then running my computer for a month. Also reminds me of how some people (especially Americans) who drive miles and miles in their big gas-guzzling SUVs so they could drop off their recyclables at a recycling centre. Yeah, man, just put it out in a separate bag for the homeless guy to pick up easily so he doesn't have to dump out your whole trash bin to find the aluminum cans! Oh. Maybe it works different in other 'hoods... :-v -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: Pirate PHP books online?
On Sat, July 21, 2007 3:40 am, Crayon Shin Chan wrote: On Saturday 21 July 2007 08:58, Richard Lynch wrote: In the olden days, it often turned into slash the cover and donate it and collect tax break, I do believe, but I think that practice was decried and has decreased. Just curious, which part was decried: slash the cover or donate it and collect tax break or collect tax break? The combination of: A) getting back the total money paid, and B) declaring a text break for the cost of the book It's kinda not kosher under IRS rules, I don't think... But, heh, I don't know for sure. I've sort of put together disparate comments from several people into a theory on this... -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Pirate PHP books online?
On Sat, July 21, 2007 6:42 am, David Powers wrote: Richard Lynch wrote: I've got a pretty good idea what your advance was, and what your royalties are. I'm under no illusion that the 2,000+ downloads of my book would have turned into legitimate sales if illegal copies weren't available. But writing about PHP is a highly competitive niche market. Any loss of sales is unwelcome. At no point did I intend to sound unsympathetic to your plight! I only wanted to make it clear that 99.9% of musicians are in the same boat with you, despite what you read in the newspapers. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Find file version
I've been recently toying with the idea of creating a php script to emulate the function of File Hippo's program checker (checks certain programs for their version, and then uploads to file hippo to compare with what it is released to show a list of available updates. I've hit a brick wall though. I know binary files have version information available, but can't find anything for php to read this. Has anyone run across something like this in the past? Anyone have any hints of where to go to start reading this info? Thanks Matt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php