php-general Digest 9 Jul 2007 19:59:39 -0000 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]
----------------------------------------------------------------------
--- Begin Message ---
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 ---
--- Begin Message ---
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 ---
--- Begin Message ---
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 ---
--- Begin Message ---
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 ---
--- Begin Message ---
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 ---
--- Begin Message ---
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.}
--- End Message ---
--- Begin Message ---
OK. I did test like this:
$a = 'Z';
$b = $a;
$b++;
print 'b = a<br />';
print 'b++<br />';
if ($a > $b) print 'a > b<br />';
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
--- End Message ---
--- Begin Message ---
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?
--- End Message ---
--- Begin Message ---
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?
--- End Message ---
--- Begin Message ---
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?
>
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
> > >
> > >
> >
>
>
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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!"
};
?>
--- End Message ---
--- Begin Message ---
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.}
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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?
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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.}
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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 |
-----------------------------------------------------
pgpCcIMwWLjsW.pgp
Description: PGP signature
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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.
--- End Message ---