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 by: clive
258490 by: Xell Zhang

About Incorporating MySQL and XML/XSLT/PHP
258488 by: Kelvin Park
258497 by: Nathan Nobbe
258506 by: Tony Marston
258507 by: Nathan Nobbe
258509 by: Nathan Nobbe

Re: what trick is this? How to do it?
258489 by: clive

Another simple question (Probably)
258491 by: Jason Pruim
258494 by: clive
258496 by: Shafiq Rehman
258498 by: Jason Pruim
258500 by: Jim Lucas
258501 by: Daniel Brown
258503 by: Tijnema
258504 by: Daniel Brown
258505 by: Tijnema

Re: Where does PHP look for php.ini??
258492 by: clive
258502 by: Tijnema
258512 by: Mario Guenterberg

Re: triming utf8 (?) a string
258493 by: Rick Pasotto
258499 by: Jim Lucas
258508 by: Rick Pasotto
258511 by: Jim Lucas

default values in function call behaves differently in PHP5.2.4 and PHP5.0.4
258495 by: dor kam

ftp_ssl_connect
258510 by: Daniel Novotny

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--
---BeginMessage---

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 result.

This is because when $i is 'Z' and $i++ is run $i become 'AA'

And:
'AA'  'Z'

So it loops until $i becomse 'ZA'.


Xell Zhang skrev:

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?




--
/Thunis

This must be Thursday, said Arthur musing to himself, sinking low over 
his beer, I never could get the hang of Thursdays.

  --The Hitchikers Guide to the Galaxy
---End Message---
---BeginMessage---

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 'Z', as if $i = 'Z', then $i  'Z' would 
return false, so would leave the loop there before echoing it out.


PHP seems to increment the alphabet by A, B, C Y, Z, AA, AB, AC
So you could use:
for ($i = 'A'; $i != 'AA'; $i++) {
echo $i . ' ';
}

Using $i  'AA' doesn't seem to work either, which I find a bit odd.

Hope that helps,
Darren
---End Message---
---BeginMessage---

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.
Who can tell me why the result is not A-Z?


--
Zhang Xiao

Junior engineer, Web development

Ethos Tech.
http://www.ethos.com.cn
---End Message---
---BeginMessage---

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 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

Ethos Tech.
http://www.ethos.com.cn




--
/Thunis

Why do you need to think? Can't we just sit and go budumbudumbudum with 
our lips for a bit?

  --The Hitchikers Guide to the Galaxy
---End Message---
---BeginMessage---

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 $letter) {
  echo $letter . br/\n;
}

--
Postgresql  php tutorials
http://www.designmagick.com/
---End Message---
---BeginMessage---

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) . ' ';
}


[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

Ethos Tech.
http://www.ethos.com.cn


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 result.

This is because when $i is 'Z' and $i++ is run $i become 'AA'

And:
'AA'  'Z'

So it loops until $i becomse 'ZA'.


Xell Zhang skrev:

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?




--
/Thunis

This must be Thursday, said Arthur musing to himself, sinking low over 
his beer, I never could get the hang of Thursdays.

  --The Hitchikers Guide to the Galaxy

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 'Z', as if $i = 'Z', then $i  'Z' would 
return false, so would leave the loop there before echoing it out.


PHP seems to increment the alphabet by A, B, C Y, Z, AA, AB, AC
So you could use:
for ($i = 'A'; $i != 'AA'; $i++) {
echo $i . ' ';
}

Using $i  'AA' doesn't seem to work either, which I find a bit odd.

Hope that helps,
Darren

--
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 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.
Who can tell me why the result is not A-Z?


--
Zhang Xiao

Junior engineer, Web development

Ethos Tech.
http://www.ethos.com.cn


--
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 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 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

Ethos Tech.
http://www.ethos.com.cn




--
/Thunis

Why do you need to think? Can't we just sit and go budumbudumbudum with 
our lips for a bit?

  --The Hitchikers Guide to the Galaxy

--
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 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 $letter) {
  echo $letter . br/\n;
}

--
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] 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 were excited and some may well have enjoyed
the experience.}

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 do be displayed through XSLT template.
Do you know a good reference (website, book, article) for the most correct
way to display MySQL data with XML/XSLT/PHP?


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 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 $letter) {
   echo $letter . br/\n;
}

--
Postgresql  php tutorials
http://www.designmagick.com/





--
Zhang Xiao

Junior engineer, Web development

Ethos Tech.
http://www.ethos.com.cn


[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 
['task_desc']}'Instructions/a/td

td bgcolor={$dowColor}DayOfWeekWord, {$dowword} /td
	td bgcolor={$rowColor}DateToReschedule, input type='text'  
name='tasks[{$row['id']}][txtReschedule]' value=''/td

