php-general Digest 9 Jul 2007 19:59:39 -0000 Issue 4894

2007-07-09 Thread php-general-digest-help
php-general Digest 9 Jul 2007 19:59:39 - Issue 4894 Topics (messages 258482 through 258512): Re: A very strange loop! 258482 by: Fredrik Thunberg 258483 by: Darren Whitlen 258484 by: Jason 258485 by: Fredrik Thunberg 258486 by: Chris 258487

[PHP] A very strange loop!

2007-07-09 Thread Xell Zhang
Hello all, I met a very strange problem today. Take a look at the codes below: for ($i = 'A'; $i 'Z'; $i++) { echo $i . ' '; } If you think the output is A-Z, please run it on your server and try. Who can tell me why the result is not A-Z? -- Zhang Xiao Junior engineer, Web development

Re: [PHP] A very strange loop!

2007-07-09 Thread Fredrik Thunberg
For exactly the same reason as for( $i = 0; $i 10; $i++) produces 0-9 It loops whule $i is lesser than 'Z' When $i becomes 'Z' it stops and doesn't echo But i guess you're having trouble with (note the '='): for ($i = 'A'; $i = 'Z'; $i++) { echo $i . ' '; } This might produce a wierd

[PHP] Re: A very strange loop!

2007-07-09 Thread Darren Whitlen
Xell Zhang wrote: Hello all, I met a very strange problem today. Take a look at the codes below: for ($i = 'A'; $i 'Z'; $i++) { echo $i . ' '; } If you think the output is A-Z, please run it on your server and try. Who can tell me why the result is not A-Z? The result doesnt include the

Re: [PHP] A very strange loop!

2007-07-09 Thread Jason
Because you need $i= 'Z' to get Z included as well. J At 08:49 09/07/2007, Xell Zhang wrote: Hello all, I met a very strange problem today. Take a look at the codes below: for ($i = 'A'; $i 'Z'; $i++) { echo $i . ' '; } If you think the output is A-Z, please run it on your server and try.

Re: [PHP] A very strange loop!

2007-07-09 Thread Fredrik Thunberg
No, that won't work Either use != 'AA' or for( $i = ord('A'); $i = ord('Z'); $i++) { echo chr( $i ) . ' '; } Jason skrev: Because you need $i= 'Z' to get Z included as well. J At 08:49 09/07/2007, Xell Zhang wrote: Hello all, I met a very strange problem today. Take a look at the codes

Re: [PHP] A very strange loop!

2007-07-09 Thread Chris
Xell Zhang wrote: Hello all, I met a very strange problem today. Take a look at the codes below: for ($i = 'A'; $i 'Z'; $i++) { echo $i . ' '; } If you think the output is A-Z, please run it on your server and try. Who can tell me why the result is not A-Z? Try foreach (range('a', 'z') as

Re: [PHP] A very strange loop!

2007-07-09 Thread clive
Xell Zhang wrote: for ($i = 'A'; $i 'Z'; $i++) { echo $i . ' '; } Rather do it like this: for ($i = 65; $i 91; $i++) { echo chr($i) . ' '; } -- Regards, Clive. Real Time Travel Connections {No electrons were harmed in the creation, transmission or reading of this email. However, many

[PHP] About Incorporating MySQL and XML/XSLT/PHP

2007-07-09 Thread Kelvin Park
I'm using XSLT to make a website template and XML to describe the data on my website. Do I parse the data from MySQL to XML in order to apply styles and display them as XHTML with XSLT? I would have to use PHP to parse XML, however I was unclear on how to pass MySQL data to XML in order for it

Re: [PHP] Re: what trick is this? How to do it?

2007-07-09 Thread clive
Man-wai Chang wrote: I asked here because I believe good PHP programmers are usually well-versed in client-side stuffs. :) That comment reeks of NLP :) clive -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] A very strange loop!

2007-07-09 Thread Xell Zhang
OK. I did test like this: $a = 'Z'; $b = $a; $b++; print 'b = abr /'; print 'b++br /'; if ($a $b) print 'a bbr /'; The output is funny:) Thanks all of you! I think clive's way is the best for me:) On 7/9/07, Chris [EMAIL PROTECTED] wrote: Xell Zhang wrote: Hello all, I met a very

[PHP] Another simple question (Probably)

2007-07-09 Thread Jason Pruim
Okay so given this section of code: $taskTime=mktime(00,00,00,$_POST['txtReschedule']); echo HTML tr td bgcolor={$rowColor}ID#, {$row['id']} /td td bgcolor={$rowColor}TicklerName, {$row['task_name']} /td td bgcolor={$rowColor}Instructions, a href='{$row

