php-general Digest 6 Oct 2009 07:44:11 - Issue 6376
Topics (messages 298618 through 298630):
Re: a trivial little function (PostToHost)
298618 by: Kirk.Johnson.zootweb.com
Re: Self-Process php forms or not?
298619 by: Manuel Lemos
How do YOU set default function/method
IMO, array_merge() is easy to use, however it suppose to use more cpu than
other options. If you are a performance freak, i suggest you to not choose
array_merge() solution. (also you execute date() and md5() functions even if
you wont need to use them)
In the other way, I think first option
paragasu wrote:
why bother, i use available good library
http://swiftmailer.org/
Ok, bad example. I already use SwiftMailer. My problem though has nothing to do with sending an
email. I should have known someone would take it too literally.
Think a little more general. This is not a
- Original Message
From: Andrew Mason slackma...@gmail.com
To: Nathan Nobbe quickshif...@gmail.com
Cc: Matthew Croud m...@obviousdigital.com; PHP General list
php-general@lists.php.net
Sent: Mon, October 5, 2009 8:56:12 PM
Subject: Re: [PHP] Spry, XML, PHP and XSLT Hell
On Tue,
Hey everybody,
I've got a strange problem. Using PHP5.3 on my MacBook.
There is a script, which handles input from user, in this case a date
and time.
So I get for example 10:30 and 06.10.2009. Standard german time
format. Now I try to get the correct timestamp:
$time =
Hi,
That's because %m is month, what you need is %M for minute (note uppercase).
Check out http://php.net/strftime
HTH
J
-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: 06 October 2009 08:53
To: php-general@lists.php.net
Subject: [PHP] Time Problem:
You also write the answer
var_dump(strftime(%d.%m.%Y %H:%m,$time));
there are 2 %m you see? %m is month :)
for minute use %i
-Original Message-
From: Matthias Laug [mailto:matthias.l...@gmail.com]
Sent: Tuesday, October 06, 2009 10:53 AM
To: php-general@lists.php.net
Subject: [PHP]
argh, why do I always stick to the stupid questions :( sorry
Am 06.10.2009 um 10:03 schrieb Mert Oztekin:
You also write the answer
var_dump(strftime(%d.%m.%Y %H:%m,$time));
there are 2 %m you see? %m is month :)
for minute use %i
-Original Message-
From: Matthias Laug
Jason,
%M is also month:
Month --- ---
F A full textual representation of a month, such as January or March January
through December
m Numeric representation of a month, with leading zeros 01 through 12
M A short textual representation of a month, three letters Jan through Dec
n Numeric
Matthias Laug schrieb:
var_dump(strftime(%d.%m.%Y %H:%m,$time));
---^
The minutes are always 10, no matter what time I get.
%m = month
%M = minute
Regards,
Carsten
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
My mistake,
I thought it was date() now strftime()
Sorry
(why do php developers create two different standarts for such similiar
functions???☺ )
_
From: Mert Oztekin
Sent: Tuesday, October 06, 2009 11:07 AM
To: 'Jason'; 'Matthias Laug';
but is implicitly converted into strings when it is entered.
use floatVal($str1) === floatVal($str2) then ... I honestly cannot spot any
problem in what you wanna do, I can just spot an error in the root of the
process: threat strings as numbers, comparing potatoes and tomatoes ...
there
Hi Mert,
But we're not talking about date() here, we're talking strftime().
According to the manual %i doesn't do anything in strftime(). Closest match
is %I which is 12-hour format for hours.
HTH
J
-Original Message-
From: Mert Oztekin [mailto:mozte...@anadolusigorta.com.tr]
Sent: 06
Okey Doke,
I'll try and be brief,
Well, my client agreed to a small online store that would hold the
same stock items where only the quantities would differ, we agreed
that, due to infrequent changes, I would make pages for any new items,
and she would control stock etc using an
Jim Lucas wrote:
Here is a problem that I have had for years now. I have been trying to come up
with the perfect solution for this problem. But, I have come down to two
different methods for solving it.
Here is the problem...
?php
function sendEmail(
$to,
$from,
$subject,
Hi All,
I am new to LDAP.
I want to create user on AD(Active Directory)
I have written script to do same, but I am getting Operations error
even I am successfully connected to AD and bounded with correct username,
password.
Also where will I get all attributes with its meanign... which attributes
Why don't you use linux solutions like RedHat Directory Server or
Mandriva Directory Server instead? (LDAP based too)
These solutions are scalable, free fully documented on the web, not
like this shitty MS AD (but is there a non-shitty MS product :p)
This is also much more easier to debugg...
From: Joost [mailto:joost.t.h...@planet.nl]
Daevid Vincent wrote:
From: Ben Dunlap [mailto:bdun...@agentintellect.com]
$a = $a++;
I just think this is an ambiguous line of code that wasn't thought
through. The presence of the postfix operator makes the result
undefined, no matter what
It will be an accident
if you get the results you are expecting.
I agree that the operation is illogical, I must disagree about accidents.
In PHP that operation will mean assign to the new $a variable the value
returned from the other $a variable before the increment.
There is no mystery
The existing Infrastructure is ready. and now at this point of time this is
difficult to switch to the Linux based. I love linux but helpless now ...
There is not so much information available on php.net
On Tue, Oct 6, 2009 at 6:15 PM, Yves Premel-Cabic xavier.pre...@eds.muwrote:
Why don't you
On Tue, Oct 06, 2009 at 08:51:17AM -0400, Bob McConnell wrote:
From: Joost [mailto:joost.t.h...@planet.nl]
Daevid Vincent wrote:
From: Ben Dunlap [mailto:bdun...@agentintellect.com]
$a = $a++;
I just think this is an ambiguous line of code that wasn't thought
through. The
On Tue, Oct 6, 2009 at 10:28 AM, Paul M Foster pa...@quillandmouse.comwrote:
On Tue, Oct 06, 2009 at 08:51:17AM -0400, Bob McConnell wrote:
From: Joost [mailto:joost.t.h...@planet.nl]
Daevid Vincent wrote:
From: Ben Dunlap [mailto:bdun...@agentintellect.com]
$a = $a++;
I
Does these behaves exactly?
for($i=0; $i10; ++$i)
for($i=0; $i10; $i++)
different benchmarks showed ++$i is usually faster than $i++
In that loop case, yes, what's happen internally is exactly the same, $i will
be from 0 to 9, in the other case obviously is not the same.
but pre increment
On 10/6/09 4:16 AM, Mert Oztekin mozte...@anadolusigorta.com.tr wrote:
My mistake,
I thought it was date() now strftime()
Sorry
(why do php developers create two different standarts for such similiar
functions???☺ )
it's traditional to do so. it reminds me of the bit about subtly
Hi,
Is there a way to store HTML in an XML file,
Access that node using XLST, and have it display as rendered html ?
So far my attempts either return the text equivalent of the html, with
nothing rendered.
Cheers,
Matt.
--
PHP General Mailing List (http://www.php.net/)
To
(There were some erroros in the previous email, I'm sorry)
Hi to all.
I have to realize an authentication system for a lot of users.
I heard that someone uses to store session states (?) into a database. I'd
like to know how and, expecially, WHY to do it and what's would be better
On Tue, 2009-10-06 at 15:10 +0100, Matthew Croud wrote:
Hi,
Is there a way to store HTML in an XML file,
Access that node using XLST, and have it display as rendered html ?
So far my attempts either return the text equivalent of the html, with
nothing rendered.
Cheers,
Matt.
Hi to all.
I have to realize an authentication system for a lot of users.
I heard that someone uses to store session states (?) to a database. I'd
like to know how by expecially WHY doing that and what's would be better
(considering that I can -d'oh!- touch the php.ini file).
Thanks in
Is anyone from the list heading to PHPNW this weekend?
Saturday:
Keynote: The Uncertainty Principle
Passing The Joel Test in the PHP world
SPL, not a bridge too far
Tools and Talent
The beauty and the beast – API documentation with phpDocumentor
Getting a website out of the door
Optimizing Your
On Tue, 2009-10-06 at 16:34 +0100, David Otton wrote:
Is anyone from the list heading to PHPNW this weekend?
Saturday:
Keynote: The Uncertainty Principle
Passing The Joel Test in the PHP world
SPL, not a bridge too far
Tools and Talent
The beauty and the beast – API documentation
2009/10/6 Ashley Sheridan a...@ashleysheridan.co.uk
No, it is a little far out for me. Is there something similar in Londinium?
Dozens, probably. Try the PHPLondon guys, and the PHP UK Conference for a start:
http://www.phplondon.org/wiki/Main_Page
http://www.phpconference.co.uk/
--
PHP
On Tue, Oct 6, 2009 at 11:34, Ashley Sheridan a...@ashleysheridan.co.uk wrote:
No, it is a little far out for me. Is there something similar in
Londinium?
Best way to keep informed is through php.net. Don't make our
efforts be in vain! ;-P
--
/Daniel P. Brown
daniel.br...@parasane.net
Mert Oztekin wrote:
IMO, array_merge() is easy to use, however it suppose to use more cpu than
other options. If you are a performance freak, i suggest you to not choose
array_merge() solution. (also you execute date() and md5() functions even if
you wont need to use them)
In the other
Matthew Croud wrote:
Is there a way to store HTML in an XML file,
Access that node using XLST, and have it display as rendered html ?
As XHTML ypu can integrate it in an XML, by the use of XMLNS. But it
is OT.
In the XML, you declare two XMLNS. In the XSLT, you declare three XMLNS.
--
On Tue, Oct 6, 2009 at 11:34, David Otton
phpm...@jawbone.freeserve.co.uk wrote:
Is anyone from the list heading to PHPNW this weekend?
Coincidentally, the PHPNW UG meeting is listed for tomorrow, but I
have no listing for a conference this weekend. If you're in contact
with any of those
At 3:56 PM +0200 10/6/09, Andrea Giammarchi wrote:
Does these behaves exactly?
for($i=0; $i10; ++$i)
for($i=0; $i10; $i++)
different benchmarks showed ++$i is usually faster than $i++
Faster is a relative term that is becoming more meaningless each year.
Considering that speed is
Howdy guys and girls. Been a long time since I've been in these parts.
My php is rusty these days, so please bare with me. I'm trying to
create a dynamic, multidimensional array, and keep track of which level
I'm on, opening and closing levels as needed. Lets say that I have some
data like the
At 10:07 AM +0200 10/6/09, Matthias Laug wrote:
argh, why do I always stick to the stupid questions :( sorry
Because with the important questions, you don't need answers. You
understand them.
Cheers,
tedd
--
---
http://sperling.com http://ancientstones.com http://earthstones.com
er ... tedd, whatever, usually ++i is faster in almost every language, and even
C developers could use these kind of micro optimizations.
Speed, even in this SuperCPU era, is still relevant, we would not need
benchmark to compare programming languages for each purpose.
Of course in a crappy
If you are distributing your application over multiple servers, using a
database for session tracking allows a user to continue there session
regardless of which server their request bounces too. It prevents the
need for 'sticky' network connections which time out anyways. Databases
can make
- Original Message
From: Tommy Pham tommy...@yahoo.com
To: PHP General list php-general@lists.php.net
Sent: Tue, October 6, 2009 10:41:42 AM
Subject: Re: [PHP] Spry, XML, PHP and XSLT Hell
- Original Message
From: Matthew Croud
To: PHP General list
Sent: Tue,
At 10:48 AM -0300 10/6/09, Martin Scotta wrote:
No matter how silly it can looks like (a = a++) it is still completely valid
code and it SHOULD run without problems.
Yeah, it's a valid as:
$a = $a;
and does the same thing, which is nothing.
If you want a statement that does something,
- Original Message
From: tedd tedd.sperl...@gmail.com
To: Martin Scotta martinsco...@gmail.com; Paul M Foster
pa...@quillandmouse.com
Cc: php-general@lists.php.net
Sent: Tue, October 6, 2009 11:08:14 AM
Subject: Re: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo
At 11:11 AM -0700 10/6/09, Tommy Pham wrote:
I find it interesting for a discussion to go on this long for something as
$a = $a++;
which should have never happened in the first place ;)
Regards,
Tommy
Hey, we're programmers. We waste time for a living.
Cheers,
tedd
--
---
[snip]
I find it interesting for a discussion to go on this long for something
as
$a = $a++;
[/snip]
You think that is interesting? Start a conversation about these
{}
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
On 10/6/09 10:26 AM, Il pinguino volante tuxs...@codeinside.it wrote:
I have to realize an authentication system for a lot of users.
I heard that someone uses to store session states (?) into a database. I'd
like to know how and, expecially, WHY to do it and what's would be better
On Oct 5, 2009, at 7:42 PM, Manuel Lemos wrote:
Hello,
on 10/05/2009 03:02 PM Philip Thompson said the following:
I try to avoid the use of hidden form elements as much as possible,
especially for tracking whether a user has submitted a form or
not...
I use name=submit for the submit
Hello all,
I'm trying to display a div, only when some php value is set.
Since this will be near html, I'd like to keep it on one line. So, I'd love
to use shortcuts and a ternary operator for the effect.
I'm having something like this right now, but the div still appears even if
the error is
On Tue, 2009-10-06 at 13:34 -0500, Jay Blanchard wrote:
[snip]
I find it interesting for a discussion to go on this long for something
as
$a = $a++;
[/snip]
You think that is interesting? Start a conversation about these
{}
Now they actually make sense! I've used those as
On Tue, Oct 6, 2009 at 2:34 PM, Jay Blanchard jblanch...@pocket.com wrote:
[snip]
I find it interesting for a discussion to go on this long for something
as
$a = $a++;
[/snip]
You think that is interesting? Start a conversation about these
{}
--
PHP General Mailing List
On Tue, Oct 6, 2009 at 14:46, Israel Ekpo israele...@gmail.com wrote:
Speaking of starting a conversation, what do you think about the goto
construct introduced just recently?
Better yet: what do you all think of folks hijacking threads?
--
/Daniel P. Brown
daniel.br...@parasane.net ||
?= (isset($erros['anexo']) ? 'div
class=mensagemErro'.$erros['anexo'].'/div' :''); ?
MEM tal...@gmail.com escreveu na mensagem
news:002401ca46b4$ed6ad6a0$c84083...@com...
Hello all,
I'm trying to display a div, only when some php value is set.
Since this will be near html, I'd like to keep it
On Tue, Oct 6, 2009 at 14:56, Dan Papakonstantino d...@manusonic.com wrote:
Hello Dan,
Sorry for the misunderstanding however, we are web developers as well as
hardware and software developers. You may have overlooked our web based
timesheet application called SonicWeb. Please review the
Thanks. I will give up on ?= then. And use echo instead.
I have declared the erros variable like this:
$erros=array();
Instead of isset I’ve also tried with empty();
If I have something like this, it works:
div class=mensagemErro?php echo (isset($erros['anexo'])) ? $erros['anexo']
: '';
On Tue, 2009-10-06 at 19:43 +0100, MEM wrote:
Hello all,
I'm trying to display a div, only when some php value is set.
Since this will be near html, I'd like to keep it on one line. So, I'd love
to use shortcuts and a ternary operator for the effect.
I'm having something like this right
Sorry all,
It's ok. The sintax:
?php echo (isset($erros['anexo']) ? 'div
class=mensagemErro'.$erros['anexo'].'/div' :''); ?
Was right all the time.
Anyway, I've learn something new: having a var with '' is not the same thing
as not been unset. So we must pay attention on what cases we use
On Oct 6, 2009, at 2:26 PM, MEM wrote:
Sorry all,
It's ok. The sintax:
?php echo (isset($erros['anexo']) ? 'div
class=mensagemErro'.$erros['anexo'].'/div' :''); ?
Was right all the time.
Anyway, I've learn something new: having a var with '' is not the
same thing
as not been unset. So we
just as ashley said it.
On 10/6/09 3:26 PM, MEM tal...@gmail.com wrote:
Sorry all,
It's ok. The sintax:
?php echo (isset($erros['anexo']) ? 'div
class=mensagemErro'.$erros['anexo'].'/div' :''); ?
Was right all the time.
Anyway, I've learn something new: having a var with '' is not
Absolutely. ;) I was reporting to ashley teachings. :-)
Philip, thanks for the tip.
:-)
Thank you all,
Márcio
-Original Message-
From: Tom Worster [mailto:f...@thefsb.org]
Sent: terça-feira, 6 de Outubro de 2009 21:10
To: MEM; php-general@lists.php.net
Subject: Re: [PHP] Re:
Sam Stelfox wrote on 2009-10-06 18:09:
If you are distributing your application over multiple servers, using a
database for session tracking allows a user to continue there session
regardless of which server their request bounces too. It prevents the
need for 'sticky' network connections which
Furthermore, the amount
of time micro-optimization takes up (going through old code, I mean)
could be better spent doing something that actually does increase your
performance, like implementing a search engine or memcached. Going
forward, if you're aware that ++i and i++ are the same for
ah ah ah that's for sure, I've never said that is correct, I said that is
illogical ;-)
Subject: RE: [PHP] Whacky increment/assignment logic with $foo++ vs ++$foo
Date: Tue, 6 Oct 2009 12:46:36 -0500
From: jblanch...@pocket.com
To: an_...@hotmail.com; tedd.sperl...@gmail.com;
Eddie:
And thanks for supporting my point.
so you think as well that 3 characters, written like this i++, in a careless
way, or like this ++i, make the difference about time spent to develop ...
interesting
Regards
Speaking of starting a conversation, what do you think about the goto
construct introduced just recently?
if used properly, could avoid recursion, and speed up operations ... there is
nothing wrong with goto, everything we write on lowest level is a jump in the
memory (as goto is a jump in
if used properly, could avoid recursion, and speed up operations ... there is
nothing wrong with goto, everything we write on lowest level is a jump in the
memory (as goto is a jump in the code flow)
++goto ... and not goto++
I forgot, I have always used goto in Batch script, which
On Tue, 6 Oct 2009 14:08:14 -0400, tedd.sperl...@gmail.com (tedd) wrote:
At 10:48 AM -0300 10/6/09, Martin Scotta wrote:
No matter how silly it can looks like (a = a++) it is still completely valid
code and it SHOULD run without problems.
Yeah, it's a valid as:
$a = $a;
and does the same
At 1:09 AM +0200 10/7/09, Andrea Giammarchi wrote:
Eddie:
And thanks for supporting my point.
so you think as well that 3 characters, written like this i++, in a
careless way, or like this ++i, make the difference about time spent
to develop ... interesting
No, just the opposite. It
At 10:20 AM +1100 10/7/09, clanc...@cybec.com.au wrote:
On Tue, 6 Oct 2009 14:08:14 -0400, tedd.sperl...@gmail.com (tedd) wrote:
At 10:48 AM -0300 10/6/09, Martin Scotta wrote:
No matter how silly it can looks like (a = a++) it is still completely valid
code and it SHOULD run without
-Original Message-
From: Paul M Foster [mailto:pa...@quillandmouse.com]
Sent: Tuesday, October 06, 2009 6:28 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Whacky increment/assignment logic with
$foo++ vs ++$foo
On Tue, Oct 06, 2009 at 08:51:17AM -0400, Bob McConnell
HEY! Don't try to hijack my astonishingly long-running thread! Start your
own Jay. ;-}
-Original Message-
From: Jay Blanchard [mailto:jblanch...@pocket.com]
Sent: Tuesday, October 06, 2009 11:34 AM
To: Tommy Pham; php-general@lists.php.net
Subject: RE: [PHP] Whacky
Andrea Giammarchi wrote:
if used properly, could avoid recursion, and speed up operations ... there is
nothing wrong with goto, everything we write on lowest level is a jump in the
memory (as goto is a jump in the code flow)
++goto ... and not goto++
I forgot, I have always used goto in
71 matches
Mail list logo