td bgcolor={$rowColor}DateRescheduled, {$Date}/td
	td bgcolor={$rowColor}a href='update.php?taskid={$row['id']} 
taskdate={$taskdate}'Click here!/a/td

td bgcolor={$rowColor}CheckboxForWhenDone,
		input  type='checkbox' name='tasks[{$row['id']}][chkDone]'  
value='{$row['id']}'/td

/tr

HTML;

Why am I getting a time stamp of:

1165640400
Sat, Dec-09-06?

I have been fighting with trying to figure this out and finally  
decided to show my ignorance of the language and ask for help :)  
Besides, the boss wants this done :)


Jason
?PHP

if($brain ==Monday){
echo Let me go home!
};

?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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
|   `-- php.ini
`-- cli
`-- php.ini

--
Regards,

Clive.

Real Time Travel Connections


{No electrons were harmed in the creation, transmission or reading of 
this email. However, many were excited and some may well have enjoyed 
the experience.}


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 you need to split up your posted variable

clive




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['task_desc']}'Instructions/a/td

td bgcolor={$dowColor}DayOfWeekWord, {$dowword} /td
td bgcolor={$rowColor}DateToReschedule, input type='text' 
name='tasks[{$row['id']}][txtReschedule]' value=''/td

td bgcolor={$rowColor}DateRescheduled, {$Date}/td
td bgcolor={$rowColor}a 
href='update.php?taskid={$row['id']}taskdate={$taskdate}'Click 
here!/a/td

td bgcolor={$rowColor}CheckboxForWhenDone,
input  type='checkbox' name='tasks[{$row['id']}][chkDone]' 
value='{$row['id']}'/td

/tr

HTML;

Why am I getting a time stamp of:

1165640400
Sat, Dec-09-06?

I have been fighting with trying to figure this out and finally decided 
to show my ignorance of the language and ask for help :) Besides, the 
boss wants this done :)


Jason
?PHP

if($brain ==Monday){
echo Let me go home!
};

?




--
Regards,

Clive.

Real Time Travel Connections


{No electrons were harmed in the creation, transmission or reading of 
this email. However, many were excited and some may well have enjoyed 
the experience.}


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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
 trim($x,utf8_decode('\ufffd')).
 
 trim() is meant to remove chars from the beginning and ending of a string.
 
 http://us2.php.net/str_replace is meant to remove a set of chars from a 
 string. Anywhere within the string.

But it *is* a single char that I'm wanting to remove (multiple times).
Perhaps you are confusing a char with a byte?

Anyway, the problem is solved from the other end. So long as the
original string has a length that is a multiple of 8 the encoded/decoded
result has no extra chars. Padding the initial string with spaces makes
it easy to then trim() the output.

-- 
The care of every man's soul belongs to himself.  But what if he
 neglect the care of it?  Well what if he neglect the care of his health
 or his estate, which would more nearly relate to the state. Will the
 magistrate make a law that he not be poor or sick?  Laws provide
 against injury from others; but not from ourselves.  God himself will
 not save men against their wills. -- Thomas Jefferson 1776-10
Rick Pasotto[EMAIL PROTECTED]http://www.niof.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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:
$par=0;
f1($par);

in 5.0.4 in is INITIALIZED to zero, BEFORE function call!
and the return value is according to f1.

Am I right?
Is it a bug?
Is it documented?

Thanks
Dor

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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:

$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
['task_desc']}'Instructions/a/td
td bgcolor={$dowColor}DayOfWeekWord, {$dowword} /td
td bgcolor={$rowColor}DateToReschedule, input type='text'
name='tasks[{$row['id']}][txtReschedule]' value=''/td
td bgcolor={$rowColor}DateRescheduled, {$Date}/td
td bgcolor={$rowColor}a href='update.php?taskid={$row['id']}
taskdate={$taskdate}'Click here!/a/td
td bgcolor={$rowColor}CheckboxForWhenDone,
input  type='checkbox'
name='tasks[{$row['id']}][chkDone]'
value='{$row['id']}'/td
/tr

HTML;

Why am I getting a time stamp of:

1165640400
Sat, Dec-09-06?

I have been fighting with trying to figure this out and finally
decided to show my ignorance of the language and ask for help :)
Besides, the boss wants this done :)

Jason
?PHP

if($brain ==Monday){
echo Let me go home!
};

?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




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 [which is
built in part from the database query results].  This is kind of where i
found some stuff that got me started; hopefully it will help you as well.
http://www.sitepoint.com/article/transform-php-xslt

-nathan

On 7/9/07, Kelvin Park [EMAIL PROTECTED] wrote:


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 do be displayed through XSLT template.
Do you know a good reference (website, book, article) for the most correct
way to display MySQL data with XML/XSLT/PHP?



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, $minute,$second, $month , $day ,$year);

so maybe you need to split up your posted variable

clive


So do an
explode($_POST['txtReschdeule'], /); // type of thing?




--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 trim($x,'\ufffd') and
trim($x,utf8_decode('\ufffd')).


trim() is meant to remove chars from the beginning and ending of a string.

http://us2.php.net/str_replace is meant to remove a set of chars from a 
string. Anywhere within the string.


But it *is* a single char that I'm wanting to remove (multiple times).
Perhaps you are confusing a char with a byte?


Nope, not confused, but I ASSUMED that maybe the chars were not at the beginning or ending of the 
string, but somewhere in the middle.  ( you didn't say where the chars were )


And since you were using trim(), that you were using the wrong function.  Which only works on the 
beginning and ending of a string.




Anyway, the problem is solved from the other end. So long as the
original string has a length that is a multiple of 8 the encoded/decoded
result has no extra chars. Padding the initial string with spaces makes
it easy to then trim() the output.




--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 it and see what you get.



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['task_desc']}'Instructions/a/td

td bgcolor={$dowColor}DayOfWeekWord, {$dowword} /td
td bgcolor={$rowColor}DateToReschedule, input type='text' 
name='tasks[{$row['id']}][txtReschedule]' value=''/td

td bgcolor={$rowColor}DateRescheduled, {$Date}/td
td bgcolor={$rowColor}a 
href='update.php?taskid={$row['id']}taskdate={$taskdate}'Click 
here!/a/td

td bgcolor={$rowColor}CheckboxForWhenDone,
input  type='checkbox' name='tasks[{$row['id']}][chkDone]' 
value='{$row['id']}'/td

/tr

HTML;

Why am I getting a time stamp of:

1165640400
Sat, Dec-09-06?

I have been fighting with trying to figure this out and finally decided 
to show my ignorance of the language and ask for help :) Besides, the 
boss wants this done :)


Jason
?PHP

if($brain ==Monday){
echo Let me go home!
};

?

--PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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:

 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
 ['task_desc']}'Instructions/a/td
 td bgcolor={$dowColor}DayOfWeekWord, {$dowword} /td
 td bgcolor={$rowColor}DateToReschedule, input type='text'
 name='tasks[{$row['id']}][txtReschedule]' value=''/td
 td bgcolor={$rowColor}DateRescheduled, {$Date}/td
 td bgcolor={$rowColor}a href='update.php?taskid={$row['id']}
 taskdate={$taskdate}'Click here!/a/td
 td bgcolor={$rowColor}CheckboxForWhenDone,
 input  type='checkbox'
 name='tasks[{$row['id']}][chkDone]'
 value='{$row['id']}'/td
 /tr

 HTML;

 Why am I getting a time stamp of:

 1165640400
 Sat, Dec-09-06?

 I have been fighting with trying to figure this out and finally
 decided to show my ignorance of the language and ask for help :)
 Besides, the boss wants this done :)

 Jason
 ?PHP

 if($brain ==Monday){
 echo Let me go home!
 };

 ?

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php





   That's correct, but not all are explicitly required.  The function
should actually be written as follows:

   int mktime( [int hour [,int minute [,int second [,int month [,int
day [,int year [,int dst]]] )

   And by default, if date() is given a second parameter, but that
parameter is null or empty, date() will return `9 December, 2006`
(formatted accordingly).  I'm not certain of the significance of this,
nor am I sure that all versions of PHP will return this same value.
I'd have expected Unix epoch time, so 9 December, 2006, could be an
easter egg date.  Worth reading up on, but nothing I can find so far
explains it.  ANYONE ELSE KNOW?  I'd love to find out!

   Another thing to note is that, if date() is passed information it
doesn't understand in the second parameter, it will return `31 August,
2000` at midnight.  Once again, not sure why, but I'd love to hear the
reason if anyone else knows.

   Some other things to note:

   1.) While it's a Good Idea[tm] to follow the input structure for
mktime() as I listed above, it's actually not required for some dates
and formats.  However, I wasn't able to narrow-down a good algorithm
to prove it, so you should split() or explode() your date when it's
received.

   2.) HOWEVER when passing this information to date(), you have
to keep in mind that leading zeros may be interpreted as octal values
by date() itself.  If you keep getting a SNAFU result, try using a
different date() flag to represent the month or day.

   3.) Sometimes I don't make much sense considering that it's
Monday morning, this may be one of those times.

--
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] 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 doesn't read the php.ini file..
  when I use the CLI with -c /etc it works fine :)

Hi...

you can use the configure parameter --with-config-file-path.

Greetings
Mario
--


I've build my own Linux, so good to know how to change it :)

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] 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 423 9385

 On 7/9/07, Jason Pruim [EMAIL PROTECTED] wrote:
 
  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
  ['task_desc']}'Instructions/a/td
  td bgcolor={$dowColor}DayOfWeekWord, {$dowword} /td
  td bgcolor={$rowColor}DateToReschedule, input type='text'
  name='tasks[{$row['id']}][txtReschedule]' value=''/td
  td bgcolor={$rowColor}DateRescheduled, {$Date}/td
  td bgcolor={$rowColor}a href='update.php?taskid={$row['id']}
  taskdate={$taskdate}'Click here!/a/td
  td bgcolor={$rowColor}CheckboxForWhenDone,
  input  type='checkbox'
  name='tasks[{$row['id']}][chkDone]'
  value='{$row['id']}'/td
  /tr
 
  HTML;
 
  Why am I getting a time stamp of:
 
  1165640400
  Sat, Dec-09-06?
 
  I have been fighting with trying to figure this out and finally
  decided to show my ignorance of the language and ask for help :)
  Besides, the boss wants this done :)
 
  Jason
  ?PHP
 
  if($brain ==Monday){
  echo Let me go home!
  };
 
  ?
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


   That's correct, but not all are explicitly required.  The function
should actually be written as follows:

   int mktime( [int hour [,int minute [,int second [,int month [,int
day [,int year [,int dst]]] )

   And by default, if date() is given a second parameter, but that
parameter is null or empty, date() will return `9 December, 2006`
(formatted accordingly).  I'm not certain of the significance of this,
nor am I sure that all versions of PHP will return this same value.
I'd have expected Unix epoch time, so 9 December, 2006, could be an
easter egg date.  Worth reading up on, but nothing I can find so far
explains it.  ANYONE ELSE KNOW?  I'd love to find out!



The only thing I could find about 9 dec 2006:
9 December, 2006 - Shuttle Discovery launches on the STS-116 mission
at 8:45 P.M., the first night launch in 4 years (STS-113 being the
last).

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] 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)
  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:
  
   $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
   ['task_desc']}'Instructions/a/td
   td bgcolor={$dowColor}DayOfWeekWord, {$dowword} /td
   td bgcolor={$rowColor}DateToReschedule, input type='text'
   name='tasks[{$row['id']}][txtReschedule]' value=''/td
   td bgcolor={$rowColor}DateRescheduled, {$Date}/td
   td bgcolor={$rowColor}a href='update.php?taskid={$row['id']}
   taskdate={$taskdate}'Click here!/a/td
   td bgcolor={$rowColor}CheckboxForWhenDone,
   input  type='checkbox'
   name='tasks[{$row['id']}][chkDone]'
   value='{$row['id']}'/td
   /tr
  
   HTML;
  
   Why am I getting a time stamp of:
  
   1165640400
   Sat, Dec-09-06?
  
   I have been fighting with trying to figure this out and finally
   decided to show my ignorance of the language and ask for help :)
   Besides, the boss wants this done :)
  
   Jason
   ?PHP
  
   if($brain ==Monday){
   echo Let me go home!
   };
  
   ?
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 

That's correct, but not all are explicitly required.  The function
 should actually be written as follows:

int mktime( [int hour [,int minute [,int second [,int month [,int
 day [,int year [,int dst]]] )

And by default, if date() is given a second parameter, but that
 parameter is null or empty, date() will return `9 December, 2006`
 (formatted accordingly).  I'm not certain of the significance of this,
 nor am I sure that all versions of PHP will return this same value.
 I'd have expected Unix epoch time, so 9 December, 2006, could be an
 easter egg date.  Worth reading up on, but nothing I can find so far
 explains it.  ANYONE ELSE KNOW?  I'd love to find out!


The only thing I could find about 9 dec 2006:
9 December, 2006 - Shuttle Discovery launches on the STS-116 mission
at 8:45 P.M., the first night launch in 4 years (STS-113 being the
last).

Tijnema

--
Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info



   Yeah, I saw that on Wikipedia that and the Moscow fire that
was the biggest since 1977 or something I think it said it killed
45 women.

   Damn.

--
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] 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, 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:
   
$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
['task_desc']}'Instructions/a/td
td bgcolor={$dowColor}DayOfWeekWord, {$dowword} /td
td bgcolor={$rowColor}DateToReschedule, input type='text'
name='tasks[{$row['id']}][txtReschedule]' value=''/td
td bgcolor={$rowColor}DateRescheduled, {$Date}/td
td bgcolor={$rowColor}a 
href='update.php?taskid={$row['id']}
taskdate={$taskdate}'Click here!/a/td
td bgcolor={$rowColor}CheckboxForWhenDone,
input  type='checkbox'
name='tasks[{$row['id']}][chkDone]'
value='{$row['id']}'/td
/tr
   
HTML;
   
Why am I getting a time stamp of:
   
1165640400
Sat, Dec-09-06?
   
I have been fighting with trying to figure this out and finally
decided to show my ignorance of the language and ask for help :)
Besides, the boss wants this done :)
   
Jason
?PHP
   
if($brain ==Monday){
echo Let me go home!
};
   
?
   
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
   
   
  
 
 That's correct, but not all are explicitly required.  The function
  should actually be written as follows:
 
 int mktime( [int hour [,int minute [,int second [,int month [,int
  day [,int year [,int dst]]] )
 
 And by default, if date() is given a second parameter, but that
  parameter is null or empty, date() will return `9 December, 2006`
  (formatted accordingly).  I'm not certain of the significance of this,
  nor am I sure that all versions of PHP will return this same value.
  I'd have expected Unix epoch time, so 9 December, 2006, could be an
  easter egg date.  Worth reading up on, but nothing I can find so far
  explains it.  ANYONE ELSE KNOW?  I'd love to find out!
 

 The only thing I could find about 9 dec 2006:
 9 December, 2006 - Shuttle Discovery launches on the STS-116 mission
 at 8:45 P.M., the first night launch in 4 years (STS-113 being the
 last).

 Tijnema

 --
 Vote for PHP Color Coding in Gmail! - http://gpcc.tijnema.info


   Yeah, I saw that on Wikipedia that and the Moscow fire that
was the biggest since 1977 or something I think it said it killed
45 women.

   Damn.


Yes, the Moscow Hospital Fire [1] was also on 9 December, was it maybe
the wife of one of the developers of Unix that wife died there in the
hospital? :P

Tijnema

[1] http://en.wikipedia.org/wiki/Moscow_hospital_fire

--
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



[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 
http://www.tonymarston.net/php-mysql/sample-application.html which you can 
download with all the necessary code.

-- 
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

Kelvin Park [EMAIL PROTECTED] wrote in message 
news:[EMAIL PROTECTED]
 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 do be displayed through XSLT template.
 Do you know a good reference (website, book, article) for the most correct
 way to display MySQL data with XML/XSLT/PHP?
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 and
http://www.tonymarston.net/php-mysql/xsl.html

There is also a sample application available at
http://www.tonymarston.net/php-mysql/sample-application.html which you can
download with all the necessary code.

--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org

Kelvin Park [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 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 do be displayed through XSLT template.
 Do you know a good reference (website, book, article) for the most
correct
 way to display MySQL data with XML/XSLT/PHP?


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




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 can I
 get rid of those extra bytes? I've tried both trim($x,'\ufffd') and
 trim($x,utf8_decode('\ufffd')).
 
 trim() is meant to remove chars from the beginning and ending of a string.
 
 http://us2.php.net/str_replace is meant to remove a set of chars from a 
 string. Anywhere within the string.
 
 But it *is* a single char that I'm wanting to remove (multiple times).
 Perhaps you are confusing a char with a byte?
 
 Nope, not confused, but I ASSUMED that maybe the chars were not at the 
 beginning or ending of the string, but somewhere in the middle.  ( you 
 didn't say where the chars were )

Yes, I did. the original *plus* some '\ufffd' bytes clearly means that
they were added at the end.

 And since you were using trim(), that you were using the wrong function.  
 Which only works on the beginning and ending of a string.

I wanted to remove the characters that were added at the *end* of the
string.

-- 
Blaming 'society' makes it awfully easy for a person of weak character
 to shrug off his own responsibility for his actions. -- Stanley Schmidt
Rick Pasotto[EMAIL PROTECTED]http://www.niof.net

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 that
case even w/ the approach i currently take there would still be files on
disk. as long as said XML files have practical permissions i dont think
having them on disc is a great security risk.

-nathan

On 7/9/07, Kelvin Park [EMAIL PROTECTED] wrote:


Since XML is just a text document, wouldn't it raise security issues if
all data was transferred to XML files?

On 7/9/07, Kelvin Park  [EMAIL PROTECTED] wrote:

 absolutely!, thanks

 On 7/9/07, Nathan Nobbe [EMAIL PROTECTED]  wrote:
 
  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 and
   http://www.tonymarston.net/php-mysql/xsl.html
  
   There is also a sample application available at
   http://www.tonymarston.net/php-mysql/sample-application.html which
  you can
   download with all the necessary code.
  
   --
   Tony Marston
   http://www.tonymarston.net
   http://www.radicore.org
  
   Kelvin Park [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
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 do be displayed through XSLT
  template.
Do you know a good reference (website, book, article) for the most
   correct
way to display MySQL data with XML/XSLT/PHP?
   
  
   --
   PHP General Mailing List ( http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 





[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; however, I am curious if there is a way
to tell why the initial ftp_ssl_connect() failed in the first place. I am
currently utilizing cURL in my program as a stand-in until I can get this
figured out, so I can tell you that this is truly a FTP over SSL and NOT a
SFTP (ssh) scenario. I can verify that the initial ftp_ssl_connect() failed
because the server I am connecting to has two different username/password
for secure and non-secure FTP connections. When I try and issue a
ftp_login(), I get User secure_user cannot log in, telling me that the
function has indeed fell back to the non SSL function. I have also done TCP
dumps to back up this idea. They confirm that communication takes place on
the standard FTP port, not the 990 port. Please let me know if you need any
more additional info in order to help me get this mystery solved.


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 '\ufffd' bytes. How can I
get rid of those extra bytes? I've tried both trim($x,'\ufffd') and
trim($x,utf8_decode('\ufffd')).


trim() is meant to remove chars from the beginning and ending of a string.

http://us2.php.net/str_replace is meant to remove a set of chars from a 
string. Anywhere within the string.

But it *is* a single char that I'm wanting to remove (multiple times).
Perhaps you are confusing a char with a byte?
Nope, not confused, but I ASSUMED that maybe the chars were not at the 
beginning or ending of the string, but somewhere in the middle.  ( you 
didn't say where the chars were )


Yes, I did. the original *plus* some '\ufffd' bytes clearly means that
they were added at the end.


Well, IMHO, that does not clearly mean at the end.

*plus* does not imply, to me at least, that whatever the plus is, is appended 
to the end.



And since you were using trim(), that you were using the wrong function.  
Which only works on the beginning and ending of a string.


I wanted to remove the characters that were added at the *end* of the
string.


obviously...?





--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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 scripts
for my own builds from scratch or vanilla source.

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


pgpfL9WPzFBoe.pgp
Description: PGP signature


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 scripts for apache/php and mysql/postgresql. I use this scripts
for my own builds from scratch or vanilla source.

Greetings
Mario



It has an LFS base yes ;)

When I had the base LFS system, I continued on my own, no BLFS or
such, and a lot of unstable code fixes, which was more like making
bugs in programs to fix compile errors ;), commenting out some mem
calls or such :P

Can't remember that I've changed anything in PHP/Apache/MySQL or
PostgreSQL, but still interested in your scripts :)

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: 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 rationale to convert data from the form into XML prior to
further processing that immediately comes to mind, though im sure there may
be a suitable reason for it somewhere.  Naturally, when users submit data to
your application, the very first thing you should do w/ it is validate it.
If that works out
you can pass said data along for further processing and potentially modify
the application database.  Therefore if you plan on using PHP, which im
assuming you are
at this point, the action attribute of the form tags within xsl files will
reference PHP files.  Those PHP files will process the data as i just
described.

-nathan

On 7/9/07, Kelvin Park [EMAIL PROTECTED] wrote:


and - an

On 7/9/07, Kelvin Park [EMAIL PROTECTED] wrote:

 The contents would be basically and item name, description, and its
 image.
 Let say I'm transferring mysql database to XML and display product
 information on a website with XSLT.
 If I'm not sending user inputted information through XML back to mysql
 database,

 Wouldn't XSLT document be filled with input forms if I want to receive
 information from the customers?

 Or bottomline is it more convenient and clear coding (with XSLT, XML) to
 just directly send customer data through PHP POST in to mysql database?

 On 7/9/07, Nathan Nobbe  [EMAIL PROTECTED] wrote:
 
  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 form for instance which might submit data to your
   application via HTTP POST.
   in that case you could simply process the data in a familiar way and
   insert / update or whatever, the database as appropriate.
   aside from that if you wanted to send XML elements to the database
   you could do so in one of several ways.
  
   the XML could be stored natively of course, but i think what youre
   asking about is getting the contents of a particular tag, say, and insert
   that into a particular field in a table.  to accomplish this use
   SimpleXML or DOM to parse the XML and traverse to the node whose data you
   mean to insert (or update or whatever) into the database; store it
   in a variable and use it in a query at a later point in the code.
  
   -nathan
  
   On 7/9/07, Kelvin Park  [EMAIL PROTECTED] wrote:
   
One of his tutorials explained how to transfer MySQL data to XML,
however obviously the data is not always static, it needs to be changed
sending the data back to MySQL through XML.
   
Do you know how to send XML elements back in to MySQL database?
   
Thanks!
   
On 7/9/07, Nathan Nobbe [EMAIL PROTECTED]  wrote:

 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 that case even w/ the approach i currently take there 
would
 still be files on disk. as long as said XML files have practical 
permissions
 i dont think having them on disc is a great security risk.

 -nathan

 On 7/9/07, Kelvin Park  [EMAIL PROTECTED] wrote:
 
  Since XML is just a text document, wouldn't it raise security
  issues if all data was transferred to XML files?
 
  On 7/9/07, Kelvin Park  [EMAIL PROTECTED] wrote:
  
   absolutely!, thanks
  
   On 7/9/07, Nathan Nobbe [EMAIL PROTECTED]  wrote:
   
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 and
 http://www.tonymarston.net/php-mysql/xsl.html

 There is also a sample application available at
 http://www.tonymarston.net/php-mysql/sample-application.html
which you can
 download with all the necessary code.

 --
 Tony Marston
 http://www.tonymarston.net
 http://www.radicore.org

 Kelvin Park [EMAIL PROTECTED] wrote in
message

news:[EMAIL PROTECTED]
   
  I'm using XSLT to make a website template and XML to

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? :-)
  If you need it or want some usefull input, I have very usefull
  build scripts for apache/php and mysql/postgresql. I use this scripts
  for my own builds from scratch or vanilla source.
 
  Greetings
  Mario
 
 
  It has an LFS base yes ;)
 
  When I had the base LFS system, I continued on my own, no BLFS or
  such, and a lot of unstable code fixes, which was more like making
  bugs in programs to fix compile errors ;), commenting out some mem
  calls or such :P

  Can't remember that I've changed anything in PHP/Apache/MySQL or
  PostgreSQL, but still interested in your scripts :)
 
  Tijnema

I don't change the sources even if security bugs or issues are known.
The only 3rd party patch I ever applied for php is hardened php/suhosin.

I attach the scripts to this mail.

Greetings
Mario

-- 
 -
| havelsoft.com - Ihr Service Partner für Open Source |
| Tel:  033876-21 966 |
| Notruf: 0173-277 33 60  |
| http://www.havelsoft.com|
| |
| Inhaber: Mario Günterberg   |
| Mützlitzer Strasse 19   |
| 14715 Märkisch Luch |
 -


build-apache2.sh
Description: Bourne shell script


build-mysql5.sh
Description: Bourne shell script


build-pgsql8.sh
Description: Bourne shell script


build-php5.sh
Description: Bourne shell script


pgpXXBXUvZAVs.pgp
Description: PGP signature


[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 process the data in a familiar way and insert
/ update or whatever, the database as appropriate.
aside from that if you wanted to send XML elements to the database you could
do so in one of several ways.

the XML could be stored natively of course, but i think what youre asking
about is getting the contents of a particular tag, say, and insert
that into a particular field in a table.  to accomplish this use SimpleXML
or DOM to parse the XML and traverse to the node whose data you
mean to insert (or update or whatever) into the database; store it in a
variable and use it in a query at a later point in the code.

-nathan

On 7/9/07, Kelvin Park [EMAIL PROTECTED] wrote:


One of his tutorials explained how to transfer MySQL data to XML, however
obviously the data is not always static, it needs to be changed sending the
data back to MySQL through XML.

Do you know how to send XML elements back in to MySQL database?

Thanks!

On 7/9/07, Nathan Nobbe [EMAIL PROTECTED] wrote:

 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 that case even w/ the approach i currently take there would
 still be files on disk. as long as said XML files have practical permissions
 i dont think having them on disc is a great security risk.

 -nathan

 On 7/9/07, Kelvin Park  [EMAIL PROTECTED] wrote:
 
  Since XML is just a text document, wouldn't it raise security issues
  if all data was transferred to XML files?
 
  On 7/9/07, Kelvin Park  [EMAIL PROTECTED] wrote:
  
   absolutely!, thanks
  
   On 7/9/07, Nathan Nobbe [EMAIL PROTECTED]  wrote:
   
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 and
 http://www.tonymarston.net/php-mysql/xsl.html

 There is also a sample application available at
 http://www.tonymarston.net/php-mysql/sample-application.html which
you can
 download with all the necessary code.

 --
 Tony Marston
 http://www.tonymarston.net
 http://www.radicore.org

 Kelvin Park [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   
  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 do be displayed through XSLT
template.
  Do you know a good reference (website, book, article) for the
most
 correct
  way to display MySQL data with XML/XSLT/PHP?
 

 --
 PHP General Mailing List ( http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php


   
  
  
 




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 form for instance which might submit data to your
application via HTTP POST.
in that case you could simply process the data in a familiar way and
insert / update or whatever, the database as appropriate.
aside from that if you wanted to send XML elements to the database you
could do so in one of several ways.

the XML could be stored natively of course, but i think what youre asking
about is getting the contents of a particular tag, say, and insert
that into a particular field in a table.  to accomplish this use SimpleXML
or DOM to parse the XML and traverse to the node whose data you
mean to insert (or update or whatever) into the database; store it in a
variable and use it in a query at a later point in the code.

-nathan

On 7/9/07, Kelvin Park [EMAIL PROTECTED] wrote:

 One of his tutorials explained how to transfer MySQL data to XML,
 however obviously the data is not always static, it needs to be changed
 sending the data back to MySQL through XML.

 Do you know how to send XML elements back in to MySQL database?

 Thanks!

 On 7/9/07, Nathan Nobbe [EMAIL PROTECTED]  wrote:
 
  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 that case even w/ the approach i currently take there would
  still be files on disk. as long as said XML files have practical permissions
  i dont think having them on disc is a great security risk.
 
  -nathan
 
  On 7/9/07, Kelvin Park  [EMAIL PROTECTED] wrote:
  
   Since XML is just a text document, wouldn't it raise security issues
   if all data was transferred to XML files?
  
   On 7/9/07, Kelvin Park  [EMAIL PROTECTED] wrote:
   
absolutely!, thanks
   
On 7/9/07, Nathan Nobbe [EMAIL PROTECTED]  wrote:

 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 and
  http://www.tonymarston.net/php-mysql/xsl.html
 
  There is also a sample application available at
  http://www.tonymarston.net/php-mysql/sample-application.html which
 you can
  download with all the necessary code.
 
  --
  Tony Marston
  http://www.tonymarston.net
  http://www.radicore.org
 
  Kelvin Park [EMAIL PROTECTED] wrote in message
 
 news:[EMAIL PROTECTED]

   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 do be displayed through
 XSLT template.
   Do you know a good reference (website, book, article) for
 the most
  correct
   way to display MySQL data with XML/XSLT/PHP?
  
 
  --
  PHP General Mailing List ( http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 

   
   
  
 




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 :)
  
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 scripts
  for my own builds from scratch or vanilla source.
 
  Greetings
  Mario
 

  It has an LFS base yes ;)

  When I had the base LFS system, I continued on my own, no BLFS or
  such, and a lot of unstable code fixes, which was more like making
  bugs in programs to fix compile errors ;), commenting out some mem
  calls or such :P

  Can't remember that I've changed anything in PHP/Apache/MySQL or
  PostgreSQL, but still interested in your scripts :)

  Tijnema

I don't change the sources even if security bugs or issues are known.
The only 3rd party patch I ever applied for php is hardened php/suhosin.

I attach the scripts to this mail.

Greetings
Mario


I didn't say security fixes , I only change the source for compile errors ;)

Thanks for the scripts :)
I'll take a look at them and see if I can learn something from
them/use them in my own environment :)

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



[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 don't know what I'm doing wrong.


   foreach($Checkout as $value)
  {
  $products[] = $value['productName'] - 
$value['actualValue'];

   }

HELP! 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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 don't know what I'm doing wrong.


   foreach($Checkout as $value)
  {
  $products[] = $value['productName'] - 
$value['actualValue'];

   }

HELP! 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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! 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



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() in my version of PHP; however, I am curious if there is a way
to tell why the initial ftp_ssl_connect() failed in the first place. I am
currently utilizing cURL in my program as a stand-in until I can get this
figured out, so I can tell you that this is truly a FTP over SSL and NOT a
SFTP (ssh) scenario. I can verify that the initial ftp_ssl_connect() failed
because the server I am connecting to has two different username/password
for secure and non-secure FTP connections. When I try and issue a
ftp_login(), I get User secure_user cannot log in, telling me that the
function has indeed fell back to the non SSL function. I have also done TCP
dumps to back up this idea. They confirm that communication takes place on
the standard FTP port, not the 990 port. Please let me know if you need any
more additional info in order to help me get this mystery solved.


Is it a proper ssl certificate (ie purchased through thawte or some 
other site) or a dummy one that someone made up?


Can you manually telnet to the secure ftp port or does that fail? (ie 
check that the firewall isn't blocking the connection).


--
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: 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 simple, I just don't know what I'm doing wrong.


   foreach($Checkout as $value)
  {
  $products[] = $value['productName'] - 
$value['actualValue'];

   }



Please don't top-post.

This is a bit confusing. I'm guessing you want the $products array to 
use keys as the value of $value['productName']. If that's the case, you 
want:


$products[$value['productName']] = $value['actualValue'];

So, if $value looked like this in a foreach iteration:

$value = Array('productName' = 'foo', 'actualValue' = 'bar')

you'd have:

$products['foo'] == 'bar';

Is that what you're looking for?

brian

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[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.

However, recently we moved to a win2003 server, and install the php 
5.2.3, and now the system() no longer works as expected:


   1. It no longer work in the web, the only result returned
  to the web browser is retval =-1;

   2. It still works if tested in DOS commandline (use the
  command such as php test.php);

   3. Even change the $cmd to type test.txt or dir, the
  result is the same: works in DOS prompt window, but
  not web browser (received only retval =-1).

I have checked the permissions on all those files/folders, even tried 
giving read/execute permission to everyone, still no help.


In our configuation, the safe mode is off.

Any clue? Thanks in advance.

Xiaogang

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php