Re: [PHP] Where does PHP look for php.ini??

2007-07-09 Thread clive
Nathan Nobbe wrote: On 7/6/07, Tijnema [EMAIL PROTECTED] wrote: Completely missed it LOL, it looks for it in /usr/lib :S Is that normal? i beleive it depends on the OS/distribution. on gentoo php.ini is located my ubuntu box looks like this: etc/php5 |-- apache2 | `-- php.ini |-- cgi |

Re: [PHP] Another simple question (Probably)

2007-07-09 Thread clive
Jason Pruim wrote: Okay so given this section of code: $taskTime=mktime(00,00,00,$_POST['txtReschedule']); im not certain, but I dont think you can pass the date to mktime as 1 variable, the function requires the following mktime($hour, $minute,$second, $month , $day ,$year); so maybe

Re: [PHP] triming utf8 (?) a string

2007-07-09 Thread Rick Pasotto
On Sun, Jul 08, 2007 at 06:30:54PM -0700, Jim Lucas wrote: Rick Pasotto wrote: I'm using the PEAR Crypt_Blowfish module. When I decrypt the encrypted string the result is the original plus some '\ufffd' bytes. How can I get rid of those extra bytes? I've tried both trim($x,'\ufffd') and

[PHP] default values in function call behaves differently in PHP5.2.4 and PHP5.0.4

2007-07-09 Thread dor kam
Hi list. I am quite new in the area. I found a difference between PHP 5.2.4 to 5.0.4 in case of passing parameter to function, with default value: f1($par=0); in 5.2.4 the par is assigned to zero AFTER function call and thus, par is always ZERO ! The desired code in 5.2.4 should probably be:

Re: [PHP] Another simple question (Probably)

2007-07-09 Thread Shafiq Rehman
Hi, correct syntax for mktime is mktime( int hour, int minute, int second, int month, int day, int year) -- Shafiq Rehman (ZCE) http://www.phpgurru.com | http://shafiq.pk Cell: +92 300 423 9385 On 7/9/07, Jason Pruim [EMAIL PROTECTED] wrote: Okay so given this section of code:

Re: [PHP] About Incorporating MySQL and XML/XSLT/PHP

2007-07-09 Thread Nathan Nobbe
Kelvin, you will want to use SimpleXML if you can or DOM if you have to to build XML data. you will populate certain portions of said XML using data from the database. Then said XML is handed to the XSLT processor along w/ an XSL file. The XSL file makes reference to the XML that you give it

Re: [PHP] Another simple question (Probably)

2007-07-09 Thread Jason Pruim
On Jul 9, 2007, at 9:02 AM, clive wrote: Jason Pruim wrote: Okay so given this section of code: $taskTime=mktime(00,00,00,$_POST['txtReschedule']); im not certain, but I dont think you can pass the date to mktime as 1 variable, the function requires the following mktime($hour,

Re: [PHP] triming utf8 (?) a string

2007-07-09 Thread Jim Lucas
Rick Pasotto wrote: On Sun, Jul 08, 2007 at 06:30:54PM -0700, Jim Lucas wrote: Rick Pasotto wrote: I'm using the PEAR Crypt_Blowfish module. When I decrypt the encrypted string the result is the original plus some '\ufffd' bytes. How can I get rid of those extra bytes? I've tried both

Re: [PHP] Another simple question (Probably)

2007-07-09 Thread Jim Lucas
Jason Pruim wrote: Okay so given this section of code: $taskTime=mktime(00,00,00,$_POST['txtReschedule']); where are you getting the $_POST['txtReschedule'] var from? in the html below, your var is $_POST['tasks'][#]['txtReschedule'] What does this var value look like? try strtotime() on

Re: [PHP] Another simple question (Probably)

2007-07-09 Thread Daniel Brown
On 7/9/07, Shafiq Rehman [EMAIL PROTECTED] wrote: Hi, correct syntax for mktime is mktime( int hour, int minute, int second, int month, int day, int year) -- Shafiq Rehman (ZCE) http://www.phpgurru.com | http://shafiq.pk Cell: +92 300 423 9385 On 7/9/07, Jason Pruim [EMAIL PROTECTED] wrote:

Re: [PHP] Where does PHP look for php.ini??

2007-07-09 Thread Tijnema
On 7/8/07, Mario Guenterberg [EMAIL PROTECTED] wrote: On Sat, Jul 07, 2007 at 02:08:21AM +0200, Tijnema wrote: Hi, I just noted that my php (CLI and Apache2 SAPI) doesn't read my php.ini in /etc I have compiled php with --prefix=/usr, and my /usr/etc is symlinked to /etc, but it

Re: [PHP] Another simple question (Probably)

2007-07-09 Thread Tijnema
On 7/9/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/9/07, Shafiq Rehman [EMAIL PROTECTED] wrote: Hi, correct syntax for mktime is mktime( int hour, int minute, int second, int month, int day, int year) -- Shafiq Rehman (ZCE) http://www.phpgurru.com | http://shafiq.pk Cell: +92 300

Re: [PHP] Another simple question (Probably)

2007-07-09 Thread Daniel Brown
On 7/9/07, Tijnema [EMAIL PROTECTED] wrote: On 7/9/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/9/07, Shafiq Rehman [EMAIL PROTECTED] wrote: Hi, correct syntax for mktime is mktime( int hour, int minute, int second, int month, int day, int year) -- Shafiq Rehman (ZCE)

Re: [PHP] Another simple question (Probably)

2007-07-09 Thread Tijnema
On 7/9/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/9/07, Tijnema [EMAIL PROTECTED] wrote: On 7/9/07, Daniel Brown [EMAIL PROTECTED] wrote: On 7/9/07, Shafiq Rehman [EMAIL PROTECTED] wrote: Hi, correct syntax for mktime is mktime( int hour, int minute, int second, int month,

[PHP] Re: About Incorporating MySQL and XML/XSLT/PHP

2007-07-09 Thread Tony Marston
Try these for size: http://www.tonymarston.net/php-mysql/domxml.html and http://www.tonymarston.net/php-mysql/sablotron.html http://www.tonymarston.net/php-mysql/dom.html and http://www.tonymarston.net/php-mysql/xsl.html There is also a sample application available at

Re: [PHP] Re: About Incorporating MySQL and XML/XSLT/PHP

2007-07-09 Thread Nathan Nobbe
Tony, this material looks quite excellent; thanks for sharing. -nathan On 7/9/07, Tony Marston [EMAIL PROTECTED] wrote: Try these for size: http://www.tonymarston.net/php-mysql/domxml.html and http://www.tonymarston.net/php-mysql/sablotron.html http://www.tonymarston.net/php-mysql/dom.html

Re: [PHP] triming utf8 (?) a string

2007-07-09 Thread Rick Pasotto
On Mon, Jul 09, 2007 at 07:45:10AM -0700, Jim Lucas wrote: Rick Pasotto wrote: On Sun, Jul 08, 2007 at 06:30:54PM -0700, Jim Lucas wrote: Rick Pasotto wrote: I'm using the PEAR Crypt_Blowfish module. When I decrypt the encrypted string the result is the original plus some '\ufffd' bytes. How

Re: [PHP] Re: About Incorporating MySQL and XML/XSLT/PHP

2007-07-09 Thread Nathan Nobbe
i havent had time to fully explore the material from Tony yet, but so far ive been building XML entirely in memory rather than reading in a complete file, parsing it and placing data at certain points. one thing i would like to explore is either DTDs or XMLSchema to validate the XML against. in

[PHP] ftp_ssl_connect

2007-07-09 Thread Daniel Novotny
Hello, I am running PHP 5.2.0 on a RHEL4 server with FTP and OpenSSL enabled: ftp FTP support = enabled openssl OpenSSL support = enabled OpenSSL Version = OpenSSL 0.9.7a Feb 19 2003 I am aware of the issue of ftp_ssl_connect() silently failing to ftp_connect() in my version of PHP;

Re: [PHP] triming utf8 (?) a string

2007-07-09 Thread Jim Lucas
Rick Pasotto wrote: On Mon, Jul 09, 2007 at 07:45:10AM -0700, Jim Lucas wrote: Rick Pasotto wrote: On Sun, Jul 08, 2007 at 06:30:54PM -0700, Jim Lucas wrote: Rick Pasotto wrote: I'm using the PEAR Crypt_Blowfish module. When I decrypt the encrypted string the result is the original plus some

Re: [PHP] Where does PHP look for php.ini??

2007-07-09 Thread Mario Guenterberg
On Mon, Jul 09, 2007 at 05:16:20PM +0200, Tijnema wrote: I've build my own Linux, so good to know how to change it :) Tijnema Ahh, a linux from scratch user, eh? :-) If you need it or want some usefull input, I have very usefull build scripts for apache/php and mysql/postgresql. I use this

Re: [PHP] Where does PHP look for php.ini??

2007-07-09 Thread Tijnema
On 7/9/07, Mario Guenterberg [EMAIL PROTECTED] wrote: On Mon, Jul 09, 2007 at 05:16:20PM +0200, Tijnema wrote: I've build my own Linux, so good to know how to change it :) Tijnema Ahh, a linux from scratch user, eh? :-) If you need it or want some usefull input, I have very usefull build

Re: [PHP] Re: About Incorporating MySQL and XML/XSLT/PHP

2007-07-09 Thread Nathan Nobbe
Wouldn't XSLT document be filled with input forms if I want to receive information from the customers? XHTML forms are probly the most ubiquitous way to get data from a user to an application. and to be specific, the xsl files are those that would contain the XHTML forms. There is no great

Re: [PHP] Where does PHP look for php.ini??

2007-07-09 Thread Mario Guenterberg
On Mon, Jul 09, 2007 at 10:38:24PM +0200, Tijnema wrote: On 7/9/07, Mario Guenterberg [EMAIL PROTECTED] wrote: On Mon, Jul 09, 2007 at 05:16:20PM +0200, Tijnema wrote: I've build my own Linux, so good to know how to change it :) Tijnema Ahh, a linux from scratch user, eh? :-)

[PHP] Php-general-help/--STOP !!! No Pague de MAS... !!

2007-07-09 Thread Php-general-help 9
dollop absolution monogamy gallop jog heuristic stifle cove injudicious stab togs equitable averse concord brazzaville punish deed detroit

Re: [PHP] Re: About Incorporating MySQL and XML/XSLT/PHP

2007-07-09 Thread Nathan Nobbe
Kevin, would you mind sending the particular url w/ the content you are referring to? also, data doesnt necessarily need to go through xml on its way back to the database. consider a web form for instance which might submit data to your application via HTTP POST. in that case you could simply

Re: [PHP] Re: About Incorporating MySQL and XML/XSLT/PHP

2007-07-09 Thread Nathan Nobbe
I said, Kevin my bad; meant to say Kelvin.. -nathan On 7/9/07, Nathan Nobbe [EMAIL PROTECTED] wrote: Kevin, would you mind sending the particular url w/ the content you are referring to? also, data doesnt necessarily need to go through xml on its way back to the database. consider a web

Re: [PHP] Where does PHP look for php.ini??

2007-07-09 Thread Tijnema
On 7/9/07, Mario Guenterberg [EMAIL PROTECTED] wrote: On Mon, Jul 09, 2007 at 10:38:24PM +0200, Tijnema wrote: On 7/9/07, Mario Guenterberg [EMAIL PROTECTED] wrote: On Mon, Jul 09, 2007 at 05:16:20PM +0200, Tijnema wrote: I've build my own Linux, so good to know how to change it :)

[PHP] Re: Simple PHP setting arrays with keys question

2007-07-09 Thread Dan
Oh yeah, the problem isn't that I'm using - instead of =. Well that was a problem but I fixed that and it's still not working. - Dan Dan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm having a little problem assigning a value to an array which has a key. It's simple, I just

[PHP] Re: Simple PHP setting arrays with keys question

2007-07-09 Thread Dan
Oh yeah, the problem isn't that I'm using - instead of =. Well that was a problem but I fixed that and it's still not working. - Dan Dan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm having a little problem assigning a value to an array which has a key. It's simple, I just

[PHP] Simple PHP setting arrays with keys question

2007-07-09 Thread Dan
I'm having a little problem assigning a value to an array which has a key. It's simple, I just don't know what I'm doing wrong. foreach($Checkout as $value) { $products[] = $value['productName'] - $value['actualValue']; } HELP!

Re: [PHP] ftp_ssl_connect

2007-07-09 Thread Chris
Daniel Novotny wrote: Hello, I am running PHP 5.2.0 on a RHEL4 server with FTP and OpenSSL enabled: ftp FTP support = enabled openssl OpenSSL support = enabled OpenSSL Version = OpenSSL 0.9.7a Feb 19 2003 I am aware of the issue of ftp_ssl_connect() silently failing to ftp_connect()

Re: [PHP] Re: Simple PHP setting arrays with keys question

2007-07-09 Thread brian
Dan wrote: Oh yeah, the problem isn't that I'm using - instead of =. Well that was a problem but I fixed that and it's still not working. - Dan Dan [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] I'm having a little problem assigning a value to an array which has a key. It's

[PHP] system() call in PHP5 on win2003

2007-07-09 Thread Xiaogang
We used to use php 4 on our web server on win2000, and use the system() to call some DOS programs. That how we call it: $cmd = c:\\Inetpub\\wwwroot\\test.exe; $last_line = system($cmd, $retval); print (br\nretval =\. $retval. \br\n); It was working perfectly for years.