Re: [PHP] Re: PHP-5.5.2 +opcache segfaults with Piwik

2013-09-03 Thread Daniel
Just so that you know, I've posted in the forum topic as well:
http://forum.piwik.org/read.php?2,105879
Regards,
Daniel Fenn






On Tue, Sep 3, 2013 at 12:42 AM, Lester Caine  wrote:
> Jan Ehrhardt wrote:
>>>
>>> Could you try to add a function_exists check to
>>> >libs/upgradephp/upgrade.php?
>>> >
>>> >This at the function declaration of _json_encode:
>>> >if (!function_exists('_json_encode')) { function _json_encode($var, ...
>>> >
>>> >And a extra } at the end.
>>
>> This patch, together with upgrading to the latest OPcache from github
>> solved my segfaults and fatal errors.
>
>
> Jan  - could you post the solution on http://dev.piwik.org/trac/ticket/4093
> - better that you get the credit than one of us pinch it ;)
>
>
> --
> Lester Caine - G8HFL
> -
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk
> EnquirySolve - http://enquirysolve.com/
> Model Engineers Digital Workshop - http://medw.co.uk
> Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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



Re: [PHP] Re: PHP-5.5.2 +opcache segfaults with Piwik

2013-09-02 Thread Lester Caine

Jan Ehrhardt wrote:

Could you try to add a function_exists check to
>libs/upgradephp/upgrade.php?
>
>This at the function declaration of _json_encode:
>if (!function_exists('_json_encode')) { function _json_encode($var, ...
>
>And a extra } at the end.

This patch, together with upgrading to the latest OPcache from github
solved my segfaults and fatal errors.


Jan  - could you post the solution on http://dev.piwik.org/trac/ticket/4093 - 
better that you get the credit than one of us pinch it ;)


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP] Re: PHP-5.5.2 +opcache segfaults with Piwik

2013-09-01 Thread Jan Ehrhardt
Lester Caine in php.general (Sun, 01 Sep 2013 12:59:18 +0100):
>Grant wrote:
>>> >I've tried php-5.5.2 and 5.5.3 but both segfault with piwik unless the
>>> >opcache is disabled.  Someone filed a piwik bug but was told it's a
>>> >php bug:
>>> >
>>> >http://dev.piwik.org/trac/ticket/4093
>
>> Is this a known issue?
>
> (...) Not an answer, but explains perhaps  why the problem is not being
>seen by others.

It is more likely that users do not notice it. I have Piwik running with
PHP 5.3 and php_opcache.dll (Centos 5) and it segfaults:

[Sun Sep 01 17:06:53.131410 2013] [core:notice] [pid 25411] AH00052:
child pid 25451 exit signal Segmentation fault (11)
[Sun Sep 01 17:08:18.561917 2013] [core:notice] [pid 25411] AH00052:
child pid 25453 exit signal Segmentation fault (11)
[Sun Sep 01 17:08:19.569714 2013] [core:notice] [pid 25411] AH00052:
child pid 25450 exit signal Segmentation fault (11)

However, nothing special is displaying on the page. You have to grep
your Apache error_log to know that it happens. How did you notice?

Jan

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



Re: [PHP] Re: PHP-5.5.2 +opcache segfaults with Piwik

2013-09-01 Thread Lester Caine

Grant wrote:

I've tried php-5.5.2 and 5.5.3 but both segfault with piwik unless the
>opcache is disabled.  Someone filed a piwik bug but was told it's a
>php bug:
>
>http://dev.piwik.org/trac/ticket/4093



Is this a known issue?


I'm running my own port of piwik in production with eaccelerator on 5.4 but I've 
made the decision not to move any of the machines to 5.5 until all of the legacy 
5.2 machines have been brought up to 5.4. Not an answer, but explains perhaps 
why the problem is not being seen by others.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk

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



Re: [PHP] Re: PHP vs JAVA

2013-08-22 Thread David Harkness
On Thu, Aug 22, 2013 at 12:29 AM, Sebastian Krebs wrote:

> Actually I think ".." is quite error-prone, because it is hard to
> distinguish from "." or "_" on the _first_ glance, which makes the get
> quickly through the code. [1]
>

I surround all operators except member access ("." and "->") with spaces,
so that wouldn't be a problem for me. I thought there was an older language
that used "..", but all I can find now is Lua which was developed in the
early nineties.

So "." is maybe not the best choice, but also remember when it was
> introduced: That was decades ago. That time it was (probably ;)) the best
> choice and nowadays I don't think it is too bad at all, beside that _other_
> languages use it for other purposes now ;)
>

C introduced "." as the field access operator for structs in the early
seventies, C++ kept it for object access, and Java adopted it in the early
nineties. C's use of pointers required a way to access members through a
pointer, and I suppose K&R thought "->" looked like following a pointer (I
agree).

Since PHP was modeled on Perl and wouldn't implement objects or structs for
another decade, it adopted "." for string concatenation. It works fine, and
I don't have too much trouble bouncing back-and-forth. I honestly would
have preferred "." to be overloaded when the left hand side was an object.
In the rare cases that you want to convert an object to a string to be
concatenated with the RHS, you can always cast it to string, use strval(),
or call __toString() manually. But I'm not staging any protests over the
use of "->". :)


> Eclipse' code-completion and debugger never worked for me well (and most
> of the time: at all). It became slower and less responsive with every
> release. That was the reason I decided to leave it and I don't regret it :)
>

I agree about the slowness, and until this latest release I've always left
autocompletion manual (ctrl + space). They did something with Kepler to
speed it up drastically, so much so I have it turned on with every
keypress. However, it's a little too aggressive in providing choices.
Typing "null" which is a Java keyword as in PHP, it will insert
"nullValue()" which is a method from Hamcrest. :( After a couple weeks of
this, I think I'll be switching it back to manual activation. I can type
quickly enough that I only need it when I'm not sure of a method name.

NetBeans, while not as good with refactoring and plugin support, is still
zippier than Eclipse. And my short time with the JetBrains products found
them to be fast as well. Eclipse's PHP support via PDT is not nearly as
good as NetBeans, and no doubt PHPStorm beats them both.

Peace,
David


Re: [PHP] Re: PHP vs JAVA

2013-08-22 Thread Sebastian Krebs
2013/8/22 David Harkness 

> On Wed, Aug 21, 2013 at 7:56 PM, Curtis Maurand wrote:
>
>> Sebastian Krebs wrote:
>
> > Actually the problem is, that the dot "." is already in use. With
>
>  > $foo.bar() you cannot tell, if you want to call the method "bar()" on
>> the
>> > object "$foo", or if you want to concatenate the value of "$foo" to the
>> > result of the function "bar()". There is no other way around this than a
>> > different operator for method calls.
>>
>> I didn't think
>> of that.  It seems to me there could be an easier operator than ->
>> which sometimes will make me stop and look at what keys I'm trying to
>> hit.  Just a thought.  I forgot about the concatenation operator
>> which is "+" in Java/C#
>>
>
> The PHP language developers were pretty stuck. Because of automatic
> string-to-numeric-conversion, they couldn't use + for string concatenation.
> Sadly, they chose "." rather than ".." which I believe one or two other
> languages use. If they had, "." would have been available once objects
> rolled around in PHP 4/5. I suspect they chose -> since that's used in C
> and C++ to dereference a pointer.
>

Actually I think ".." is quite error-prone, because it is hard to
distinguish from "." or "_" on the _first_ glance, which makes the get
quickly through the code. [1]
So "." is maybe not the best choice, but also remember when it was
introduced: That was decades ago. That time it was (probably ;)) the best
choice and nowadays I don't think it is too bad at all, beside that _other_
languages use it for other purposes now ;)


[1] Yes, I know, that "_" is not an operator, but mixed with strings and
variables names it is there ;)


>
>
>> > Ever tried the jetbrains products? :D (No, they don't pay me)
>>
>> I have not, but it looks interesting.
>> I'll have to try it.
>
>
> Those are very good products which have had a strong following for a
> decade. The free IDE NetBeans also has quite good support for both Java and
> PHP, and the latest beta version provides a "web" project that provides
> front- and back-end debugging of PHP + JavaScript. You can be stepping
> through JS code and hit an AJAX call and then seamlessly step through the
> PHP code that handles it.
>
> I use NetBeans for PHP/HTML/JS (though I am evaluating JetBrains' PHPStorm
> now) and Eclipse for Java. You can't beat Eclipse's refactoring support in
> a free tool, though I think NetBeans is close to catching up. I would bet
> IntelliJ IDEA for Java by JetBrains is on par at least.
>

Eclipse' code-completion and debugger never worked for me well (and most of
the time: at all). It became slower and less responsive with every release.
That was the reason I decided to leave it and I don't regret it :)


>
> Peace,
> David
>
>


-- 
github.com/KingCrunch


Re: [PHP] Re: PHP vs JAVA

2013-08-21 Thread David Harkness
On Wed, Aug 21, 2013 at 7:56 PM, Curtis Maurand  wrote:

> Sebastian Krebs wrote:

> Actually the problem is, that the dot "." is already in use. With

> $foo.bar() you cannot tell, if you want to call the method "bar()" on the
> > object "$foo", or if you want to concatenate the value of "$foo" to the
> > result of the function "bar()". There is no other way around this than a
> > different operator for method calls.
>
> I didn't think
> of that.  It seems to me there could be an easier operator than ->
> which sometimes will make me stop and look at what keys I'm trying to
> hit.  Just a thought.  I forgot about the concatenation operator
> which is "+" in Java/C#
>

The PHP language developers were pretty stuck. Because of automatic
string-to-numeric-conversion, they couldn't use + for string concatenation.
Sadly, they chose "." rather than ".." which I believe one or two other
languages use. If they had, "." would have been available once objects
rolled around in PHP 4/5. I suspect they chose -> since that's used in C
and C++ to dereference a pointer.


> > Ever tried the jetbrains products? :D (No, they don't pay me)
>
> I have not, but it looks interesting.
> I'll have to try it.


Those are very good products which have had a strong following for a
decade. The free IDE NetBeans also has quite good support for both Java and
PHP, and the latest beta version provides a "web" project that provides
front- and back-end debugging of PHP + JavaScript. You can be stepping
through JS code and hit an AJAX call and then seamlessly step through the
PHP code that handles it.

I use NetBeans for PHP/HTML/JS (though I am evaluating JetBrains' PHPStorm
now) and Eclipse for Java. You can't beat Eclipse's refactoring support in
a free tool, though I think NetBeans is close to catching up. I would bet
IntelliJ IDEA for Java by JetBrains is on par at least.

Peace,
David


Re: [PHP] Re: PHP vs JAVA

2013-08-21 Thread Curtis Maurand


Sebastian Krebs wrote:
> 2013/8/21 Curtis Maurand

> 
>>
>>
>>
>> Sorry in advance for the top post.
>>
>> Use the right tool for
>> the Job. 
I've use Java, C# and PHP.
>>
>> 1.  I hate the
>> Perl-like object calls in PHP.  I'd rather use "."
notation
>> in C# and Java.  It saves a lot of wear and tear on
my left pinky
>> finger.
>>
> 
>
Actually the problem is, that the dot "." is already in use.
With
> $foo.bar() you cannot tell, if you want to call the method
"bar()" on the
> object "$foo", or if you want
to concatenate the value of "$foo" to the
> result of
the function "bar()". There is no other way around this than
a
> different operator for method calls.

I didn't think
of that.  It seems to me there could be an easier operator than ->
which sometimes will make me stop and look at what keys I'm trying to
hit.  Just a thought.  I forgot about the concatenation operator
which is "+" in Java/C#
> 
> 
>> 2. 
Java and C# are both typed languages.  Say what
>> you want,
but I have working with a string like "02" and have
>> PHP convert that to an integer.  sometimes I want that zero
in
>> front.  If I want that to be an integer in Java it's
"int
>> myInteger =
Integer.parseInt("02");"
>>
>> 3.
>> Java development environments (Eclipses, NetBeans, IBM RAD) are
pretty
>> horrible.  Visual Studio is hands down a better
envrionment, even the
>> older versions of it. I've hooked
Visual Studio into SVN in the past and
>> it works well.
>>
> 
> Ever tried the jetbrains products? :D (No,
they  don't pay me)

I have not, but it looks interesting. 
I'll have to try it.

> 
> 
>>
>> 4 PHP development environments are many and
>>
varied and all of them suck at web debugging.  I've used PHPEdit,
>> Zend, Bluefish, Eclipse and a couple others.  Bluefish works
better
>> on Linux than it does on Windows.
>>
> 
> I use PhpStorm and it works quite fine.
> 
> 
>>
>> Use the tool for the job at
>> hand.
>>
>> Just my $0.02 worth.
>>
>> cheers,
>> Curtis
>>
>> Tim Streater wrote:
>> > On 20 Aug 2013 at
23:59,
>> PHP List  wrote:
>> >
>> >>
>> While I don't have
any references to back it up - my guess would be
>> >>
that
>> >> Java may be seen as more versatile in
>> general programming terms.  A
>> >> staggering
number of
>> enterprise level web applications are built
with
>> >> Java, add
>> to that the
possibility of writing Android apps with the same
>> >>
knowledge.
>> >
>> > To me the salient point
is,
>> does java has as extensive a library or set of
>> > interfaces to
>> other packages (such as
SQLite, mysql, etc)?
>> >
>> >> I
>> would say that, in general, the other teacher is incorrect
speaking
>> >> strictly in terms of web development.  PHP
has already won that
>> crown
>> >> many times
over.  That said, when I was in University,
>> it was
difficult
>> >> to find a programming class that
taught
>> anything but Java - and that
>> >>
was
>> >> 10yrs ago
>> now.  I chalked it up
to the education bubble not being able
>> >>
>> to see what the rest of the world is actually doing.
>> >
>> >
>> Was PHP OOP-capable at
the time? Perhaps the edu-bubble was simply
>> looking
>> > down its nose at PHP. There being lots of courses
proves
>> nothing in and of
>> > itself. 20 years
ago, there were lots of PC
>> mags you could buy, which
>> > caused some folks to say "look
>> how much
better the PC is supported than
>> > other
platforms".
>> Truth was, at the time, such support was
needed given
>> > the mess
>> of 640k limits,
DOS, IRQs and the like, most of which issues have
>> >
ceased to be relevant.
>> >
>> > Anyway, why
should one
>> need a course to learn PHP, assuming you
already
>> > know other
>> languages. It's simple
enough.
>> >
>> > --
>> >
Cheers
>> --  Tim
>> >
>> > --
>> > PHP General Mailing List
>>
(http://www.php.net/)
>> > To unsubscribe, visit:
>> http://www.php.net/unsub.php
>>
> 
>

> 
> --
> github.com/KingCrunch
>


Re: [PHP] Re: PHP vs JAVA

2013-08-21 Thread Sebastian Krebs
2013/8/21 Curtis Maurand 

>
>
>
> Sorry in advance for the top post.
>
> Use the right tool for
> the Job.  I've use Java, C# and PHP.
>
> 1.  I hate the
> Perl-like object calls in PHP.  I'd rather use "." notation
> in C# and Java.  It saves a lot of wear and tear on my left pinky
> finger.
>

Actually the problem is, that the dot "." is already in use. With
$foo.bar() you cannot tell, if you want to call the method "bar()" on the
object "$foo", or if you want to concatenate the value of "$foo" to the
result of the function "bar()". There is no other way around this than a
different operator for method calls.


> 2.  Java and C# are both typed languages.  Say what
> you want, but I have working with a string like "02" and have
> PHP convert that to an integer.  sometimes I want that zero in
> front.  If I want that to be an integer in Java it's "int
> myInteger = Integer.parseInt("02");"
>
> 3.
> Java development environments (Eclipses, NetBeans, IBM RAD) are pretty
> horrible.  Visual Studio is hands down a better envrionment, even the
> older versions of it. I've hooked Visual Studio into SVN in the past and
> it works well.
>

Ever tried the jetbrains products? :D (No, they  don't pay me)


>
> 4 PHP development environments are many and
> varied and all of them suck at web debugging.  I've used PHPEdit,
> Zend, Bluefish, Eclipse and a couple others.  Bluefish works better
> on Linux than it does on Windows.
>

I use PhpStorm and it works quite fine.


>
> Use the tool for the job at
> hand.
>
> Just my $0.02 worth.
>
> cheers,
> Curtis
>
> Tim Streater wrote:
> > On 20 Aug 2013 at 23:59,
> PHP List  wrote:
> >
> >>
> While I don't have any references to back it up - my guess would be
> >> that
> >> Java may be seen as more versatile in
> general programming terms.  A
> >> staggering number of
> enterprise level web applications are built with
> >> Java, add
> to that the possibility of writing Android apps with the same
> >> knowledge.
> >
> > To me the salient point is,
> does java has as extensive a library or set of
> > interfaces to
> other packages (such as SQLite, mysql, etc)?
> >
> >> I
> would say that, in general, the other teacher is incorrect speaking
> >> strictly in terms of web development.  PHP has already won that
> crown
> >> many times over.  That said, when I was in University,
> it was difficult
> >> to find a programming class that taught
> anything but Java - and that
> >> was
> >> 10yrs ago
> now.  I chalked it up to the education bubble not being able
> >>
> to see what the rest of the world is actually doing.
> >
> >
> Was PHP OOP-capable at the time? Perhaps the edu-bubble was simply
> looking
> > down its nose at PHP. There being lots of courses proves
> nothing in and of
> > itself. 20 years ago, there were lots of PC
> mags you could buy, which
> > caused some folks to say "look
> how much better the PC is supported than
> > other platforms".
> Truth was, at the time, such support was needed given
> > the mess
> of 640k limits, DOS, IRQs and the like, most of which issues have
> > ceased to be relevant.
> >
> > Anyway, why should one
> need a course to learn PHP, assuming you already
> > know other
> languages. It's simple enough.
> >
> > --
> > Cheers
> --  Tim
> >
> > --
> > PHP General Mailing List
> (http://www.php.net/)
> > To unsubscribe, visit:
> http://www.php.net/unsub.php
>



-- 
github.com/KingCrunch


Re: [PHP] Re: PHP vs JAVA

2013-08-21 Thread Curtis Maurand



Sorry in advance for the top post.

Use the right tool for
the Job.  I've use Java, C# and PHP.

1.  I hate the
Perl-like object calls in PHP.  I'd rather use "." notation
in C# and Java.  It saves a lot of wear and tear on my left pinky
finger.
2.  Java and C# are both typed languages.  Say what
you want, but I have working with a string like "02" and have
PHP convert that to an integer.  sometimes I want that zero in
front.  If I want that to be an integer in Java it's "int
myInteger = Integer.parseInt("02");"

3. 
Java development environments (Eclipses, NetBeans, IBM RAD) are pretty
horrible.  Visual Studio is hands down a better envrionment, even the
older versions of it. I've hooked Visual Studio into SVN in the past and
it works well.

4 PHP development environments are many and
varied and all of them suck at web debugging.  I've used PHPEdit,
Zend, Bluefish, Eclipse and a couple others.  Bluefish works better
on Linux than it does on Windows.

Use the tool for the job at
hand.  

Just my $0.02 worth.

cheers,
Curtis

Tim Streater wrote:
> On 20 Aug 2013 at 23:59,
PHP List  wrote:
> 
>>
While I don't have any references to back it up - my guess would be
>> that
>> Java may be seen as more versatile in
general programming terms.  A
>> staggering number of
enterprise level web applications are built with
>> Java, add
to that the possibility of writing Android apps with the same
>> knowledge.
> 
> To me the salient point is,
does java has as extensive a library or set of
> interfaces to
other packages (such as SQLite, mysql, etc)?
> 
>> I
would say that, in general, the other teacher is incorrect speaking
>> strictly in terms of web development.  PHP has already won that
crown
>> many times over.  That said, when I was in University,
it was difficult
>> to find a programming class that taught
anything but Java - and that
>> was
>> 10yrs ago
now.  I chalked it up to the education bubble not being able
>>
to see what the rest of the world is actually doing.
> 
>
Was PHP OOP-capable at the time? Perhaps the edu-bubble was simply
looking
> down its nose at PHP. There being lots of courses proves
nothing in and of
> itself. 20 years ago, there were lots of PC
mags you could buy, which
> caused some folks to say "look
how much better the PC is supported than
> other platforms".
Truth was, at the time, such support was needed given
> the mess
of 640k limits, DOS, IRQs and the like, most of which issues have
> ceased to be relevant.
> 
> Anyway, why should one
need a course to learn PHP, assuming you already
> know other
languages. It's simple enough.
> 
> --
> Cheers 
--  Tim
> 
> --
> PHP General Mailing List
(http://www.php.net/)
> To unsubscribe, visit:
http://www.php.net/unsub.php


Re: [PHP] Re: PHP vs JAVA

2013-08-21 Thread Stuart Dallas
On 21 Aug 2013, at 15:01, "georg chambert"  wrote:

> my I shake the subject a little; Ive been doing some PHP and found it "ok" to 
> work with
> not so much fuss, but that was PHP4, what about PHP5 ?
> Dont really checked the difference but made a short-scan and found that it 
> had be
> screwed around with ?
> 
> Any think, should I change to 5 ?

Yes, even if it's only because PHP4 hasn't been supported in any way, including 
security fixes, since August 7th, 2008! This fact alone makes it pretty 
dangerous to be using it on a public site, and that's without getting into all 
of the improvements that PHP5 has introduced over the past five years!

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Re: PHP vs JAVA

2013-08-21 Thread Sebastian Krebs
2013/8/21 georg chambert 

> Hi,
>
> my I shake the subject a little; Ive been doing some PHP and found it "ok"
> to work with
> not so much fuss, but that was PHP4, what about PHP5 ?
> Dont really checked the difference but made a short-scan and found that it
> had be
> screwed around with ?
>
> Any think, should I change to 5 ?
>

ehm ... serious?
http://php.net/eol.php


>
> BR georg
>
> - Original Message - From: "Tim Streater" 
> To: "PHP List" ; 
> Sent: Wednesday, August 21, 2013 1:59 PM
> Subject: [PHP] Re: PHP vs JAVA
>
>
>
> On 20 Aug 2013 at 23:59, PHP List  wrote:
>
>  While I don't have any references to back it up - my guess would be that
>> Java may be seen as more versatile in general programming terms.  A
>> staggering number of enterprise level web applications are built with
>> Java, add to that the possibility of writing Android apps with the same
>> knowledge.
>>
>
> To me the salient point is, does java has as extensive a library or set of
> interfaces to other packages (such as SQLite, mysql, etc)?
>
>  I would say that, in general, the other teacher is incorrect speaking
>> strictly in terms of web development.  PHP has already won that crown
>> many times over.  That said, when I was in University, it was difficult
>> to find a programming class that taught anything but Java - and that was
>> 10yrs ago now.  I chalked it up to the education bubble not being able
>> to see what the rest of the world is actually doing.
>>
>
> Was PHP OOP-capable at the time? Perhaps the edu-bubble was simply looking
> down its nose at PHP. There being lots of courses proves nothing in and of
> itself. 20 years ago, there were lots of PC mags you could buy, which
> caused some folks to say "look how much better the PC is supported than
> other platforms". Truth was, at the time, such support was needed given the
> mess of 640k limits, DOS, IRQs and the like, most of which issues have
> ceased to be relevant.
>
> Anyway, why should one need a course to learn PHP, assuming you already
> know other languages. It's simple enough.
>
> --
> Cheers  --  Tim
>
>
>
>
> --**--**
> 
>
>
>
>  --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
github.com/KingCrunch


Re: [PHP] Re: PHP vs JAVA

2013-08-21 Thread georg chambert

Hi,

my I shake the subject a little; Ive been doing some PHP and found it "ok" 
to work with

not so much fuss, but that was PHP4, what about PHP5 ?
Dont really checked the difference but made a short-scan and found that it 
had be

screwed around with ?

Any think, should I change to 5 ?

BR georg

- Original Message - 
From: "Tim Streater" 

To: "PHP List" ; 
Sent: Wednesday, August 21, 2013 1:59 PM
Subject: [PHP] Re: PHP vs JAVA


On 20 Aug 2013 at 23:59, PHP List  wrote:


While I don't have any references to back it up - my guess would be that
Java may be seen as more versatile in general programming terms.  A
staggering number of enterprise level web applications are built with
Java, add to that the possibility of writing Android apps with the same
knowledge.


To me the salient point is, does java has as extensive a library or set of 
interfaces to other packages (such as SQLite, mysql, etc)?



I would say that, in general, the other teacher is incorrect speaking
strictly in terms of web development.  PHP has already won that crown
many times over.  That said, when I was in University, it was difficult
to find a programming class that taught anything but Java - and that was
10yrs ago now.  I chalked it up to the education bubble not being able
to see what the rest of the world is actually doing.


Was PHP OOP-capable at the time? Perhaps the edu-bubble was simply looking 
down its nose at PHP. There being lots of courses proves nothing in and of 
itself. 20 years ago, there were lots of PC mags you could buy, which caused 
some folks to say "look how much better the PC is supported than other 
platforms". Truth was, at the time, such support was needed given the mess 
of 640k limits, DOS, IRQs and the like, most of which issues have ceased to 
be relevant.


Anyway, why should one need a course to learn PHP, assuming you already know 
other languages. It's simple enough.


--
Cheers  --  Tim








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



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



Re: [PHP] Re: [PHP-DEV] [PHP] PHP 5.5.0 final has been released!

2013-06-21 Thread Daniel
I hope this will get people like WordPress to get up and support
mysqli out of the box. going to cause big issues if they don't.






On Sat, Jun 22, 2013 at 8:59 AM, Martin Amps  wrote:
> I second this - great to see both finally available. Fantastic release!
>
> Martin Amps | CIO
> www.iCracked.com
> iCracked | Redwood City, CA
>
> On Jun 21, 2013, at 2:01 PM, Julian  wrote:
>
>> Awesome work and the new design for the php.net website is also nice ;)
>>
>> Am 20.06.2013, 23:22 Uhr, schrieb Julien Pauli :
>>
>>> Hello!
>>>
>>> The PHP Development Team would like to announce the immediate release of
>>> PHP 5.5.0. This release includes a large number of new features and bug
>>> fixes.
>>>
>>> A separate release announcement is also available. For changes in PHP
>>> 5.5.0 since PHP 5.4, please consult the PHP 5 ChangeLog.
>>>
>>> Release Announcement: http://www.php.net/release_5_5_0.php
>>> Downloads:http://www.php.net/downloads.php#v5.5
>>> Changelog:http://www.php.net/ChangeLog-5.php#5.5.0
>>>
>>> Thanks to all contributors that made this new version available.
>>>
>>> regards,
>>>
>>> David Soria Parra & Julien Pauli
>>
>> --
>> PHP Internals - PHP Runtime Development Mailing List
>> To unsubscribe, visit: http://www.php.net/unsub.php
>

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



Re: [PHP] Re: [PHP-DEV] PHP 5.5.0 final has been released!

2013-06-21 Thread Ravi Gehlot
Awesome!


On Thu, Jun 20, 2013 at 11:14 PM, Marco Pivetta  wrote:

> Well done! Congratulations!
> On 20 Jun 2013 23:23, "Julien Pauli"  wrote:
>
> > Hello!
> >
> > The PHP Development Team would like to announce the immediate release of
> > PHP 5.5.0. This release includes a large number of new features and bug
> > fixes.
> >
> > A separate release announcement is also available. For changes in PHP
> > 5.5.0 since PHP 5.4, please consult the PHP 5 ChangeLog.
> >
> > Release Announcement: http://www.php.net/release_5_5_0.php
> > Downloads:http://www.php.net/downloads.php#v5.5
> > Changelog:http://www.php.net/ChangeLog-5.php#5.5.0
> >
> > Thanks to all contributors that made this new version available.
> >
> > regards,
> >
> > David Soria Parra & Julien Pauli
> >
>


Re: [PHP] Re: [PHP-DEV] feature request : easy shared memory

2013-03-18 Thread Matijn Woudt
On Mon, Mar 18, 2013 at 3:46 AM, Larry Garfield wrote:

> On 03/14/2013 01:21 PM, Bob Weinand wrote:
>
>> Sharing active memory between processes goes against the "shared nothing"
>>> design of PHP.  The lack of the feature you're describing is itself a
>>> feature. :-)
>>>
>>> If you had real shared memory, then you're now writing a multi-threaded
>>> app.  Even if you aren't using threads per se it's the same level of
>>> potential for spooky action at a distance.  If your problem space really
>>> requires that (and there certainly are those that do), Java or NodeJs will
>>> suit you better because those are built specifically for a
>>> persistent-server model, rather than PHP's shared-nothing design. However,
>>> in practice most PHP/web applications don't need that, because HTTP is a
>>> stateless request/response system.  Shared-nothing more closely models what
>>> the actual environment is doing, and can still be very performant as long
>>> as you don't do anything naive.
>>>
>>> If you're doing something stateful like Web Sockets, then you can run
>>> PHP as a cli application that is its own persistent server rather than as
>>> an Apache add-on.  For that, look at Ratchet: http://socketo.me/
>>>
>>> --Larry Garfield
>>>
>> If PHP should be so restrictive against sharing, why are there extensions
>> like memcached, ...? Someone must have missed this possibility to share
>> rapidly...
>>
>> If I need something like websockets, I use the pthreads extension:
>> perfectly suited for stateful applications.
>>
>> For example: I want to have the database in memory (no, no mysql
>> Memory-tables; this is too slow...) and only do the updates into the
>> database for faster access when most contents are read-only. What are these
>> good reasons against such a feature except it violates the shares-nothing
>> superlative of PHP. (Even if this feature would exist, you can still write
>> PHP without sharing)
>>
>> Bo Weinand
>>
>
> Memcache is out of process.  There are possible race conditions there, but
> FAR fewer and FAR more contained than true multi-threaded environments.
>
> This list has debated the merits of shared-nothing many times before; it
> was a deliberate design decision in the interest of simplifying development
> for the overwhelming majority of users.  If your app is so performance
> sensitive that a memcache lookup is going to bring it to its knees, then
> either you're misusing PHP or you're better off using something other than
> PHP.  (PHP is not the tool for every use case.)
>
> In any event, adding true shared memory to PHP would be nearly impossible
> without completely redesigning the way it interacts with web servers.  The
> alternative is to write your own PHP CLI application that connects to
> sockets itself and runs as a daemon (possibly using the pthreads extention
> as you mention), and cut apache/nginx out of the picture entirely.  If your
> use case calls for that, knock yourself out.  But the "good reasons"
> against adding such a feature is that it would require rewriting everything
> and rearchitecting the entire Apache SAPI, which is not happening any time
> soon.
>
> --Larry Garfield
>
>
I don't see why you would need to cut out apache/nginx. I would set up the
server just like you (Larry) describe, with socket & pthreads, but it would
be far more easier to just create a simple php file inside your
apache/nginx directory. Use something like mod_rewrite to redirect all urls
to this php file. In this file, connect to the application server, send the
request data ($_GET, $_POST, etc) to the application server, and pass all
data retrieved from the application server back to the user.
And there you go, you have an application server.

- Matijn


Re: [PHP] Re: [PHP-DEV] new FTP function

2013-01-18 Thread tamouse mailing lists
On Fri, Jan 18, 2013 at 9:26 PM, tamouse mailing lists
 wrote:
> On Fri, Jan 18, 2013 at 9:43 AM, Daniel Brown  wrote:
>> On Fri, Jan 18, 2013 at 10:33 AM, KISE  wrote:
>>> Paul Dragoonis,
>>>
>>> Actually it wont work i did tried it before, if the dir end with / it will
>>> list the directories inside the path you gave it and if it doesn't have any
>>> directories it will return false since there is no directories to return.
>>>
>>> you have to take out the last / and then remove the directory in question
>>> and list the files in the parent directory and check if the dir exists
>>> otherwise it will return false, i spent 3hrs yesterday thinking why its
>>> returning false even though the directory exists.
>>
>> The discussion is now getting more into the general coding realm
>> than internals, so let's move it over there in case anyone wants to
>> mention something like:
>>
>> function ftp_dir_exists($conn, $currentDir) {
>> $currentDir = (substr($currentDir,-1,1) == '/') ?
>> substr($currentDir,0,-1) : $currentDir;
>> $list  = ftp_nlist($conn, '-dF '. $currentDir);
>> return in_array($currentDir, $list);
>> }
>
>
> Haven't played with ftp functions at all, but wondering what if you
> gave it dirname($currentDir) instead of $currentDir? (Still have to do
> the trailing '/'-ectomy)
>
>$list = ftp_nlist($conn, dirname($currentDir));
>
> untested, just a thought.

Although on further thought, if $currentDir actually points to a
non-directory, that will still pass, won't it. Might have to go with
ftp_rawlist and parse it out to ensure it is a directory... Check the
first character of each line to see if it's 'd', then the file name
will be the last field in the line.

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



Re: [PHP] Re: [PHP-DEV] new FTP function

2013-01-18 Thread tamouse mailing lists
On Fri, Jan 18, 2013 at 9:43 AM, Daniel Brown  wrote:
> On Fri, Jan 18, 2013 at 10:33 AM, KISE  wrote:
>> Paul Dragoonis,
>>
>> Actually it wont work i did tried it before, if the dir end with / it will
>> list the directories inside the path you gave it and if it doesn't have any
>> directories it will return false since there is no directories to return.
>>
>> you have to take out the last / and then remove the directory in question
>> and list the files in the parent directory and check if the dir exists
>> otherwise it will return false, i spent 3hrs yesterday thinking why its
>> returning false even though the directory exists.
>
> The discussion is now getting more into the general coding realm
> than internals, so let's move it over there in case anyone wants to
> mention something like:
>
> function ftp_dir_exists($conn, $currentDir) {
> $currentDir = (substr($currentDir,-1,1) == '/') ?
> substr($currentDir,0,-1) : $currentDir;
> $list  = ftp_nlist($conn, '-dF '. $currentDir);
> return in_array($currentDir, $list);
> }


Haven't played with ftp functions at all, but wondering what if you
gave it dirname($currentDir) instead of $currentDir? (Still have to do
the trailing '/'-ectomy)

   $list = ftp_nlist($conn, dirname($currentDir));

untested, just a thought.

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



Re: [PHP] Re: PHP The Right Way (website)

2012-10-14 Thread Jim Giner

On 10/14/2012 12:12 PM, Daniel Brown wrote:

On Sun, Oct 14, 2012 at 11:48 AM, Jim Giner
 wrote:



Sounds like a good idea, but as for me - if I was a newbie I'd have a
problem with their very first instructions.  It says right off the start to
type in the following:
php -5 localhost:8000


 That should be a capital S, not a five.


hmmm,  that does make a difference.

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



Re: [PHP] Re: PHP The Right Way (website)

2012-10-14 Thread Jim Giner

On 10/14/2012 12:06 PM, tamouse mailing lists wrote:

On Sun, Oct 14, 2012 at 10:48 AM, Jim Giner
 wrote:

On 10/14/2012 1:10 AM, tamouse mailing lists wrote:


This just dropped in my inbox the other day from Smashing #69:


2. PHP The Right Way

If you are developing for the Web, the chances are high that you have
to deal with PHP on a regular basis. However, once you've stumbled
upon a problem that you have to solve, finding a good solution among
thousands and thousands of (partly outdated) PHP tutorials out there
can be quite a nightmare — especially if you are relatively new to
PHP. Where would you go to learn about the current best practices in
PHP?

PHP The Right Way

Perhaps PHP The Right Way. The site is an easy-to-read, quick
reference for the best practices in PHP, accepted coding standards,
and links to authoritative tutorials around the Web. Josh Lockhart has
worked together with a dozen of well-respected members of the PHP
community to create a useful, up-to-date resource for everybody to
use.



I've just been perusing it, and it offers some good advice. Anyone
here work on it / read it? Thoughts?


Sounds like a good idea, but as for me - if I was a newbie I'd have a
problem with their very first instructions.  It says right off the start to
type in the following:
php -5 localhost:8000

which when I do (from a dos prompt) gives me a nice description of the
command, but fails to do anything else for me.  So how does this (as it
says) "help me learn with the hassle of configureing and installing a
full-fledged web server"?


Are you running 5.4+? First thing it says is "Use the current stable
version (5.4)". The PHP server (-S) is not available in anything
earlier.

I'm not running anything.  It says to type a command and I did.  That's 
my point - it's kind of misleading in it's introduction.


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



Re: [PHP] Re: PHP The Right Way (website)

2012-10-14 Thread Daniel Brown
On Sun, Oct 14, 2012 at 11:48 AM, Jim Giner
 wrote:
>>
> Sounds like a good idea, but as for me - if I was a newbie I'd have a
> problem with their very first instructions.  It says right off the start to
> type in the following:
> php -5 localhost:8000

That should be a capital S, not a five.

-- 

Network Infrastructure Manager
http://www.php.net/

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



Re: [PHP] Re: PHP The Right Way (website)

2012-10-14 Thread tamouse mailing lists
On Sun, Oct 14, 2012 at 10:48 AM, Jim Giner
 wrote:
> On 10/14/2012 1:10 AM, tamouse mailing lists wrote:
>>
>> This just dropped in my inbox the other day from Smashing #69:
>>
>>> 2. PHP The Right Way
>>>
>>> If you are developing for the Web, the chances are high that you have
>>> to deal with PHP on a regular basis. However, once you've stumbled
>>> upon a problem that you have to solve, finding a good solution among
>>> thousands and thousands of (partly outdated) PHP tutorials out there
>>> can be quite a nightmare — especially if you are relatively new to
>>> PHP. Where would you go to learn about the current best practices in
>>> PHP?
>>>
>>> PHP The Right Way
>>>
>>> Perhaps PHP The Right Way. The site is an easy-to-read, quick
>>> reference for the best practices in PHP, accepted coding standards,
>>> and links to authoritative tutorials around the Web. Josh Lockhart has
>>> worked together with a dozen of well-respected members of the PHP
>>> community to create a useful, up-to-date resource for everybody to
>>> use.
>>>
>>
>> I've just been perusing it, and it offers some good advice. Anyone
>> here work on it / read it? Thoughts?
>>
> Sounds like a good idea, but as for me - if I was a newbie I'd have a
> problem with their very first instructions.  It says right off the start to
> type in the following:
> php -5 localhost:8000
>
> which when I do (from a dos prompt) gives me a nice description of the
> command, but fails to do anything else for me.  So how does this (as it
> says) "help me learn with the hassle of configureing and installing a
> full-fledged web server"?

Are you running 5.4+? First thing it says is "Use the current stable
version (5.4)". The PHP server (-S) is not available in anything
earlier.

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



Re: [PHP] Re: php can't insert data mysql table

2012-10-01 Thread Tim Dunphy
>
> I think the comment about your "cannot insert query" was because it really
> did not make sense.  Once truly cannot "insert a query".  Since you ask
> tho, a more approp message might be
> "Insert query failed to execute.Error returned was " . mysqli_error()
> . "Query was $q"
>
> As for your index issue - you are using an autoincrement(?) field as the
> primary key.  Is this related to another record in your db?  If not, why
> even have the primary key?
>
> Hey! I really like your error message. Borrowing it! :) Yes I am now using
auto_increment, and that's what seemed to solve my issue. Looks like a
simple omission in forgetting to use auto_increment and using primary key.
I usually know better. I'll blame this one on the clonopin. lol

thank you
tim

On Mon, Oct 1, 2012 at 12:30 PM, Jim Giner wrote:

> On 10/1/2012 12:20 PM, Tim Dunphy wrote:
>
>> hey thanks guys adding debugging info worked.
>>
>> Actually it was mysqli_error() providing me with a specific error of where
>> the problem was.
>>
>> Cannot insert query:Duplicate entry '0' for key 'PRIMARY'
>>
>> This is the data in the table
>>
>> mysql> select * from guitarwars;
>> ++-+--**-+---+**
>> ---+
>> | id | date| name  | score | screenshot
>>  |
>> ++-+--**-+---+**
>> ---+
>> |  0 | 2012-10-01 11:55:45 | Tommy Tutone  |  2442 |
>> bg_titlestrip.jpg |
>> |  1 | 2012-10-01 08:34:18 | Dunphy| 2 | proof.jpg
>>   |
>> |  2 | 2012-10-01 00:25:53 | ray davies|  NULL | 2241
>>  |
>> |  3 | 2008-04-22 14:37:34 | Paco Jastorius|  NULL | NULL
>>  |
>> |  4 | 2008-04-22 21:27:54 | Nevil Johansson   |  NULL | NULL
>>  |
>> |  5 | 2008-04-23 09:12:53 | Belita Chevy  |  NULL | NULL
>>  |
>> |  6 | 2008-04-23 14:09:50 | Kenny Lavitz  |  NULL | NULL
>>  |
>> |  7 | 2008-04-24 08:13:52 | Phiz Lairston |  NULL | NULL
>>  |
>> |  8 | 2008-04-25 07:22:19 | Jean Paul Jones   |  NULL | NULL
>>  |
>> |  9 | 2008-04-25 11:49:23 | Jacob Scorcherson |  NULL | NULL
>>  |
>> ++-+--**-+---+**
>> ---+
>>
>>
>> This was the query I was using:
>>
>> $query = "INSERT INTO guitarwars  (date, name, score, screenshot) VALUES
>> (NOW(), '$name', '$score', '$screenshot')";
>>
>> It seems to be inserting a default value of 0 since the id is not being
>> specified and that's when I realized that I had failed to auto_increment
>> the id column. D'oh! So once I did that everything worked like a charm.
>>
>> @Ken
>>
>>> First -- NEVER post code with your database username/password. Since you
>>>
>> did, change your db password immediately.
>>
>> Well actually I did not. Did you really think 'secretsauce' was my
>> password? :) But I guess you're right in that this may be a little
>> ambiguous when seeking advice in lists so from now on I will take your
>> advice on making login information unambiguously fake in the form of
>> user='' and password='xxx'.
>>
>> @Stuart
>> But take note of what everyone else is saying. You should be getting the
>> error message when this happens which will tell you exactly what the
>> problem is, above and beyond "Cannot insert query" (which, btw, makes no
>> sense at all :)).
>>
>> Ok well I'm using an 'insert' query so I'm not sure why you say that this
>> makes no sense at all. :)) If you don't mind giving this n00b advice what
>> would be a better/more accurate error message?
>>
>> They take away from this for me was.. don't skimp on the error messages!
>> The one I got was so clear that fixing the problem was easy at that point.
>>
>> But thanks again guys.. this list has been an indispensable source source
>> of wisdom on my journey in learning PHP.
>>
>> Tim
>>
>>
>> Thanks again guys,
>> Tim
>>
>>
>>
>>  I think the comment about your "cannot insert query" was because it
>> really did not make sense.  Once truly cannot "insert a query".  Since you
>> ask tho, a more approp message might be
>> "Insert query failed to execute.Error returned was " . mysqli_error()
>> . "Query was $q"
>>
>> As for your index issue - you are using an autoincrement(?) field as the
>> primary key.  Is this related to another record in your db?  If not, why
>> even have the primary key?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B


Re: [PHP] Re: php can't insert data mysql table

2012-10-01 Thread Jim Giner

On 10/1/2012 12:20 PM, Tim Dunphy wrote:

hey thanks guys adding debugging info worked.

Actually it was mysqli_error() providing me with a specific error of where
the problem was.

Cannot insert query:Duplicate entry '0' for key 'PRIMARY'

This is the data in the table

mysql> select * from guitarwars;
++-+---+---+---+
| id | date| name  | score | screenshot|
++-+---+---+---+
|  0 | 2012-10-01 11:55:45 | Tommy Tutone  |  2442 | bg_titlestrip.jpg |
|  1 | 2012-10-01 08:34:18 | Dunphy| 2 | proof.jpg |
|  2 | 2012-10-01 00:25:53 | ray davies|  NULL | 2241  |
|  3 | 2008-04-22 14:37:34 | Paco Jastorius|  NULL | NULL  |
|  4 | 2008-04-22 21:27:54 | Nevil Johansson   |  NULL | NULL  |
|  5 | 2008-04-23 09:12:53 | Belita Chevy  |  NULL | NULL  |
|  6 | 2008-04-23 14:09:50 | Kenny Lavitz  |  NULL | NULL  |
|  7 | 2008-04-24 08:13:52 | Phiz Lairston |  NULL | NULL  |
|  8 | 2008-04-25 07:22:19 | Jean Paul Jones   |  NULL | NULL  |
|  9 | 2008-04-25 11:49:23 | Jacob Scorcherson |  NULL | NULL  |
++-+---+---+---+


This was the query I was using:

$query = "INSERT INTO guitarwars  (date, name, score, screenshot) VALUES
(NOW(), '$name', '$score', '$screenshot')";

It seems to be inserting a default value of 0 since the id is not being
specified and that's when I realized that I had failed to auto_increment
the id column. D'oh! So once I did that everything worked like a charm.

@Ken

First -- NEVER post code with your database username/password. Since you

did, change your db password immediately.

Well actually I did not. Did you really think 'secretsauce' was my
password? :) But I guess you're right in that this may be a little
ambiguous when seeking advice in lists so from now on I will take your
advice on making login information unambiguously fake in the form of
user='' and password='xxx'.

@Stuart
But take note of what everyone else is saying. You should be getting the
error message when this happens which will tell you exactly what the
problem is, above and beyond "Cannot insert query" (which, btw, makes no
sense at all :)).

Ok well I'm using an 'insert' query so I'm not sure why you say that this
makes no sense at all. :)) If you don't mind giving this n00b advice what
would be a better/more accurate error message?

They take away from this for me was.. don't skimp on the error messages!
The one I got was so clear that fixing the problem was easy at that point.

But thanks again guys.. this list has been an indispensable source source
of wisdom on my journey in learning PHP.

Tim


Thanks again guys,
Tim



I think the comment about your "cannot insert query" was because it 
really did not make sense.  Once truly cannot "insert a query".  Since 
you ask tho, a more approp message might be
"Insert query failed to execute.Error returned was " . 
mysqli_error() . "Query was $q"


As for your index issue - you are using an autoincrement(?) field as the 
primary key.  Is this related to another record in your db?  If not, why 
even have the primary key?


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



Re: [PHP] Re: php can't insert data mysql table

2012-10-01 Thread Tim Dunphy
hey thanks guys adding debugging info worked.

Actually it was mysqli_error() providing me with a specific error of where
the problem was.

Cannot insert query:Duplicate entry '0' for key 'PRIMARY'

This is the data in the table

mysql> select * from guitarwars;
++-+---+---+---+
| id | date| name  | score | screenshot|
++-+---+---+---+
|  0 | 2012-10-01 11:55:45 | Tommy Tutone  |  2442 | bg_titlestrip.jpg |
|  1 | 2012-10-01 08:34:18 | Dunphy| 2 | proof.jpg |
|  2 | 2012-10-01 00:25:53 | ray davies|  NULL | 2241  |
|  3 | 2008-04-22 14:37:34 | Paco Jastorius|  NULL | NULL  |
|  4 | 2008-04-22 21:27:54 | Nevil Johansson   |  NULL | NULL  |
|  5 | 2008-04-23 09:12:53 | Belita Chevy  |  NULL | NULL  |
|  6 | 2008-04-23 14:09:50 | Kenny Lavitz  |  NULL | NULL  |
|  7 | 2008-04-24 08:13:52 | Phiz Lairston |  NULL | NULL  |
|  8 | 2008-04-25 07:22:19 | Jean Paul Jones   |  NULL | NULL  |
|  9 | 2008-04-25 11:49:23 | Jacob Scorcherson |  NULL | NULL  |
++-+---+---+---+


This was the query I was using:

$query = "INSERT INTO guitarwars  (date, name, score, screenshot) VALUES
(NOW(), '$name', '$score', '$screenshot')";

It seems to be inserting a default value of 0 since the id is not being
specified and that's when I realized that I had failed to auto_increment
the id column. D'oh! So once I did that everything worked like a charm.

@Ken
>First -- NEVER post code with your database username/password. Since you
did, change your db password immediately.

Well actually I did not. Did you really think 'secretsauce' was my
password? :) But I guess you're right in that this may be a little
ambiguous when seeking advice in lists so from now on I will take your
advice on making login information unambiguously fake in the form of
user='' and password='xxx'.

@Stuart
But take note of what everyone else is saying. You should be getting the
error message when this happens which will tell you exactly what the
problem is, above and beyond "Cannot insert query" (which, btw, makes no
sense at all :)).

Ok well I'm using an 'insert' query so I'm not sure why you say that this
makes no sense at all. :)) If you don't mind giving this n00b advice what
would be a better/more accurate error message?

They take away from this for me was.. don't skimp on the error messages!
The one I got was so clear that fixing the problem was easy at that point.

But thanks again guys.. this list has been an indispensable source source
of wisdom on my journey in learning PHP.

Tim


Thanks again guys,
Tim



-- 
GPG me!!

gpg --keyserver pool.sks-keyservers.net --recv-keys F186197B


Re: [PHP] Re: php can't insert data mysql table

2012-10-01 Thread Jim Giner

On 10/1/2012 9:12 AM, Tommy Pham wrote:

On Mon, Oct 1, 2012 at 6:03 AM, Jim Giner  wrote:


In this case, I do think that your insert statement is incorrect - I could
be wrong.  I think the VALUES clause s/b just 'VALUE'.  Also if you added
MYSQLI_ERROR to your error handling you should get a very helpful message.



VALUES also work.  See http://dev.mysql.com/doc/refman/5.5/en/insert.html


Yeah - I just saw it in one of my scripts.

So - adding the error handling and the call to mysqli_error should help 
the OP diagnose his problem.


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



Re: [PHP] Re: php can't insert data mysql table

2012-10-01 Thread Tommy Pham
On Mon, Oct 1, 2012 at 6:03 AM, Jim Giner  wrote:

> In this case, I do think that your insert statement is incorrect - I could
> be wrong.  I think the VALUES clause s/b just 'VALUE'.  Also if you added
> MYSQLI_ERROR to your error handling you should get a very helpful message.
>

VALUES also work.  See http://dev.mysql.com/doc/refman/5.5/en/insert.html

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



Re: [PHP] Re: PHP as Application Server

2012-09-27 Thread Sebastian Krebs
Hi,

Once again I didn't read it completely (maybe I will do so), but my 2ct:

I recently played with Ruby and Python and of course with their application
server (at least a little bit). My experience was, that it is less fun as
it sounds in the first place compared to a well designed
webserver-interpreter-stack (and of course common OS-specific stuff for
CLI). In my eyes it is good the way it is: Let PHP do it's job and let
"more intelligent tools" do the other things, like spawning
request-handling processes.

Not saying, that I'm against an application, but I currently don't miss it
:) On the other side someone must maintain it and someone must make sure,
that it is secure and efficient. This resources should not taken from the
core-team.

Regards,
Sebastian

2012/9/27 Alessandro Pellizzari 

> Il Thu, 27 Sep 2012 12:28:00 +0200, Maciej Liżewski ha scritto:
>
> > Sure there are
> > disadvantages and other problems but what Alessando is saying is "I
> > would not use cure for cancer even if it existed because it can
> > introduce other problems like overpopulation".
>
> Uhm, no.
>
> I see it as "I would not use chemio if I could remove the cancer with
> laser therapy".
>
> They are two ways to solve the same problem, and I think the non-
> application-server way is the best.
> It is similar to the Unix way: many small pieces tied together to reach a
> goal.
> The application server is more like the Windows way: one big piece to
> reach a goal.
>
> I understand sometimes the application server can be easier or fit
> better, but I think most of the times it is the wrong solution,
> expecially
> in PHP, but not exclusively.
>
> Bye.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


-- 
github.com/KingCrunch


Re: [PHP] Re: PHP as Application Server

2012-09-27 Thread Maciej Liżewski
to Matijn Woudt: you are right there should be something like: public
void synchronized increment(), but that is not the point. Sure there
are disadvantages and other problems but what Alessando is saying is
"I would not use cure for cancer even if it existed because it can
introduce other problems like overpopulation". There are cases when
"application server" adds much overhead that is not needed and there
are cases when it simplifies your tasks a lot. So from his mail the
only problem I can see is memory leaks, and I am not talking about
leaks in application because they can be caught in tests and fixed,
but mostly leaks in poorly wriiten PHP core and modules. Other like
session hijacking are not real problems (other languages somehow
managed it to work) or not so big in face of some other advantages
(like restarting application after change).

Robert Williams points that the main problem is with PHP programmers
who tend to ignore many aspects of multithreaded programming and PHP
helps them in that by hiding all threading aspects. There are still
people who can understand that and take profit from this knowlege.

The memory is also not such problem. I did some quite large PHP
projects and whole source code event if it were loaded in memory use
only few megabytes (event 100mb is not a problem). And am talking
about holding parsed structures in memory not the source files.
Applications I am talking about are mostly targeted to maximize
throughput and they are the only ones on server. In such cases *any*
speed improvement is worth attention.


I am not forcing anybody to use application server approach, but
rather like Robert said - good to have choice and decide on my own if
I want to write simple scripts or stateful application. The only
problem is that I do not have that choice not considering changing
language... at least I do not have such choice for now :)


2012/9/26 Robert Williams :
> On 9/26/12 10:18, "Matijn Woudt"  wrote:
>
>
>>Writing scripts for an application server requires a much deeper
>>understanding of threads and computer internals,so as a result it
>>probably increases error rate.
>
> Well... yes and no. PHP's architecture pretty much keeps you from having
> to mess with thread management, but it does so by shifting the burden to a
> higher level, either process management of multiple PHP processes or
> thread management within the context of the HTTP server. If your
> application is sufficiently simple, that shift may be enough to keep you
> from having to worry about the problem. For most applications, however,
> it's still a concern. In some ways, this can make things worse, simply
> because PHP programmers tend to be oblivious of the potential problems,
> whereas the typical C# or Java programmer has at least some awareness of
> the various traps that await them.
>
> As an example, I see PHP code *all the time* that is wide open to
> concurrency issues with the database. Most code just assumes it's the only
> code doing updates, but unless the server is set up to serialize requests,
> that's an invalid assumption. Recently, more folks have started to address
> this by using database transactions, but this is often done in ignorance
> of what isolation level is being used and what the impact of that is upon
> the code - which can just make things worse. Even when there is that
> awareness, there are database concurrency issues with which transactions
> can't help. (Of course, people who are aware of isolation levels also tend
> to be aware of other concurrency issues.) The point is, if you have
> multiple things running in parallel, whether that be threads within your
> application or entirely separate physical servers running multiple copies
> of your application, you have to deal with concurrency issues. It's a
> necessary evil of parallel programming, and no mere technological solution
> (language, database, whatever), now or in the future, can fully overcome
> it. Well, maybe an AI engine somewhere in the chain, but that's about it,
> and that's not coming anytime soon.
>
> Incidentally, another advantage of PHP's share-nothing approach that
> hasn't been mentioned is relatively easy scalability. In a shared pool
> architecture, the easiest way to scale is typically vertically, that is,
> adding RAM, faster drives, etc. This is fine, but you can only scale
> vertically to a certain point, which you can usually hit pretty quickly.
> With PHP's share-nothing approach, you can still scale vertically, but you
> can almost as easily scale horizontally by adding more servers that each
> run merrily in their own worlds, with the primary added coordination logic
> being in the areas of communicating with the database and the data cache,
> something the application should be designed with, anyway. In contrast,
> the shared approach requires added logic, somewhere, to coordinate the
> sharing amongst the pools of all that data that the application takes for
> granted is always available 

Re: [PHP] Re: PHP as Application Server

2012-09-26 Thread Robert Williams
On 9/26/12 10:18, "Matijn Woudt"  wrote:


>Writing scripts for an application server requires a much deeper
>understanding of threads and computer internals,so as a result it
>probably increases error rate.

Well... yes and no. PHP's architecture pretty much keeps you from having
to mess with thread management, but it does so by shifting the burden to a
higher level, either process management of multiple PHP processes or
thread management within the context of the HTTP server. If your
application is sufficiently simple, that shift may be enough to keep you
from having to worry about the problem. For most applications, however,
it's still a concern. In some ways, this can make things worse, simply
because PHP programmers tend to be oblivious of the potential problems,
whereas the typical C# or Java programmer has at least some awareness of
the various traps that await them.

As an example, I see PHP code *all the time* that is wide open to
concurrency issues with the database. Most code just assumes it's the only
code doing updates, but unless the server is set up to serialize requests,
that's an invalid assumption. Recently, more folks have started to address
this by using database transactions, but this is often done in ignorance
of what isolation level is being used and what the impact of that is upon
the code - which can just make things worse. Even when there is that
awareness, there are database concurrency issues with which transactions
can't help. (Of course, people who are aware of isolation levels also tend
to be aware of other concurrency issues.) The point is, if you have
multiple things running in parallel, whether that be threads within your
application or entirely separate physical servers running multiple copies
of your application, you have to deal with concurrency issues. It's a
necessary evil of parallel programming, and no mere technological solution
(language, database, whatever), now or in the future, can fully overcome
it. Well, maybe an AI engine somewhere in the chain, but that's about it,
and that's not coming anytime soon.

Incidentally, another advantage of PHP's share-nothing approach that
hasn't been mentioned is relatively easy scalability. In a shared pool
architecture, the easiest way to scale is typically vertically, that is,
adding RAM, faster drives, etc. This is fine, but you can only scale
vertically to a certain point, which you can usually hit pretty quickly.
With PHP's share-nothing approach, you can still scale vertically, but you
can almost as easily scale horizontally by adding more servers that each
run merrily in their own worlds, with the primary added coordination logic
being in the areas of communicating with the database and the data cache,
something the application should be designed with, anyway. In contrast,
the shared approach requires added logic, somewhere, to coordinate the
sharing amongst the pools of all that data that the application takes for
granted is always available at low cost.

Having said all that, there are many advantages and disadvantages to both
approaches. And honestly, I would love to have the option of a shared
approach with PHP, since that architecture simply works better as a
solution to certain problems. Assuming the shared-nothing model continues
on, it would make PHP that much more well-rounded. In that respect, the
added option isn't that different from the addition of OOP: we now have
the great ability to use procedural code where it makes sense, and to use
OOP code where it makes sense. Where neither is a perfect fit, you can
choose the one that creates the least personal pain. It's a wonderful
choice to have.


Regards,
Bob
--
Robert E. Williams, Jr.
Associate Vice President of Software Development
Newtek Businesss Services, Inc. -- The Small Business Authority
https://www.newtekreferrals.com/rewjr
http://www.thesba.com/







Notice: This communication, including attachments, may contain information that 
is confidential. It constitutes non-public information intended to be conveyed 
only to the designated recipient(s). If the reader or recipient of this 
communication is not the intended recipient, an employee or agent of the 
intended recipient who is responsible for delivering it to the intended 
recipient, or if you believe that you have received this communication in 
error, please notify the sender immediately by return e-mail and promptly 
delete this e-mail, including attachments without reading or saving them in any 
manner. The unauthorized use, dissemination, distribution, or reproduction of 
this e-mail, including attachments, is prohibited and may be unlawful. If you 
have received this email in error, please notify us immediately by e-mail or 
telephone and delete the e-mail and the attachments (if any).

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



Re: [PHP] Re: PHP as Application Server

2012-09-26 Thread Matijn Woudt
On Wed, Sep 26, 2012 at 5:23 PM, Maciej Liżewski
 wrote:
> in Java (for example) you just write class:
> class Counter {
>   static private counter = 0;
>
>   public void increment() {
> this.counter++;
>   }
> }
>

And here's where things go wrong.. You assume ++ is an atomic
operation, but in Java that's not true for static variables (it is for
local, but what does it matter?)
So you might end up with a race condition here where the counter will
only be incremented once when there are two or more threads. You need
a mutex or semaphore to make sure there's only one thread
reading/writing the counter at the same time (though volatile would
work here too probably).

Writing scripts for an application server requires a much deeper
understanding of threads and computer internals,so as a result it
probably increases error rate.

I think Alessandro explained the rest of the downsides pretty clearly.

- Matijn

Ps. Please bottom-post on this mailing list

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



Re: [PHP] Re: PHP as Application Server

2012-09-26 Thread Jim Giner

On 9/26/2012 11:23 AM, Maciej Liżewski wrote:

Well.. many things changed during last 30 years. Cobol is not
mainstream, we have got OOP, Java, Python, Ruby, Google and other
great things :)

I am talking about stateful application server. There are plenty
examples in other programming languages: Java has Jetty, Tomcat, Ruby
On Rails, Python and Passenger WSGI.
All of them have one common thing: application persist in memory
between requests. Even for interpreted languages (such Ruby) - this
has advantage of loading sources only once, parse it only once and
initialize memory structures for those definitions only once. On the
opposite - PHP loads EVERY single resource on every request. This is
why it needs op-code cachers, accelerators etc.
Another advantage of using stateful application servers is that you
can simply keep gloabal state of your application (global variables,
static object properties) in memory. It simplifies many tasks which in
PHP require sessions, writing files with serialized data and
deserialize them on every request...

Just imagine such scenarios:
now PHP acts like this on every request:
  1. locate resources (source files in this case), parse and load them
(possibly with op-code cache)
  2. initialize global context ($_SERVER, $GLOBALS, $_POST, $_GET, etc)
  3. run code
  4. destroy all resource and free memory for next request

persistent application servers load resources only on startup (or when
needed) and keep them in memory until programatically freed or until
end of application (server shutdown). So every request looks like
this:
  1. initialize global context
  2. run already parsed code

is that makes whole thing clear?

Another nice example - simple counter. In PHP you have to:
1. read file with counter
2. increment value
3. write serialized value to file
...on every request.

in Java (for example) you just write class:
class Counter {
   static private counter = 0;

   public void increment() {
 this.counter++;
   }
}

and because class definition persists in application server - static
member is maintained between requests and whole things works as
expected...

2012/9/26 Jim Giner :

On 9/26/2012 5:58 AM, Maciej Liżewski wrote:


Hi,

Maybe this topic have been already on board, but I could not find nothing
in google, so my question to PHP maintaneers (and other users too) is:

Why there is no possibility to run PHP in "application server" way among
other SAPI modules and other possibilities to run PHP? PHP would encounter
great performance boost and became more "enterprise" :) Just look at Ruby
which is slow as hell compared even with PHP.

By "application server" I mean scenario when there is statefull
application
on server side not only by session mechanizms but all classes definitions
maintained in memory (no need to load class definition on every request),
static class members (and their changes) persistent, background threads,
etc. This way any op-code cachers won't be necessary...

sounds great, huh? others have it already, so why doesn't PHP? are there
any cons? problems too hard to solve (one can be memory leaks, thread safe
coding, etc)? I mean it - I am realy curious why there is no such
possibility and is there any hope we could get it?

TIA for any answers on this topic.


Thirty+ years as a professional application designer, developer and manager
and I don't have a clue about what you are proposing.  I must have been in a
different world.  :)

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

Sounds to me like you'd need more hardware to support such a concept.  I 
realize that memory can be mapped to disk to avoid the need to have HUGE 
amounts of ram in your server(S!) but with ever-increasing processor 
speed, is it really necessary to go this route?


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



Re: [PHP] Re: PHP as Application Server

2012-09-26 Thread Maciej Liżewski
Well.. many things changed during last 30 years. Cobol is not
mainstream, we have got OOP, Java, Python, Ruby, Google and other
great things :)

I am talking about stateful application server. There are plenty
examples in other programming languages: Java has Jetty, Tomcat, Ruby
On Rails, Python and Passenger WSGI.
All of them have one common thing: application persist in memory
between requests. Even for interpreted languages (such Ruby) - this
has advantage of loading sources only once, parse it only once and
initialize memory structures for those definitions only once. On the
opposite - PHP loads EVERY single resource on every request. This is
why it needs op-code cachers, accelerators etc.
Another advantage of using stateful application servers is that you
can simply keep gloabal state of your application (global variables,
static object properties) in memory. It simplifies many tasks which in
PHP require sessions, writing files with serialized data and
deserialize them on every request...

Just imagine such scenarios:
now PHP acts like this on every request:
 1. locate resources (source files in this case), parse and load them
(possibly with op-code cache)
 2. initialize global context ($_SERVER, $GLOBALS, $_POST, $_GET, etc)
 3. run code
 4. destroy all resource and free memory for next request

persistent application servers load resources only on startup (or when
needed) and keep them in memory until programatically freed or until
end of application (server shutdown). So every request looks like
this:
 1. initialize global context
 2. run already parsed code

is that makes whole thing clear?

Another nice example - simple counter. In PHP you have to:
1. read file with counter
2. increment value
3. write serialized value to file
...on every request.

in Java (for example) you just write class:
class Counter {
  static private counter = 0;

  public void increment() {
this.counter++;
  }
}

and because class definition persists in application server - static
member is maintained between requests and whole things works as
expected...

2012/9/26 Jim Giner :
> On 9/26/2012 5:58 AM, Maciej Liżewski wrote:
>>
>> Hi,
>>
>> Maybe this topic have been already on board, but I could not find nothing
>> in google, so my question to PHP maintaneers (and other users too) is:
>>
>> Why there is no possibility to run PHP in "application server" way among
>> other SAPI modules and other possibilities to run PHP? PHP would encounter
>> great performance boost and became more "enterprise" :) Just look at Ruby
>> which is slow as hell compared even with PHP.
>>
>> By "application server" I mean scenario when there is statefull
>> application
>> on server side not only by session mechanizms but all classes definitions
>> maintained in memory (no need to load class definition on every request),
>> static class members (and their changes) persistent, background threads,
>> etc. This way any op-code cachers won't be necessary...
>>
>> sounds great, huh? others have it already, so why doesn't PHP? are there
>> any cons? problems too hard to solve (one can be memory leaks, thread safe
>> coding, etc)? I mean it - I am realy curious why there is no such
>> possibility and is there any hope we could get it?
>>
>> TIA for any answers on this topic.
>>
> Thirty+ years as a professional application designer, developer and manager
> and I don't have a clue about what you are proposing.  I must have been in a
> different world.  :)
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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



[PHP] Re: PHP Re: PHP Bounce messages

2012-09-21 Thread Tim Streater
On 21 Sep 2012 at 20:56, tamouse mailing lists  wrote: 

> On Fri, Sep 21, 2012 at 4:17 AM, Tim Streater  wrote:
>> On 21 Sep 2012 at 08:40, Lester Caine  wrote:
>>
>>> I know that the php list are one of the 'reply to sender' email handling
>>> camp rather than reply to list.
>>
>> I don't understand this. I reply (not that I mail that often) just to the
>> list, if possible. Why would I do anything else?
>
> I believe Lester is referring to the behaviour of the Reply-To: field
> sent by the list serv, which is the sender's address. Some other
> listservs put the list reply address in Reply-To:

Thanks, I'm with you now. And I also do the To: cc: musical chairs.

--
Cheers  --  Tim

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

Re: [PHP] Re: PHP Bounce messages

2012-09-21 Thread tamouse mailing lists
On Fri, Sep 21, 2012 at 4:17 AM, Tim Streater  wrote:
> On 21 Sep 2012 at 08:40, Lester Caine  wrote:
>
>> I know that the php list are one of the 'reply to sender' email handling camp
>> rather than reply to list.
>
> I don't understand this. I reply (not that I mail that often) just to the 
> list, if possible. Why would I do anything else?

I believe Lester is referring to the behaviour of the Reply-To: field
sent by the list serv, which is the sender's address. Some other
listservs put the list reply address in Reply-To:

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



Re: [PHP] Re: [PHP-WEBMASTER] php error

2012-08-13 Thread As'ad Djamalilleil
can we see the code of the form ?

On Mon, Aug 13, 2012 at 11:09 AM, Daniel Brown  wrote:

> On Mon, Aug 13, 2012 at 2:32 PM, tomas lagro 
> wrote:
> >
> > Hello, my name is tomas, i'm having a problem and i've checked a lot of
> times the script and it is not that, because in my local xampp server it
> works correctly, the issue is that i have a form on my webpage and when you
> submitt it, the post values are not being requested, so the query array has
> no values and has no result because of this. Is this a php.ini mistake?
> what can it be because its driving me crazy. Thanks for ypur time
>
> This email belongs on the PHP General mailing list (CC'd), Tomas,
> and you should subscribe to that list at
> php-general-subscr...@lists.php.net to follow the discussion and get
> help with your questions.
>
> --
> 
> Network Infrastructure Manager
> http://www.php.net/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-23 Thread Ashley Sheridan
On Mon, 2012-07-23 at 13:31 -0500, Larry Garfield wrote:

> Sales tax isn't the point with SOPA/PIPA.  Thinks like the government 
> being able to force any site off the Internet at the ISP / DNS level on 
> the say-so of a private corporation are the point.  And no, that's not a 
> defensible or acceptable position.  Breaking the Internet to prop up 
> industries that don't like being disrupted is not a proper use of 
> governmental power.
> 
> I'm quite happy to see PHP.net joining in with other defense-of-freedom 
> voices.
> 
> --Larry Garfield
> 
> On 7/21/12 1:56 PM, With No Name wrote:
> > On Fri, July 20, 2012 10:04, Lester Caine wrote:
> >> In Europe VAT is applied even on on-line sales. It is the likes of Amazon
> >>   shipping bulk stock from overseas 'clients' into European warehouses and
> >> then supplying them without VAT added directly in Europe that is the
> >> problem! How can I compete with someone who is also giving next day
> >> delivery, but 20% cheaper ... American sellers are one of the problems
> >> here.
> >
> > It depends, because in Europe (I live in Germany), VAT is only added if
> > the value + shiping exceeds 25 Euro and customs are only added, if the
> > value exceeds 150 Euro
> >
> > It does NOT discriminate American sellers, because German sellers have to
> > bill the VAT too
> >
> > Also I buy regulary in the USA and even with heavy USPS costs plus 
> > Import-VAT
> > I am mostly lesser expensive as if I buy in Germany...
> >
> > Greetings
> >
> 


>From what I can gather is that it will break DNSSEC, which has been
designed to establish trusted connections with DNS calls. Essentially,
browsers will accept only signed responses from web servers, and SOPA
(and PROTECT IP) would be redirecting DNS requests for US citizens,
which is precisely the sort of thing DNSSEC is meant to prevent; silent
redirection of DNS requests.

I'm not normally very vocal about these sorts of things, but it will
have ripple effects that can't be predicted in the very industry we all
have our livelihoods in, so I'm glad there's resistance against it.

-- 
Thanks,
Ash
http://www.ashleysheridan.co.uk




Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-23 Thread Larry Garfield
Sales tax isn't the point with SOPA/PIPA.  Thinks like the government 
being able to force any site off the Internet at the ISP / DNS level on 
the say-so of a private corporation are the point.  And no, that's not a 
defensible or acceptable position.  Breaking the Internet to prop up 
industries that don't like being disrupted is not a proper use of 
governmental power.


I'm quite happy to see PHP.net joining in with other defense-of-freedom 
voices.


--Larry Garfield

On 7/21/12 1:56 PM, With No Name wrote:

On Fri, July 20, 2012 10:04, Lester Caine wrote:

In Europe VAT is applied even on on-line sales. It is the likes of Amazon
  shipping bulk stock from overseas 'clients' into European warehouses and
then supplying them without VAT added directly in Europe that is the
problem! How can I compete with someone who is also giving next day
delivery, but 20% cheaper ... American sellers are one of the problems
here.


It depends, because in Europe (I live in Germany), VAT is only added if
the value + shiping exceeds 25 Euro and customs are only added, if the
value exceeds 150 Euro

It does NOT discriminate American sellers, because German sellers have to
bill the VAT too

Also I buy regulary in the USA and even with heavy USPS costs plus Import-VAT
I am mostly lesser expensive as if I buy in Germany...

Greetings



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



Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-21 Thread With No Name
On Fri, July 20, 2012 10:04, Lester Caine wrote:
> In Europe VAT is applied even on on-line sales. It is the likes of Amazon
>  shipping bulk stock from overseas 'clients' into European warehouses and
> then supplying them without VAT added directly in Europe that is the
> problem! How can I compete with someone who is also giving next day
> delivery, but 20% cheaper ... American sellers are one of the problems
> here.

It depends, because in Europe (I live in Germany), VAT is only added if
the value + shiping exceeds 25 Euro and customs are only added, if the
value exceeds 150 Euro

It does NOT discriminate American sellers, because German sellers have to
bill the VAT too

Also I buy regulary in the USA and even with heavy USPS costs plus Import-VAT
I am mostly lesser expensive as if I buy in Germany...

Greetings

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



Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-20 Thread Lester Caine

Paul M Foster wrote:

There are two sides to every problem and simply fighting for one
>side is as bad. What is needed is a reasoned debate rather than
>things like 'The Cat Signal' which personally I find as
>objectionable as the laws it's complaining about!



The real problem is the VAT tax itself. In my opinion, VAT is worse than
direct income tax. The only good thing about VAT is that you
(presumably) don't have to file returns with every state/province
involved.


The EU does have VAT sorted nicely across all the states of Europe, and I simply 
fill in a VAT return each quarter in the UK. For VAT registered European 
customers we simply bill them 0% rated, so there is no need for cross border 
paperwork at all. But European customers who are not VAT registered pay the rate 
of of the country the supplier is based in, which gives some small plus and 
minus advantages. Anything that comes into Europe through proper channels will 
also have VAT added as part of 'customs charges' and businesses simply claim it 
back, hence the irritation at supply channels bypassing the normal trade routes 
:( In theory those goods should have had VAT paid when they came into a European 
warehouse, so it would be nice to know what loophole they use to avoid it ;)


And at least VAT only applies when I spend money, higher income tax would hit 
everything I earn ... but this is getting very much off topic for the list, as 
'The Cat Signal' is anyway in my book.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk



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



RE: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-20 Thread Jeff Burcher
> -Original Message-
> From: Lester Caine [mailto:les...@lsces.co.uk]
> Sent: Friday, July 20, 2012 4:05 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal
> 
> Paul M Foster wrote:
> > Here's another one: There are currently discussions in the U.S.
> > Congress in favor of forcing internet vendors to charge sales tax
> > on*all*  sales, regardless of whether the vendor has a presence in that
> state or not.
> > Imagine having to file state sales tax returns in 50 states. This
> > effort has rather significant bipartisan support. Now ask yourself
> > what large corporation with brick and mortar stores *wouldn't* sign on
> > to support this one? That's what you're up against. You've got
> > Amazon.com on your side. Yay. You might want to get busy on that one.
> 
> In Europe VAT is applied even on on-line sales. It is the likes of Amazon
> shipping bulk stock from overseas 'clients' into European warehouses and
> then supplying them without VAT added directly in Europe that is the
> problem! How can I compete with someone who is also giving next day
> delivery, but 20% cheaper ...
> American sellers are one of the problems here.
> 
> There are two sides to every problem and simply fighting for one side is
as
> bad.
> What is needed is a reasoned debate rather than things like 'The Cat
Signal'
> which personally I find as objectionable as the laws it's complaining
about!
> 
> --
> Lester Caine - G8HFL
> -
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
> http://enquirysolve.com/ Model Engineers Digital Workshop -
> http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

This sounds more like a business annoyance than an internet freedom problem,
but okay. Technically, in the US, I thought it is the end-consumer that
needs to pay a sales tax to the state where they live. Consumer retail
businesses are required to tack them on at the point of sale as a
convenience for both the consumer and the government, then pass the money
on. The seller only pays taxes, to the municipality(s) where their business
is physically located, based on their net profit. So the sales tax itself
does not come out of the company's pocket. The company bears the cost of
tracking, processing, and forwarding the taxes to the government(s)
involved, but that is a deductible expense. Sales taxes are a tedious, but
not costly, normal business expense.

Really, how hard is it for computer savvy people to sort their sales
transactions by customer's state and sum up the sales tax amounts paid so
they can write a check every quarter. Many businesses would be happy to have
to mail 50 checks every quarter, one to each state. That means they are
making sales in every state!  That sounds like a profitable business to me.
And as far as filling out 50 sales and use tax forms each quarter, they have
these things called computers now that make pulling in data and printing
forms happen at the touch of a button. Maybe some enterprising programmer
could write software to do just that and sell it on the internet.

We need to stop playing idealistic revolutionary and help shape real
solutions. The fact that you are allowed to run a business on the internet
is the internet freedom you are looking for. You have won the revolution!
Now, deal with the realities of running a business. Putting your business on
the internet should not be a magic pass to avoid the costs of doing
business. We need to admit we are part of the system and figure out a
streamlined way for internet businesses to pay their fair share. The "Free"
in free economy does not mean it doesn't cost money, time, effort, etc. to
do business.

The internet is not a magic cloud run by fairy dust. The internet was
created by military and higher educational systems, both tax supported
entities. Corporations and governments maintain the infrastructure that
keeps the internet working. Without governments and corporations there would
be no internet. They are the internet. The alternative is to go back to ham
radios. Sorry for the rant, this is a hot button topic for me.


Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com




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



Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-20 Thread Paul M Foster
On Fri, Jul 20, 2012 at 09:04:30AM +0100, Lester Caine wrote:

> Paul M Foster wrote:
> >Here's another one: There are currently discussions in the U.S. Congress
> >in favor of forcing internet vendors to charge sales tax on*all*  sales,
> >regardless of whether the vendor has a presence in that state or not.
> >Imagine having to file state sales tax returns in 50 states. This effort
> >has rather significant bipartisan support. Now ask yourself what large
> >corporation with brick and mortar stores *wouldn't* sign on to support
> >this one? That's what you're up against. You've got Amazon.com on your
> >side. Yay. You might want to get busy on that one.
> 
> In Europe VAT is applied even on on-line sales. It is the likes of
> Amazon shipping bulk stock from overseas 'clients' into European
> warehouses and then supplying them without VAT added directly in
> Europe that is the problem! How can I compete with someone who is
> also giving next day delivery, but 20% cheaper ... American sellers
> are one of the problems here.
> 
> There are two sides to every problem and simply fighting for one
> side is as bad. What is needed is a reasoned debate rather than
> things like 'The Cat Signal' which personally I find as
> objectionable as the laws it's complaining about!

The real problem is the VAT tax itself. In my opinion, VAT is worse than
direct income tax. The only good thing about VAT is that you
(presumably) don't have to file returns with every state/province
involved.

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

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



Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-20 Thread Lester Caine

Paul M Foster wrote:

Here's another one: There are currently discussions in the U.S. Congress
in favor of forcing internet vendors to charge sales tax on*all*  sales,
regardless of whether the vendor has a presence in that state or not.
Imagine having to file state sales tax returns in 50 states. This effort
has rather significant bipartisan support. Now ask yourself what large
corporation with brick and mortar stores *wouldn't* sign on to support
this one? That's what you're up against. You've got Amazon.com on your
side. Yay. You might want to get busy on that one.


In Europe VAT is applied even on on-line sales. It is the likes of Amazon 
shipping bulk stock from overseas 'clients' into European warehouses and then 
supplying them without VAT added directly in Europe that is the problem! How can 
I compete with someone who is also giving next day delivery, but 20% cheaper ... 
American sellers are one of the problems here.


There are two sides to every problem and simply fighting for one side is as bad. 
What is needed is a reasoned debate rather than things like 'The Cat Signal' 
which personally I find as objectionable as the laws it's complaining about!


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk



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



Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Paul M Foster
On Thu, Jul 19, 2012 at 03:45:46PM -0400, Jeff Burcher wrote:

> Hi,
> 
> I have been out of the loop and just did some quick skimming of SOPA/PIPA to
> see what all the fuss was about. PIPA seems a little vague, but SOPA seems
> pretty straight forward, stop piracy of copyrighted materials. I don't
> understand what is wrong with that?

Here's another one: There are currently discussions in the U.S. Congress
in favor of forcing internet vendors to charge sales tax on *all* sales,
regardless of whether the vendor has a presence in that state or not.
Imagine having to file state sales tax returns in 50 states. This effort
has rather significant bipartisan support. Now ask yourself what large
corporation with brick and mortar stores *wouldn't* sign on to support
this one? That's what you're up against. You've got Amazon.com on your
side. Yay. You might want to get busy on that one.

Governments and large corporations are about power and *control*. The
internet is the antithesis of this. So expect their efforts to control
some or all of the internet to continue until they succeed.

Paul

-- 
Paul M. Foster
http://noferblatz.com
http://quillandmouse.com

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



RE: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Jeff Burcher
Hi,

I agree. My wife is from China and both copyright issues and government
enforcement of things have a whole new meaning there, so I understand the
concerns on both sides.

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com


> -Original Message-
> From: Lester Caine [mailto:les...@lsces.co.uk]
> Sent: Thursday, July 19, 2012 4:10 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal
> 
> Jeff Burcher wrote:
> > I have been out of the loop and just did some quick skimming of
> > SOPA/PIPA to see what all the fuss was about. PIPA seems a little
> > vague, but SOPA seems pretty straight forward, stop piracy of
> > copyrighted materials. I don't understand what is wrong with that?
> 
> It depends on how heavy handed the solution is ... Currently I can't get
> torrent downloads of Linux distribution DVD's because torrent is blocked.
> Just because some people abuse a technology is no reason to kill that
> technology for legitimate uses?
> 
> Action groups that just target one country are a little irritating to the
rest of
> us ... a world wide solution is needed.
> 
> --
> Lester Caine - G8HFL
> -
> Contact - http://lsces.co.uk/wiki/?page=contact
> L.S.Caine Electronic Services - http://lsces.co.uk EnquirySolve -
> http://enquirysolve.com/ Model Engineers Digital Workshop -
> http://medw.co.uk Rainbow Digital Media - http://rainbowdigitalmedia.co.uk
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php




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



Re: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Lester Caine

Jeff Burcher wrote:

I have been out of the loop and just did some quick skimming of SOPA/PIPA to
see what all the fuss was about. PIPA seems a little vague, but SOPA seems
pretty straight forward, stop piracy of copyrighted materials. I don't
understand what is wrong with that?


It depends on how heavy handed the solution is ... Currently I can't get torrent 
downloads of Linux distribution DVD's because torrent is blocked. Just because 
some people abuse a technology is no reason to kill that technology for 
legitimate uses?


Action groups that just target one country are a little irritating to the rest 
of us ... a world wide solution is needed.


--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk
Rainbow Digital Media - http://rainbowdigitalmedia.co.uk



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



RE: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal

2012-07-19 Thread Jeff Burcher
Hi,

I have been out of the loop and just did some quick skimming of SOPA/PIPA to
see what all the fuss was about. PIPA seems a little vague, but SOPA seems
pretty straight forward, stop piracy of copyrighted materials. I don't
understand what is wrong with that?

Thanks,

Jeff Burcher - IT Dept
Allred Metal Stamping
PO Box 2566
High Point, NC 27261
(336)886-5221 x229
j...@allredmetal.com


> -Original Message-
> From: Kris Craig [mailto:kris.cr...@gmail.com]
> Sent: Thursday, July 19, 2012 3:40 PM
> To: Ferenc Kovacs
> Cc: Daniel Brown; php-webmas...@lists.php.net; php-general@lists.php.net
> Subject: [PHP] Re: [PHP-WEBMASTER] Re: [PHP] The Cat Signal
> 
> On Thu, Jul 19, 2012 at 12:36 PM, Ferenc Kovacs  wrote:
> 
> >
> > 2012.07.19. 20:21, "Daniel Brown"  ezt írta:
> >
> > >
> > > Forwarding to php-webmas...@lists.php.net, as it's not a
> > > "general user" issue where it pertains to php.net.
> > >
> > > On Thu, Jul 19, 2012 at 2:02 PM, Kris Craig 
> > wrote:
> > > > Hey guys,
> > > >
> > > > I just became aware of this:
> > > >
> > > > http://internetdefenseleague.org/
> > > >
> > > >
> > > > It's a site setup by Mozilla, Reddit, and others to defend
> > > > internet
> > freedom
> > > > in the wake of recent legislative events in the U.S. and elsewhere
> > (full
> > > > members list here:
> http://www.internetdefenseleague.org/members).
> > > >
> > > > They've setup what they're calling the "cat signal," an invisible
> > > > bit
> > of
> > > > embeddable code you can put in your website that will activate
> > > > (and
> > display
> > > > the afore-mentioned signal/link/etc) if/when the next
> > > > SOPA/PIPA/etc
> > comes
> > > > along that threatens the open internet.
> > > >
> > > > I'd like to propose that we integrate this into the PHP website.
> > > > This issue directly affects our community and we already staked a
> > > > claim in
> > this
> > > > fight when we participated in the last great blackout.
> > > >
> > > > In addition, I'd also l ike to propose that we officially join
> > > > this
> > group
> > > > as a member.  I'm not sure if we'd do this by vote or something
> > similar to
> > > > the RFC process & etc, but if you'll grant me permission, I'd be
> > > > happy
> > to
> > > > do the legwork on this myself (make the HTML edits, contact the
> > > > organization on PHP's behalf, etc).
> > > >
> > > >
> > > > Thoughts?
> > > >
> > > > --Kris
> > >
> > >
> > >
> > > --
> > > 
> > > Network Infrastructure Manager
> > > http://www.php.net/
> > >
> > > --
> > > PHP Webmaster List Mailing List (http://www.php.net/) To
> > > unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >  Btw. we were asked by the to join the league as we were a big traffic
> > source on the black out day.
> > I don't know if Rasmus is on the webmaster list or not, but we should
> > cc him, as he was the driving force behind us joining the anti SOPA
> movement.
> >
> I heard back from the webmaster saying that we're already participating
with
> the cat signal on our website.  Given this and no objections, I went ahead
and
> contacted them and asked that they list us on their participating members
> page.
> 
> --Kris



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



RE: [PHP] Re: php form action breaks script

2012-07-02 Thread Ford, Mike
> -Original Message-
> From: Tim Dunphy [mailto:bluethu...@gmail.com]
> Sent: 28 June 2012 01:18
> 
> Hey guys,
> 
> It's been a little while since I've toyed with this, and I hope you
> don't mind my coming back to you for some more advice. But I've
> enjoyed some limited success with David R's advice regarding adding
> some strong quoting to the mix. Here is what I last tried -
> 
>  

Wow! That's completely wacko! (OK, just looked at the full code and
seen it's in the middle of a single-quoted echo, so it's not that bad
after all :). You've got a spare [ in there -- the notice saying
Undefined index: [PHP_SELF should have alerted you to this, as the
index you want is just plain PHP_SELF.

   

> The pages do work, and the form checking code does its job (empty
> text
> displays what information is missing). Except that there is an
> annoying message that appears on screen and in the logs -
> 
> Notice: Undefined index: subject in
> /Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendema
> il.php
> on line 23 Notice: Undefined index: elvismail in
> /Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendema
> il.php
> on line 24 Notice: Undefined index: [PHP_SELF in
> /Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendema
> il.php
> on line 62

Looking at the relevant bit of your script (assume this is line 23
onward):

>   $subject = $_POST['subject'];
>   $text = $_POST['elvismail'];
>   $output_form = "false";
> 
> 
>   if (isset($_POST['Submit'])) {

You're accessing $_POST['subject'] and $_POST['elvismail'] *before* the
check to see if this is a from a form submission - on the initial access,
to just display the form, these $_POST indexes will not be set so
causing the notices.

You either need to put the assignments inside the

  if (isset($POST['Submit']))

branch, or conditionalise them in some way, such as:

$subject = isset($_POST['subject']) ? $_POST['subject'] : NULL;
$text = isset($_POST['elvismail']) ? $_POST['elvismail'] : NULL;


Another oddity in your script is that you're using the string values
"true" and "false" instead of the Boolean true and false. Because of
the way PHP typecasts, both "true" and "false" are actually regarded
as Boolean true, which could get a little confusing -- so it's much
better (and probably more efficient) to use the proper Boolean values.
Also, it enables your later test to be written, with confidence, as
just

if ($output_form) {


Also, also, with a little bit of rearrangement of the tests, you can
reduce the amount of code a bit:

if (!empty($subject) && !empty($text)) {
// Both inputs supplied -- good to go.
$output_form = false;
} else {
// At least one input missing -- need to redisplay form
$output_form = true;

if (empty($subject)) {
if (empty($text)) {
echo 'You forgot the email subject and body.';
} else {
echo 'You forgot the email subject.';
}
} else {
echo 'You forgot the email body text.';
}
}

Actually, I think my inclination would be to assign $output_form
first, and then do the rest of the tests:

$output_form = empty($subject) || empty($text);

if ($output_form) {
// At least one input missing -- work out which one
if (empty($subject))
if (empty($text)) {
echo 'You forgot the email subject and body.';
} else {
echo 'You forgot the email subject.';
}
} else {
echo 'You forgot the email body text.';
}
}

That said, there are lots of personal preferences involved here, and
I'm sure others would offer different possibilities. (Me personally,
I also prefer the alternative block syntax with initial : and end...
tags -- but then, the forests of curly braces others seem to find
acceptable make my eyes go fuzzy, so go figure)

Cheers!

Mike

-- 
Mike Ford,
Electronic Information Developer, Libraries and Learning Innovation,  
Portland PD507, City Campus, Leeds Metropolitan University,
Portland Way, LEEDS,  LS1 3HE,  United Kingdom 
E: m.f...@leedsmet.ac.uk T: +44 113 812 4730






To view the terms under which this email is distributed, please go to 
http://disclaimer.leedsmet.ac.uk/email.htm

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



Re: [PHP] Re: php batch/queue framwork

2012-06-30 Thread Robert Williams
Zend Server includes a job queue.



It supports queuing up jobs directly in the UI or via a PHP API, and it 
includes a variety of scheduling and load management options.

--
Bob Williams

Notice: This communication, including attachments, may contain information that 
is confidential. It constitutes non-public information intended to be conveyed 
only to the designated recipient(s). If the reader or recipient of this 
communication is not the intended recipient, an employee or agent of the 
intended recipient who is responsible for delivering it to the intended 
recipient, or if you believe that you have received this communication in 
error, please notify the sender immediately by return e-mail and promptly 
delete this e-mail, including attachments without reading or saving them in any 
manner. The unauthorized use, dissemination, distribution, or reproduction of 
this e-mail, including attachments, is prohibited and may be unlawful. If you 
have received this email in error, please notify us immediately by e-mail or 
telephone and delete the e-mail and the attachments (if any).

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



Re: [PHP] Re: php batch/queue framwork

2012-06-30 Thread Larry Garfield

On 06/29/2012 05:18 AM, Tom Sparks wrote:

Forwarded Message: php-general_318334.ezm
Re: php batch/queue framwork
Friday, 29 June, 2012 6:30 AM
From:
"Shailesh N. Humbad" 
To:
php-general@lists.php.net
On 6/28/2012 11:58 AM, Tom Sparks wrote:
I am looking for a batch/queue framework that is database-centric?
I could write my own, but I want one that is mature

tom_a_sparks
"It's a nerdy thing I like to do"


You could try Amazon Simple Queue Service: http://aws.amazon.com/sqs/
Use the PHP SDK: http://aws.amazon.com/sdkforphp/

I was hoping for something that I could run local on my host

tom


Have a look at Beanstalk and Gearman.  They're the most common 
run-yourself queues I've seen, and both have PHP libraries available.


ZeroMQ is also the darling of the queuing world these days, but I don't 
know off hand how good the PHP support is.


You won't find a GOOD "database-centric" queue framework, rather by 
definition.  A queuing server may use a DB of some kind as a backend 
itself, but a queue server by definition pushes tasks to workers that 
are waiting for it.  That's simply not how an SQL DB is designed.  You 
would have to do a polling worker that polls a database for new tasks.  
You could write such a system -- Drupal comes with one as a default 
implementation since then you don't need a separate queueing program, 
for instance -- but it will always be greatly inferior to a real 
daemonized queue server.


--Larry Garfield

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



Re: [PHP] Re: php form action breaks script

2012-06-27 Thread Jim Giner


"Tim Dunphy"  wrote in message 
news:caozy0em5duhby-qv+y1u-e+c5yd7g5utauhomoyu3z7jma-...@mail.gmail.com...

Notice: Undefined index: subject in
/Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php
on line 23 Notice: Undefined index: elvismail in
/Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php
on line 24 Notice: Undefined index: [PHP_SELF in
/Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php
on line 62

[Wed Jun 27 20:13:42 2012] [error] [client 127.0.0.1] PHP Notice:
Undefined index: [PHP_SELF in
/Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php
on line 62, referer: http://localhost/elvis/


You're missing an input (POST) for the field named 'subject'.  Something 
change in your html?  As in you no longer have a 'subject' input field? 
Same for the other field named.  As for the missing PHP_SELF - did you start 
a session?  I could be way off on this.  The errors are even giving you the 
line number so it shouldn't be hard to find!




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



Re: [PHP] Re: php form action breaks script

2012-06-27 Thread tamouse mailing lists
On Wed, Jun 27, 2012 at 7:17 PM, Tim Dunphy  wrote:


One more little thing:

These notices:

> Notice: Undefined index: subject in
> /Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php
> on line 23 Notice: Undefined index: elvismail in
> /Library/WebServer/Documents/examples/ch03/final/makemeelvis/sendemail.php

show up because you are processing form fields in $_POST when there
might not be any yet.

These lines:

>  $from = 'bluethu...@jokefire.com';
>  $subject = $_POST['subject'];
>  $text = $_POST['elvismail'];
>  $output_form = "false";


Should appear *after* this line:

>  if (isset($_POST['Submit'])) {


You should also check the $_POST entries for 'subject' and 'elvismail'
to make sure they are set to avoid the notices, even if you do move
them after the submit check. You never know!

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



Re: [PHP] Re: php form action breaks script

2012-06-27 Thread tamouse mailing lists
On Wed, Jun 27, 2012 at 7:17 PM, Tim Dunphy  wrote:
> Hey guys,
>
> It's been a little while since I've toyed with this, and I hope you
> don't mind my coming back to you for some more advice. But I've
> enjoyed some limited success with David R's advice regarding adding
> some strong quoting to the mix. Here is what I last tried -
>
>  

Just a wee typo here: You've quoted '[PHP_SELF' -- the extra bracket
at the beginning what's wrong there. Should just be 'PHP_SELF'.

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



Re: [PHP] Re: php form action breaks script

2012-06-27 Thread Matijn Woudt
On Thu, Jun 28, 2012 at 2:17 AM, Tim Dunphy  wrote:
> Hey guys,
>
> It's been a little while since I've toyed with this, and I hope you
> don't mind my coming back to you for some more advice. But I've
> enjoyed some limited success with David R's advice regarding adding
> some strong quoting to the mix. Here is what I last tried -

Please bottom post on this (and probably any) mailing list.

>
>  

This must be some typo, it should read



>
>
>  $from = 'bluethu...@jokefire.com';
>  $subject = $_POST['subject'];
>  $text = $_POST['elvismail'];
>  $output_form = "false";
>

Try using
$subject = isset($_POST['subject']) ? $_POST['subject'] : "";
$subject = isset($_POST['elvismail']) ? $_POST['elvismail'] : "";

Cheers,

Matijn

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



Re: [PHP] Re: php form action breaks script

2012-06-15 Thread Al
It is a small price to pay for large block, especially if the text has any 
quotes. Personally, I can't keep them straight and delimit them, etc.  Heredoc 
saves all that such stuff.


$insert= MY_DEFINED;

echo <<
On 06/15/2012 06:35 AM, Jim Giner wrote:

Hear, Hear for heredocs. The only way to code up your html. Took me a few
months to discover it and haven't looked back since.





The only problem I have with HEREDOC is I cannot use constants within them.



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



Re: [PHP] Re: php form action breaks script

2012-06-15 Thread ma...@behnke.biz


Jim Lucas  hat am 15. Juni 2012 um 18:39 geschrieben:

> On 06/15/2012 06:35 AM, Jim Giner wrote:
> > Hear, Hear for heredocs.  The only way to code up your html.  Took me a few
> > months to discover it and haven't looked back since.
> >
> >
> >
>
> The only problem I have with HEREDOC is I cannot use constants within them.

You shouldn't use constants anyway. Always inject your dependencies.


>
> --
> Jim Lucas
>
> http://www.cmsws.com/
> http://www.cmsws.com/examples/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
Marco Behnke
Dipl. Informatiker (FH), SAE Audio Engineer Diploma
Zend Certified Engineer PHP 5.3

Tel.: 0174 / 9722336
e-Mail: ma...@behnke.biz

Softwaretechnik Behnke
Heinrich-Heine-Str. 7D
21218 Seevetal

http://www.behnke.biz

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



Re: [PHP] Re: php form action breaks script

2012-06-15 Thread Jim Lucas

On 06/15/2012 06:35 AM, Jim Giner wrote:

Hear, Hear for heredocs.  The only way to code up your html.  Took me a few
months to discover it and haven't looked back since.





The only problem I have with HEREDOC is I cannot use constants within them.

--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/

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



Re: [PHP] Re: php form action breaks script

2012-06-15 Thread ma...@behnke.biz


Al  hat am 15. Juni 2012 um 14:29 geschrieben:

>
>
> On 6/14/2012 7:28 PM, Tim Dunphy wrote:
> > However if I change the form action to this, it breaks the page
> > resulting in a white screen of death:


error_reporting(E_ALL);
ini_set('display_errors', 'On');

And what is the error message?

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



Re: [PHP] Re: php form action breaks script

2012-06-14 Thread Paul Halliday
On Thu, Jun 14, 2012 at 10:17 PM, David Robley  wrote:
> Tim Dunphy wrote:
>
>> Hello list,
>>
>>  I was just wondering if I could get some opinions on a snippet of
>> code which breaks a php web page.
>>
>>  First the working code which is basically an html form being echoed by
>>  php:
>>
>> if ($output_form) {
>>
>>   echo '

>   Subject of email:
>>   
>>   Body of email:
>>    > cols="40">
>>    
>>   ';
>>
>>
>>   }
>>
>> However if I change the form action to this, it breaks the page
>> resulting in a white screen of death:
>>
>>
>>   if ($output_form) {
>>
>>   echo '> method="post"  >
>>   Subject of email:
>>   
>>   Body of email:
>>    > cols="40">
>>    
>>   ';
>>
>>
>>   }
>>
>> Reverting the one line to this:
>>
>> echo '
>>
>> gets it working again. Now I don't know if it's an unbalanced quote
>> mark or what's going on. But I'd appreciate any advice you may have.
>>
>>
>> Best,
>> tim
>>
> If you check your apache log you'll probably see an error message. But the
> problem seems to be that your string you are trying to echo is enclosed in
> single quotes, and contains a string in 
> echo ' method="post"> ...etc
>
>
>
> Cheers
> --
> David Robley
>
> "I haven't had any tooth decay yet," said Tom precariously.
> Today is Sweetmorn, the 20th day of Confusion in the YOLD 3178.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
Paul Halliday
http://www.squertproject.org/

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



Re: [PHP] Re: PHP: a fractal of bad design

2012-04-17 Thread Jay Blanchard

[snip]

a simple +1 will do

[/snip]

Ahthe good old days.

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



Re: [PHP] Re: PHP: a fractal of bad design

2012-04-17 Thread Jim Lucas

On 04/17/2012 05:43 AM, Bogdan Ribic wrote:

Where's the "Like" button on this list? :)


On 4/13/2012 01:44, Ross McKay wrote:

On Wed, 11 Apr 2012 17:06:10 -0700, Daevid Vincent wrote:




"There are only two kinds of languages: the ones people complain about
and the ones nobody uses." -- Bjarne Stroustrup




a simple +1 will do

--
Jim Lucas

http://www.cmsws.com/
http://www.cmsws.com/examples/
http://www.bendsource.com/

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



RE: [PHP] Re: php in windows

2012-04-16 Thread Steven Staples
> -Original Message-
> From: Kirk Bailey [mailto:kbai...@howlermonkey.net]
> Sent: April 11, 2012 10:11 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Re: php in windows
> 
> Steve, THERE IS NO SUCH FILE in tinyweb. It turns to the operating system
> asspciations to determine what to use to process the cgi, then captures
the
> returned stdio output and feeds THAT back as part of the data stream back
> down the stack. Therefore, it is not interfacing with the windows
operating
> system properly, and as I do not speak delphi, I am not sure how to go
> through the sourcecode and rectify this.
> If you like, I cna provide a link to the installer that adds it to a
> windows computer so you can take a look- if you or anyone else is
> interested. Oddly enough, it appears to handle python fine, and is
reported
> by others to also handle perl.
> > Kirk,
> >
> > You have to tell your "tinyweb" what to do with the .php extensions...
> > in the config of the webserver, you will have to add a line saying
> > where the php binary is, or uncomment it (as it probably already
> > exists) and restart the webserver.
> >
> >
> > As it appears to me, since you can have some "code" on the screen,
> > your server does not know how to deal with it, so it will treat it like
a
> text
> > file, and just spew the code out.   Once you have it pointing to the php
> > binary, it will work.
> >
> > Good luck!
> >
> > Steve Staples.
> >
> >

Sorry, I have been out of the office for the last few days... have you
gotten this to work?

As a suggestion, is PHP in the windows path?   If not, then this may be the
issue... Python may have been installed, and put the exe in the PATH
variable, where PHP may not have done it (not sure, I personally use XAMPP
on my windows box for quick development)

Check the PATH from the dos prompt, and if it is not in there, then you will
have to add it (I am just guessing here)

Just in case you're not sure where it is, on my XP machine, I just right
click on "My Computer", click "Properties" and then on the "Advanced" tab,
there is a button labelled "Environment Variables" and then add the path to
the PHP exe...

Hope that this helps!

 
Steven Staples


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



Re: [PHP] Re: php in windows

2012-04-11 Thread Daniel Fenn
I don't want to sound rude but I did say this before, why don't you
get zend server CE or xampp and install that?





On Thu, Apr 12, 2012 at 12:11 PM, Kirk Bailey  wrote:
> Steve, THERE IS NO SUCH FILE in tinyweb. It turns to the operating system
> asspciations to determine what to use to process the cgi, then captures the
> returned stdio output and feeds THAT back as part of the data stream back
> down the stack. Therefore, it is not interfacing with the windows operating
> system properly, and as I do not speak delphi, I am not sure how to go
> through the sourcecode and rectify this.
> If you like, I cna provide a link to the installer that adds it to a windows
> computer so you can take a look- if you or anyone else is interested. Oddly
> enough, it appears to handle python fine, and is reported by others to also
> handle perl.
>
>> Kirk,
>>
>> You have to tell your "tinyweb" what to do with the .php extensions... in
>> the config of the webserver, you will have to add a line saying where the
>> php binary is, or uncomment it (as it probably already exists) and restart
>> the webserver.
>>
>>
>> As it appears to me, since you can have some "code" on the screen, your
>> server does not know how to deal with it, so it will treat it like a text
>> file, and just spew the code out.   Once you have it pointing to the php
>> binary, it will work.
>>
>> Good luck!
>>
>> Steve Staples.
>>
>>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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



Re: [PHP] Re: php in windows

2012-04-11 Thread Kirk Bailey
Steve, THERE IS NO SUCH FILE in tinyweb. It turns to the operating 
system asspciations to determine what to use to process the cgi, 
then captures the returned stdio output and feeds THAT back as part 
of the data stream back down the stack. Therefore, it is not 
interfacing with the windows operating system properly, and as I do 
not speak delphi, I am not sure how to go through the sourcecode and 
rectify this.
If you like, I cna provide a link to the installer that adds it to a 
windows computer so you can take a look- if you or anyone else is 
interested. Oddly enough, it appears to handle python fine, and is 
reported by others to also handle perl.

Kirk,

You have to tell your "tinyweb" what to do with the .php extensions... in
the config of the webserver, you will have to add a line saying where the
php binary is, or uncomment it (as it probably already exists) and restart
the webserver.


As it appears to me, since you can have some "code" on the screen, your
server does not know how to deal with it, so it will treat it like a text
file, and just spew the code out.   Once you have it pointing to the php
binary, it will work.

Good luck!

Steve Staples.




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



Re: [PHP] Re: php in windows

2012-04-11 Thread Jay Blanchard

On 4/11/2012 9:42 AM, Steven Staples wrote:

-Original Message-
From: Kirk Bailey [mailto:kbai...@howlermonkey.net]
Sent: April 11, 2012 1:02 AM
To: php-general@lists.php.net
Subject: Re: [PHP] Re: php in windows

ok, there is a copy of index.php ion the cgibin, and this got WAY

different

results.
It puked an error.


   "CGI script /cgi-bin/index.php returned nothing"

NOW W.T.F., over?
I think that it's time for some rack time. 'Night all.


On 4/11/2012 12:50 AM, Kirk Bailey wrote:

ok, I just installed 5.2.17 VC6X86. I have a simple test page,
index.php; it spews the content code at me.

On 4/10/2012 11:13 AM, Bogdan Ribic wrote:

On 4/10/2012 04:05, Kirk Bailey wrote:

The edition of php for windows I instaklled does not work. Which
flavor
of windows php DOES work properly in windows?

Trust me, it does work :)

I'm running PHP 5.3.10 thread-safe, as apache module on apache
2.4.1 from apache lounge (not official apache builds, as
instructed on PHP's download site), all of that on Win XP. Read
the instruction in php bundle on setting it up with apache 2.2
branch.


Kirk,

[snip]

You have to tell your "tinyweb" what to do with the .php extensions... in
the config of the webserver, you will have to add a line saying where the
php binary is, or uncomment it (as it probably already exists) and restart
the webserver.


As it appears to me, since you can have some "code" on the screen, your
server does not know how to deal with it, so it will treat it like a text
file, and just spew the code out.   Once you have it pointing to the php
binary, it will work.

[/snip]

Maybe this will help - 
http://itsecuritylab.eu/index.php/2010/09/24/tinyweb-pocket-size-portable-web-server-with-cgi-and-php-support/


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



RE: [PHP] Re: php in windows

2012-04-11 Thread Steven Staples
> -Original Message-
> From: Kirk Bailey [mailto:kbai...@howlermonkey.net]
> Sent: April 11, 2012 1:02 AM
> To: php-general@lists.php.net
> Subject: Re: [PHP] Re: php in windows
> 
> ok, there is a copy of index.php ion the cgibin, and this got WAY
different
> results.
> It puked an error.
> 
> 
>   "CGI script /cgi-bin/index.php returned nothing"
> 
> NOW W.T.F., over?
> I think that it's time for some rack time. 'Night all.
> 
> 
> On 4/11/2012 12:50 AM, Kirk Bailey wrote:
> > ok, I just installed 5.2.17 VC6X86. I have a simple test page,
> > index.php; it spews the content code at me.
> >
> > On 4/10/2012 11:13 AM, Bogdan Ribic wrote:
> >> On 4/10/2012 04:05, Kirk Bailey wrote:
> >>> The edition of php for windows I instaklled does not work. Which
> >>> flavor
> >>> of windows php DOES work properly in windows?
> >>
> >> Trust me, it does work :)
> >>
> >> I'm running PHP 5.3.10 thread-safe, as apache module on apache
> >> 2.4.1 from apache lounge (not official apache builds, as
> >> instructed on PHP's download site), all of that on Win XP. Read
> >> the instruction in php bundle on setting it up with apache 2.2
> >> branch.
> >>
> >

Kirk,

You have to tell your "tinyweb" what to do with the .php extensions... in
the config of the webserver, you will have to add a line saying where the
php binary is, or uncomment it (as it probably already exists) and restart
the webserver.


As it appears to me, since you can have some "code" on the screen, your
server does not know how to deal with it, so it will treat it like a text
file, and just spew the code out.   Once you have it pointing to the php
binary, it will work.

Good luck!

Steve Staples.


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



Re: [PHP] Re: php in windows

2012-04-10 Thread Kirk Bailey
ok, there is a copy of index.php ion the cgibin, and this got WAY 
different results.

It puked an error.


 "CGI script /cgi-bin/index.php returned nothing"

NOW W.T.F., over?
I think that it's time for some rack time. 'Night all.


On 4/11/2012 12:50 AM, Kirk Bailey wrote:
ok, I just installed 5.2.17 VC6X86. I have a simple test page, 
index.php; it spews the content code at me.


On 4/10/2012 11:13 AM, Bogdan Ribic wrote:

On 4/10/2012 04:05, Kirk Bailey wrote:
The edition of php for windows I instaklled does not work. Which 
flavor

of windows php DOES work properly in windows?


Trust me, it does work :)

I'm running PHP 5.3.10 thread-safe, as apache module on apache 
2.4.1 from apache lounge (not official apache builds, as 
instructed on PHP's download site), all of that on Win XP. Read 
the instruction in php bundle on setting it up with apache 2.2 
branch.






Re: [PHP] Re: php in windows

2012-04-10 Thread Kirk Bailey
ok, I just installed 5.2.17 VC6X86. I have a simple test page, 
index.php; it spews the content code at me.


On 4/10/2012 11:13 AM, Bogdan Ribic wrote:

On 4/10/2012 04:05, Kirk Bailey wrote:
The edition of php for windows I instaklled does not work. Which 
flavor

of windows php DOES work properly in windows?


Trust me, it does work :)

I'm running PHP 5.3.10 thread-safe, as apache module on apache 
2.4.1 from apache lounge (not official apache builds, as 
instructed on PHP's download site), all of that on Win XP. Read 
the instruction in php bundle on setting it up with apache 2.2 
branch.




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



Re: [PHP] Re: php in windows

2012-04-10 Thread Kirk Bailey
I am not running apache; I am running tinyweb, which is a cgi 
capable server. It does not need any special configuration to handle 
cgi, and worked out of the box with python.


On 4/10/2012 11:13 AM, Bogdan Ribic wrote:

On 4/10/2012 04:05, Kirk Bailey wrote:
The edition of php for windows I instaklled does not work. Which 
flavor

of windows php DOES work properly in windows?


Trust me, it does work :)

I'm running PHP 5.3.10 thread-safe, as apache module on apache 
2.4.1 from apache lounge (not official apache builds, as 
instructed on PHP's download site), all of that on Win XP. Read 
the instruction in php bundle on setting it up with apache 2.2 
branch.




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



Re: [PHP] Re: php sendmail_from

2012-01-09 Thread Matijn Woudt
On Mon, Jan 9, 2012 at 8:50 PM, alexus  wrote:
> using Drupal
>

If you're using Drupal to send the mail, or any module installed in
Drupal, than there are most likely settings in Drupal (module) that
allow you to set the from address. If these functions call the mail
command with a different From address, than that address will be used,
and not the one in php.ini, .htaccess or set with ini_set.

Matijn

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



Re: [PHP] Re: php sendmail_from

2012-01-09 Thread alexus
using Drupal

On Mon, Jan 9, 2012 at 2:48 PM, Jim Giner  wrote:
> And how are you generating the email?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
http://alexus.org/

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



Re: [PHP] RE: php-general Digest 9 Dec 2011 20:09:28 -0000 Issue 7604

2011-12-12 Thread David Harkness
On Mon, Dec 12, 2011 at 1:06 PM, David Savage  wrote:

> Would "ksort($sortarr,SORT_STRING)" on a 1 dimensional array with a key
> comprised of
> a person's name,
> "-", and
>  time stamp
> I..E. (key:  david savage-2011-12-12 14:43:00)
> actually delete duplicate keys from the array, if there were two keys the
> same ?
>

Unless I'm missing something, you couldn't have two entries with the same
key in the array to begin with.

$a = array();
$a['david savage-2011-12-12 14:43:00'] = 1;
$a['david savage-2011-12-12 14:43:00'] = 2;
print_r($a);

Array
(
[david savage-2011-12-12 14:43:00] => 2
)

David


Re: [PHP] RE: php-general Digest 9 Dec 2011 20:09:28 -0000 Issue 7604

2011-12-12 Thread Daniel P. Brown
On Mon, Dec 12, 2011 at 16:06, David Savage  wrote:
> I thought I posted this in the php.net web site under the "ksort" user notes, 
> but I don't know if it would be approved to be placed in the web site.
>
> Would "ksort($sortarr,SORT_STRING)" on a 1 dimensional array with a key 
> comprised of
> a person's name,
> "-", and
>  time stamp
> I..E. (key:  david savage-2011-12-12 14:43:00)
> actually delete duplicate keys from the array, if there were two keys the 
> same ?
> Did not see anything regarding this in the user notes of "ksort" page in 
> php.net

If it's a question posted there as a user note, I would delete it.
 I put up a big sign on the page for posting user notes months ago,
complete with an XKCD strip, but somehow still, no one seems to notice
it (or read it, at least).

-- 

Dedicated Servers, Cloud and Cloud Hybrid Solutions, VPS, Hosting
(866-) 725-4321
http://www.parasane.net/

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



Re: [PHP] Re: PHP frameworks

2011-07-23 Thread mrfroasty
Investing your time on Zend Framework is worth it.I do mostly php
development under Magento Platform, and Zend Framework becomes one of
the vital skills I need.Apart from that, ZF is also a well thought
Library that is a joy to work with.As one mentioned, the best part of it
it gives the option to just use what you need and leave the rest stay put.

I always think, only if those devs of Wordpress,Joomla etc have invested
time in ZF we would have a much matured CMS systems today.I am not
saying WordPress is not good, but its known to have lots of security
issues due to poor framework behind it.

Wasalaam,
Muhsin

On 07/22/2011 11:56 AM, Richard Quadling wrote:
> On 21 July 2011 23:56, Shawn McKenzie  wrote:
>> On 07/21/2011 03:59 PM, Chris Stinemetz wrote:
>>> Hello all,
>>>
>>> I am thinking about venturing into PHP frameworks, but I would like to
>>> get advice on what the correct selection would be for someone that is
>>> about intermediate in PHP knowledge.
>>>
>>> Thank you,
>> So, with your post you will probably get one or more replies suggesting
>> every one of the popular frameworks and then several that suggest some
>> lesser known ones.
>>
>> I think Zend looks great, but for many people (including me) it is
>> overly complex and cumbersome. Â It is a very professional and
>> standardised class library, but has no "glue" to put it all together for
>> you. Also, it takes OOP to the extreme (for PHP anyway). Â Everything has
>> abstract classes, interfaces and the like.
>>
>> CI is good from a lightweight, gives you something to build on perspective.
>>
>> I however prefer CakePHP. Â Its been around for a while, it can
>> automatically build an app from just a well designed database and
>> doesn't require configuration files in XML, YAML or what have you. Â The
>> documentation is OK and could be much better.
>>
>> It really depends on what you want out of the framework. Â I would
>> suggest going through the CakePHP and CI tutorials and seeing which one
>> seems like a good fit for you.
>
> I use a combination of Zend Framework (Soap and Config), PEAR (for
> Console_CommandLine) and my own code developed along the lines of Zend
> Framework.
>
> I think the "What framework is best" question can be partially
> answered by asking which framework allow you the greatest degree of
> flexibility.
>
> I don't have to use any part of Zend that I don't want. Same with PEAR.
>
> Having said that, none of these frameworks will write your app for
> you. Others may, based upon various rules or file structures.
>
>
>


-- 
Extra details:
OSS:Gentoo Linux
profile:x86
Hardware:msi geforce 8600GT asus p5k-se
location:/home/muhsin
language(s):C/C++,PHP,SQL,HTML
Typo:40WPM
url:http://www.mzalendo.net
url:http://www.zanbytes.com




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



Re: [PHP] Re: PHP frameworks

2011-07-22 Thread Richard Quadling
On 21 July 2011 23:56, Shawn McKenzie  wrote:
> On 07/21/2011 03:59 PM, Chris Stinemetz wrote:
>> Hello all,
>>
>> I am thinking about venturing into PHP frameworks, but I would like to
>> get advice on what the correct selection would be for someone that is
>> about intermediate in PHP knowledge.
>>
>> Thank you,
>
> So, with your post you will probably get one or more replies suggesting
> every one of the popular frameworks and then several that suggest some
> lesser known ones.
>
> I think Zend looks great, but for many people (including me) it is
> overly complex and cumbersome.  It is a very professional and
> standardised class library, but has no "glue" to put it all together for
> you. Also, it takes OOP to the extreme (for PHP anyway).  Everything has
> abstract classes, interfaces and the like.
>
> CI is good from a lightweight, gives you something to build on perspective.
>
> I however prefer CakePHP.  Its been around for a while, it can
> automatically build an app from just a well designed database and
> doesn't require configuration files in XML, YAML or what have you.  The
> documentation is OK and could be much better.
>
> It really depends on what you want out of the framework.  I would
> suggest going through the CakePHP and CI tutorials and seeing which one
> seems like a good fit for you.


I use a combination of Zend Framework (Soap and Config), PEAR (for
Console_CommandLine) and my own code developed along the lines of Zend
Framework.

I think the "What framework is best" question can be partially
answered by asking which framework allow you the greatest degree of
flexibility.

I don't have to use any part of Zend that I don't want. Same with PEAR.

Having said that, none of these frameworks will write your app for
you. Others may, based upon various rules or file structures.



-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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



Re: [PHP] Re: PHP frameworks

2011-07-21 Thread Micky Hulse
On Thu, Jul 21, 2011 at 6:44 PM, Shawn McKenzie  wrote:
> A la CakePHP.  Will automagically build controllers and views for the
> admin of your tables/models if you wish.

Oooh, interesting! I will check out CakePHP! Thanks for tip! :)

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



Re: [PHP] Re: PHP frameworks

2011-07-21 Thread Shawn McKenzie
On 07/21/2011 07:44 PM, Micky Hulse wrote:
> On Thu, Jul 21, 2011 at 5:33 PM, Micky Hulse  wrote:
>> Your app models?
> 
> More specifically, your app model data. :)

A la CakePHP.  Will automagically build controllers and views for the
admin of your tables/models if you wish.

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Re: PHP frameworks

2011-07-21 Thread Micky Hulse
On Thu, Jul 21, 2011 at 5:33 PM, Micky Hulse  wrote:
> Your app models?

More specifically, your app model data. :)

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



Re: [PHP] Re: PHP frameworks

2011-07-21 Thread Micky Hulse
On Thu, Jul 21, 2011 at 5:21 PM, Jim Lucas  wrote:
> So, what would said admin interface allow you to administrate?

Your app models?

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



Re: [PHP] Re: PHP frameworks

2011-07-21 Thread Jim Lucas
On 7/21/2011 4:00 PM, Micky Hulse wrote:
> +1 for CI.
> 
> If you search the group archives, a little while back I asked about
> micro PHP frameworks and got a ton of good replies.
> 
> So folks, how'z about a PHP framework with a built-in admin interface?
> That would be pretty sweet. :)
> 

So, what would said admin interface allow you to administrate?

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



Re: [PHP] Re: PHP frameworks

2011-07-21 Thread Micky Hulse
+1 for CI.

If you search the group archives, a little while back I asked about
micro PHP frameworks and got a ton of good replies.

So folks, how'z about a PHP framework with a built-in admin interface?
That would be pretty sweet. :)

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



[PHP] Re: [PHP-DB] Re: [PHP] Re: [PHP-DB] Re: [PHP] Re: [PHP-DB] Re: [PHP] PHP EOL

2011-07-04 Thread Karl DeSaulniers

@Stuart
Ah, then you are right that they were not compliant. The code is not  
that old.
Thank you so much for the links and information too. Much more than I  
expected.
I did not know that they were sent OS-Independent, but that makes  
perfect sense.

Again, please excuse my lack of understanding.
My thought on why I would still use the code was that even though the  
SMTP server
would not be OS specific, the email program or browser would be and  
that it would format

for the user depending on that program/browser and the OS it runs on.
IE: Thunderbird on PC or Mac Mail; viewing yahoo on Safari Mac or IE  
on PC.


Technically speaking, is it not possible to determine with a if {} to  
see which catches?
This is probably not the best way to go about formating, just more  
for my intuit.
With that code, I did not get any bounce backs or messages pertaining  
to ill formatting or "no send no show".

So it didn't seem to be a bad code. Thus I continued use.
But like what was said earlier in the thread, I agree PHP_EOL would  
be the best fit.


Thank you for all your input, help and resources.

Best,
Karl

On Jul 4, 2011, at 2:01 AM, Stuart Dallas wrote:

On Mon, Jul 4, 2011 at 7:11 AM, Karl DeSaulniers  
wrote:



Hello Stuart,
After some closer look at the RFC Compliant manuals you suggested,
I have determined that the creator of that code was in fact RFC821
Compliant.
Being that this was a code I found several years ago, RFC822 may  
not have

been in effect.
This being the reason (I believe) that the creator went with a  
check for

System OS when determining the end of line characters to use.
Not substantiated in any way, but that is what it looks like to  
me. I could

stand corrected.



RFC821: Simple Mail Transfer Protocol, dated August 1982 (
http://www.faqs.org/rfcs/rfc821.html)

RFC822: Standard for the Format of ARPA Internet Text Messages,  
dated August

13, 1982 (http://www.faqs.org/rfcs/rfc822.html)

So, unless you started using that code before PHP was created (1995  
if we go

back as far as PHP/FI) then no, RFC822 predates that snippet of code.

Further, RFC821 defines the end of lines as CRLF, so the creator of  
that
code was not RFC821 compliant if it was being used to send commands  
to an

SMTP server.

From RFC821, MAIL FROM command definition: MAIL  FROM:path>



From RFC822, general header field definition: field = field-name ":" [
field-body ] CRLF

Note the CRLF at the end of both definitions.

Now, technically speaking the body of email messages can use any line
endings they want to, but the headers should use CRLF, and commands  
sent to

servers should also use CRLF.

One final thing for you to consider... what we've been talking  
about is
commands and messages being sent to other computers, so what good  
does it do
to send them in a format that's dependent on the OS of the sending  
machine?
The standards exist so they are OS-independant, because you usually  
cannot

tell what OS the computer you're talking to is running.

-Stuart

--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


Karl DeSaulniers
Design Drumm
http://designdrumm.com


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



Re: [PHP] Re: [PHP-DB] Re: [PHP] Re: [PHP-DB] Re: [PHP] PHP EOL

2011-07-04 Thread Stuart Dallas
On Mon, Jul 4, 2011 at 7:11 AM, Karl DeSaulniers wrote:

> Hello Stuart,
> After some closer look at the RFC Compliant manuals you suggested,
> I have determined that the creator of that code was in fact RFC821
> Compliant.
> Being that this was a code I found several years ago, RFC822 may not have
> been in effect.
> This being the reason (I believe) that the creator went with a check for
> System OS when determining the end of line characters to use.
> Not substantiated in any way, but that is what it looks like to me. I could
> stand corrected.
>

RFC821: Simple Mail Transfer Protocol, dated August 1982 (
http://www.faqs.org/rfcs/rfc821.html)

RFC822: Standard for the Format of ARPA Internet Text Messages, dated August
13, 1982 (http://www.faqs.org/rfcs/rfc822.html)

So, unless you started using that code before PHP was created (1995 if we go
back as far as PHP/FI) then no, RFC822 predates that snippet of code.

Further, RFC821 defines the end of lines as CRLF, so the creator of that
code was not RFC821 compliant if it was being used to send commands to an
SMTP server.

>From RFC821, MAIL FROM command definition: MAIL  FROM:


>From RFC822, general header field definition: field = field-name ":" [
field-body ] CRLF

Note the CRLF at the end of both definitions.

Now, technically speaking the body of email messages can use any line
endings they want to, but the headers should use CRLF, and commands sent to
servers should also use CRLF.

One final thing for you to consider... what we've been talking about is
commands and messages being sent to other computers, so what good does it do
to send them in a format that's dependent on the OS of the sending machine?
The standards exist so they are OS-independant, because you usually cannot
tell what OS the computer you're talking to is running.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


[PHP] Re: [PHP-DB] Re: [PHP] Re: [PHP-DB] Re: [PHP] PHP EOL

2011-07-03 Thread Karl DeSaulniers

Hello Stuart,
After some closer look at the RFC Compliant manuals you suggested,
I have determined that the creator of that code was in fact RFC821  
Compliant.
Being that this was a code I found several years ago, RFC822 may not  
have been in effect.
This being the reason (I believe) that the creator went with a check  
for System OS when determining the end of line characters to use.
Not substantiated in any way, but that is what it looks like to me. I  
could stand corrected.


Best,
Karl


On Jul 3, 2011, at 6:11 PM, Karl DeSaulniers wrote:


I see. Yes, I was referring to the PHP manual.
I will investigate the RFC manuals as well like you had noted.
No offense taken. Thank you for the clarification.

Best,
Karl


On Jul 3, 2011, at 6:07 PM, Stuart Dallas wrote:

On Sun, Jul 3, 2011 at 11:22 PM, Karl DeSaulniers  
 wrote:

@Stuart,
Actually that is what made me look into the PHP_EOL Stuart.  
Wanting to do things right.
Did you not read my initial email? I am not suggesting anyone  
adopt my code.
The question was directed to what the differences are so I COULD  
learn the right way.
Being that this was something I got off a tutorial from an  
accredited website, your saying that to the wrong person.
I went and read the manuals and am here now posting the question  
so as to get the right direction.
I have heard the argument and actually agreed. It would be better  
to use the PHP_EOL instead.
I have been directed in the right direction. So I will be changing  
my code to reflect.


I meant no offence, I was simply responding to your comment:   
"Also, It has worked for years with no problem and I would still  
use it" ...and took it to mean you would have no issue with using  
that code, so I thought it worth pointing out that the standards  
exist for a reason.


In the name of clarification, the "manual" I was referring to is  
the sum total of the RFCs that define the various protocols used  
on the internet, not the PHP manual which I believe you think I  
meant.


-Stuart

--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


Karl DeSaulniers
Design Drumm
http://designdrumm.com



Karl DeSaulniers
Design Drumm
http://designdrumm.com


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



Re: [PHP] Re: [PHP-DB] Re: [PHP] PHP EOL

2011-07-03 Thread Karl DeSaulniers

I see. Yes, I was referring to the PHP manual.
I will investigate the RFC manuals as well like you had noted.
No offense taken. Thank you for the clarification.

Best,
Karl


On Jul 3, 2011, at 6:07 PM, Stuart Dallas wrote:

On Sun, Jul 3, 2011 at 11:22 PM, Karl DeSaulniers  
 wrote:

@Stuart,
Actually that is what made me look into the PHP_EOL Stuart. Wanting  
to do things right.
Did you not read my initial email? I am not suggesting anyone adopt  
my code.
The question was directed to what the differences are so I COULD  
learn the right way.
Being that this was something I got off a tutorial from an  
accredited website, your saying that to the wrong person.
I went and read the manuals and am here now posting the question so  
as to get the right direction.
I have heard the argument and actually agreed. It would be better  
to use the PHP_EOL instead.
I have been directed in the right direction. So I will be changing  
my code to reflect.


I meant no offence, I was simply responding to your comment:   
"Also, It has worked for years with no problem and I would still  
use it" ...and took it to mean you would have no issue with using  
that code, so I thought it worth pointing out that the standards  
exist for a reason.


In the name of clarification, the "manual" I was referring to is  
the sum total of the RFCs that define the various protocols used on  
the internet, not the PHP manual which I believe you think I meant.


-Stuart

--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


Karl DeSaulniers
Design Drumm
http://designdrumm.com



Re: [PHP] Re: [PHP-DB] Re: [PHP] PHP EOL

2011-07-03 Thread Stuart Dallas
On Sun, Jul 3, 2011 at 11:22 PM, Karl DeSaulniers wrote:

> @Stuart,
> Actually that is what made me look into the PHP_EOL Stuart. Wanting to do
> things right.
> Did you not read my initial email? I am not suggesting anyone adopt my
> code.
> The question was directed to what the differences are so I COULD learn the
> right way.
> Being that this was something I got off a tutorial from an accredited
> website, your saying that to the wrong person.
> I went and read the manuals and am here now posting the question so as to
> get the right direction.
> I have heard the argument and actually agreed. It would be better to use
> the PHP_EOL instead.
> I have been directed in the right direction. So I will be changing my code
> to reflect.
>

I meant no offence, I was simply responding to your comment:  "Also, It has
worked for years with no problem and I would still use it" ...and took it to
mean you would have no issue with using that code, so I thought it worth
pointing out that the standards exist for a reason.

In the name of clarification, the "manual" I was referring to is the sum
total of the RFCs that define the various protocols used on the internet,
not the PHP manual which I believe you think I meant.

-Stuart

-- 
Stuart Dallas
3ft9 Ltd
http://3ft9.com/


Re: [PHP] Re: [PHP-DB] Re: radio form submission

2011-07-01 Thread Tamara Temple

There must some place for this one: http://xkcd.com/231/

Maybe something near the mailing lists info


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



Re: [PHP] Re: [PHP-DB] Re: radio form submission

2011-06-29 Thread Richard Quadling
On 29 June 2011 08:37, Tamara Temple  wrote:
>
> On Jun 27, 2011, at 7:18 AM, Steve Staples wrote:
>
>> On Sat, 2011-06-25 at 16:11 -0500, Tamara Temple wrote:
>>>
>>> On Jun 24, 2011, at 1:35 PM, Richard Quadling wrote:

 On 24 June 2011 18:23, Tamara Temple  wrote:
>
> On Jun 24, 2011, at 10:28 AM, Richard Quadling wrote:
>>
>> On 24 June 2011 15:44, Vitalii Demianets 
>> wrote:
>>>
>>> And furthermore, I think Carthage must be destroyed.
>
> Let's haul out the PHP war wagons!
>>
>> http://xkcd.com/327/
>
> I so wanted to rename my daughter "Little Chelsea Tables" after I
> read that one. Randall is one mean mofo.

 And because it is so relevant, I added it to the docs...

 http://docs.php.net/manual/en/security.database.sql-injection.php
>>>
>>> Well played, sir, well played. I think we should go through all the
>>> xkcd comics that relate to programming somehow and insert them in the
>>> php.net documentation :)
>>>
>>>
>> Tamara, kind of like this one?
>>
>> http://ca3.php.net/manual/en/control-structures.goto.php
>>
>> I love that comic :)
>>
>
> Yes, exactly like that one. Between Richard's gambit and that GOTO comic is
> what gave me the idea! :)
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

http://xkcd.com/376/ for
http://docs.php.net/manual/en/function.date.php#refsect1-function.date-changelog

maybe.



-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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



Re: [PHP] Re: [PHP-DB] Re: radio form submission

2011-06-29 Thread Tamara Temple


On Jun 27, 2011, at 7:18 AM, Steve Staples wrote:


On Sat, 2011-06-25 at 16:11 -0500, Tamara Temple wrote:

On Jun 24, 2011, at 1:35 PM, Richard Quadling wrote:
On 24 June 2011 18:23, Tamara Temple   
wrote:

On Jun 24, 2011, at 10:28 AM, Richard Quadling wrote:

On 24 June 2011 15:44, Vitalii Demianets 
wrote:

And furthermore, I think Carthage must be destroyed.

Let's haul out the PHP war wagons!

http://xkcd.com/327/

I so wanted to rename my daughter "Little Chelsea Tables" after I
read that one. Randall is one mean mofo.


And because it is so relevant, I added it to the docs...

http://docs.php.net/manual/en/security.database.sql-injection.php


Well played, sir, well played. I think we should go through all the
xkcd comics that relate to programming somehow and insert them in the
php.net documentation :)



Tamara, kind of like this one?

http://ca3.php.net/manual/en/control-structures.goto.php

I love that comic :)



Yes, exactly like that one. Between Richard's gambit and that GOTO  
comic is what gave me the idea! :)




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



Re: [PHP] Re: Php filter validate url

2011-06-27 Thread Plamen Ivanov
On Mon, Jun 27, 2011 at 11:34 AM, Jim Lucas  wrote:
> On 6/27/2011 8:25 AM, Plamen Ivanov wrote:
>> On Mon, Jun 27, 2011 at 11:14 AM, Shawn McKenzie  
>> wrote:
>>> On 06/27/2011 10:01 AM, Plamen Ivanov wrote:
 On Sun, Jun 26, 2011 at 5:44 PM, Shawn McKenzie  
 wrote:
>
> On 06/26/2011 12:31 PM, Adam Tong wrote:
>> Hi,
>>
>> I wanted tu use php filters for validation to avoid regular expresions.
>> Is it possible that FILTER_VALIDATE_URL only checks if the string has
>> http:// and do not check for the format domain.something?
>> 
>> $url = 'http://wwwtestcom';
>> $url = filter_var($url,FILTER_VALIDATE_URL);
>> echo $url;
>> -
>>
>> Or I am doing something wrong
>>
>> Thank you
>
> Unless I'm totally misunderstanding what you want (validate that a
> string starts with http://) try:
>
> if(strpos($url, 'http://') === 0) {
>   //starts with http://
> } esle {
>   // does not start with http://
> }
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

 Another possible solution could be:

 $ary = explode('://', $url);
 if (1 >= count($ary)) {
     echo 'No schema specified!';
 } else {
     // Schema specified.
     // $ary[0] is the protocol
     $allowed = array('http', 'https');
     if (FALSE == in_array($ary[0], $allowed) {
         // Protocol not valid!
         exit(1); // or return FALSE; whatever...
     }
     // $ary[1] is the uri, validate with filter_var().
 }

 Hope this helps.
>>>
>>> May make more sense to use parse_url() than explode.
>>>
>>> --
>>> Thanks!
>>> -Shawn
>>> http://www.spidean.com
>>>
>>
>> http://php.net/manual/en/function.parse-url.php
>> "This function is not meant to validate the given URL..."
>>
>> I would use parse_url() after URL validation.
>>
>
> Shawn meant to use parse_url() in place of your explode statement.  He didn't
> say to use parse_url() as a method to validate the url.
>
> He said it would make more sense to do the following.
>
> Also, use strict type matching if you want to compare against boolean(FALSE)
>
> $allowed = array('http', 'https');
>
> $scheme = parse_url($url, PHP_URL_SCHEME);
>
> if (FALSE === in_array($scheme, $allowed) {
>  // Protocol not valid!
>  exit(1); // or return FALSE; whatever...
> }
>
> Seems a little less muddy to me.
>
> Jim Lucas
>

Makes sense now.

Thanks guys.

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



Re: [PHP] Re: Php filter validate url

2011-06-27 Thread Jim Lucas
On 6/27/2011 8:25 AM, Plamen Ivanov wrote:
> On Mon, Jun 27, 2011 at 11:14 AM, Shawn McKenzie  wrote:
>> On 06/27/2011 10:01 AM, Plamen Ivanov wrote:
>>> On Sun, Jun 26, 2011 at 5:44 PM, Shawn McKenzie  
>>> wrote:

 On 06/26/2011 12:31 PM, Adam Tong wrote:
> Hi,
>
> I wanted tu use php filters for validation to avoid regular expresions.
> Is it possible that FILTER_VALIDATE_URL only checks if the string has
> http:// and do not check for the format domain.something?
> 
> $url = 'http://wwwtestcom';
> $url = filter_var($url,FILTER_VALIDATE_URL);
> echo $url;
> -
>
> Or I am doing something wrong
>
> Thank you

 Unless I'm totally misunderstanding what you want (validate that a
 string starts with http://) try:

 if(strpos($url, 'http://') === 0) {
   //starts with http://
 } esle {
   // does not start with http://
 }

 --
 Thanks!
 -Shawn
 http://www.spidean.com

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

>>>
>>> Another possible solution could be:
>>>
>>> $ary = explode('://', $url);
>>> if (1 >= count($ary)) {
>>> echo 'No schema specified!';
>>> } else {
>>> // Schema specified.
>>> // $ary[0] is the protocol
>>> $allowed = array('http', 'https');
>>> if (FALSE == in_array($ary[0], $allowed) {
>>> // Protocol not valid!
>>> exit(1); // or return FALSE; whatever...
>>> }
>>> // $ary[1] is the uri, validate with filter_var().
>>> }
>>>
>>> Hope this helps.
>>
>> May make more sense to use parse_url() than explode.
>>
>> --
>> Thanks!
>> -Shawn
>> http://www.spidean.com
>>
> 
> http://php.net/manual/en/function.parse-url.php
> "This function is not meant to validate the given URL..."
> 
> I would use parse_url() after URL validation.
> 

Shawn meant to use parse_url() in place of your explode statement.  He didn't
say to use parse_url() as a method to validate the url.

He said it would make more sense to do the following.

Also, use strict type matching if you want to compare against boolean(FALSE)

$allowed = array('http', 'https');

$scheme = parse_url($url, PHP_URL_SCHEME);

if (FALSE === in_array($scheme, $allowed) {
  // Protocol not valid!
  exit(1); // or return FALSE; whatever...
}

Seems a little less muddy to me.

Jim Lucas

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



Re: [PHP] Re: Php filter validate url

2011-06-27 Thread Plamen Ivanov
On Mon, Jun 27, 2011 at 11:14 AM, Shawn McKenzie  wrote:
> On 06/27/2011 10:01 AM, Plamen Ivanov wrote:
>> On Sun, Jun 26, 2011 at 5:44 PM, Shawn McKenzie  wrote:
>>>
>>> On 06/26/2011 12:31 PM, Adam Tong wrote:
 Hi,

 I wanted tu use php filters for validation to avoid regular expresions.
 Is it possible that FILTER_VALIDATE_URL only checks if the string has
 http:// and do not check for the format domain.something?
 
 $url = 'http://wwwtestcom';
 $url = filter_var($url,FILTER_VALIDATE_URL);
 echo $url;
 -

 Or I am doing something wrong

 Thank you
>>>
>>> Unless I'm totally misunderstanding what you want (validate that a
>>> string starts with http://) try:
>>>
>>> if(strpos($url, 'http://') === 0) {
>>>   //starts with http://
>>> } esle {
>>>   // does not start with http://
>>> }
>>>
>>> --
>>> Thanks!
>>> -Shawn
>>> http://www.spidean.com
>>>
>>> --
>>> PHP General Mailing List (http://www.php.net/)
>>> To unsubscribe, visit: http://www.php.net/unsub.php
>>>
>>
>> Another possible solution could be:
>>
>> $ary = explode('://', $url);
>> if (1 >= count($ary)) {
>>     echo 'No schema specified!';
>> } else {
>>     // Schema specified.
>>     // $ary[0] is the protocol
>>     $allowed = array('http', 'https');
>>     if (FALSE == in_array($ary[0], $allowed) {
>>         // Protocol not valid!
>>         exit(1); // or return FALSE; whatever...
>>     }
>>     // $ary[1] is the uri, validate with filter_var().
>> }
>>
>> Hope this helps.
>
> May make more sense to use parse_url() than explode.
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>

http://php.net/manual/en/function.parse-url.php
"This function is not meant to validate the given URL..."

I would use parse_url() after URL validation.

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



Re: [PHP] Re: Php filter validate url

2011-06-27 Thread Shawn McKenzie
On 06/27/2011 10:01 AM, Plamen Ivanov wrote:
> On Sun, Jun 26, 2011 at 5:44 PM, Shawn McKenzie  wrote:
>>
>> On 06/26/2011 12:31 PM, Adam Tong wrote:
>>> Hi,
>>>
>>> I wanted tu use php filters for validation to avoid regular expresions.
>>> Is it possible that FILTER_VALIDATE_URL only checks if the string has
>>> http:// and do not check for the format domain.something?
>>> 
>>> $url = 'http://wwwtestcom';
>>> $url = filter_var($url,FILTER_VALIDATE_URL);
>>> echo $url;
>>> -
>>>
>>> Or I am doing something wrong
>>>
>>> Thank you
>>
>> Unless I'm totally misunderstanding what you want (validate that a
>> string starts with http://) try:
>>
>> if(strpos($url, 'http://') === 0) {
>>   //starts with http://
>> } esle {
>>   // does not start with http://
>> }
>>
>> --
>> Thanks!
>> -Shawn
>> http://www.spidean.com
>>
>> --
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>
> 
> Another possible solution could be:
> 
> $ary = explode('://', $url);
> if (1 >= count($ary)) {
> echo 'No schema specified!';
> } else {
> // Schema specified.
> // $ary[0] is the protocol
> $allowed = array('http', 'https');
> if (FALSE == in_array($ary[0], $allowed) {
> // Protocol not valid!
> exit(1); // or return FALSE; whatever...
> }
> // $ary[1] is the uri, validate with filter_var().
> }
> 
> Hope this helps.

May make more sense to use parse_url() than explode.

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Re: Php filter validate url

2011-06-27 Thread Plamen Ivanov
On Sun, Jun 26, 2011 at 5:44 PM, Shawn McKenzie  wrote:
>
> On 06/26/2011 12:31 PM, Adam Tong wrote:
> > Hi,
> >
> > I wanted tu use php filters for validation to avoid regular expresions.
> > Is it possible that FILTER_VALIDATE_URL only checks if the string has
> > http:// and do not check for the format domain.something?
> > 
> > $url = 'http://wwwtestcom';
> > $url = filter_var($url,FILTER_VALIDATE_URL);
> > echo $url;
> > -
> >
> > Or I am doing something wrong
> >
> > Thank you
>
> Unless I'm totally misunderstanding what you want (validate that a
> string starts with http://) try:
>
> if(strpos($url, 'http://') === 0) {
>   //starts with http://
> } esle {
>   // does not start with http://
> }
>
> --
> Thanks!
> -Shawn
> http://www.spidean.com
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

Another possible solution could be:

$ary = explode('://', $url);
if (1 >= count($ary)) {
    echo 'No schema specified!';
} else {
    // Schema specified.
    // $ary[0] is the protocol
$allowed = array('http', 'https');
if (FALSE == in_array($ary[0], $allowed) {
// Protocol not valid!
exit(1); // or return FALSE; whatever...
}
    // $ary[1] is the uri, validate with filter_var().
}

Hope this helps.

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



Re: Re: [PHP] Re: [PHP-DB] Re: radio form submission

2011-06-27 Thread Tim Streater
On 27 Jun 2011 at 13:18, Steve Staples  wrote: 

> On Sat, 2011-06-25 at 16:11 -0500, Tamara Temple wrote:

>> Well played, sir, well played. I think we should go through all the
>> xkcd comics that relate to programming somehow and insert them in the
>> php.net documentation :)
>>
>>
> Tamara, kind of like this one?
>
> http://ca3.php.net/manual/en/control-structures.goto.php

I haven't used a goto since I stopped writing FORTRAN in 1978.

--
Cheers  --  Tim

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

Re: [PHP] Re: [PHP-DB] Re: radio form submission

2011-06-27 Thread Steve Staples
On Sat, 2011-06-25 at 16:11 -0500, Tamara Temple wrote:
> On Jun 24, 2011, at 1:35 PM, Richard Quadling wrote:
> > On 24 June 2011 18:23, Tamara Temple  wrote:
> >> On Jun 24, 2011, at 10:28 AM, Richard Quadling wrote:
> >>> On 24 June 2011 15:44, Vitalii Demianets   
> >>> wrote:
>  And furthermore, I think Carthage must be destroyed.
> >> Let's haul out the PHP war wagons!
> >>> http://xkcd.com/327/
> >> I so wanted to rename my daughter "Little Chelsea Tables" after I  
> >> read that one. Randall is one mean mofo.
> >
> > And because it is so relevant, I added it to the docs...
> >
> > http://docs.php.net/manual/en/security.database.sql-injection.php
> 
> Well played, sir, well played. I think we should go through all the  
> xkcd comics that relate to programming somehow and insert them in the  
> php.net documentation :)
> 
> 
Tamara, kind of like this one?

http://ca3.php.net/manual/en/control-structures.goto.php

I love that comic :)

Steve.


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



Re: [PHP] Re: [PHP-DB] Re: radio form submission

2011-06-27 Thread Richard Quadling
On 25 June 2011 22:11, Tamara Temple  wrote:
> On Jun 24, 2011, at 1:35 PM, Richard Quadling wrote:
>>
>> On 24 June 2011 18:23, Tamara Temple  wrote:
>>>
>>> On Jun 24, 2011, at 10:28 AM, Richard Quadling wrote:

 On 24 June 2011 15:44, Vitalii Demianets 
 wrote:
>
> And furthermore, I think Carthage must be destroyed.
>>>
>>> Let's haul out the PHP war wagons!

 http://xkcd.com/327/
>>>
>>> I so wanted to rename my daughter "Little Chelsea Tables" after I read
>>> that one. Randall is one mean mofo.
>>
>> And because it is so relevant, I added it to the docs...
>>
>> http://docs.php.net/manual/en/security.database.sql-injection.php
>
> Well played, sir, well played. I think we should go through all the xkcd
> comics that relate to programming somehow and insert them in the php.net
> documentation :)

If you find them, ...

-- 
Richard Quadling
Twitter : EE : Zend : PHPDoc
@RQuadling : e-e.com/M_248814.html : bit.ly/9O8vFY : bit.ly/lFnVea

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



Re: [PHP] Re: Php filter validate url

2011-06-27 Thread Tim Streater
On 27 Jun 2011 at 00:15, Richard Riley  wrote: 

> In addition your content type in your post is incorrect.
>
> Your header contains
>
> Content-Type: multipart/alternative;
> boundary=00151747b53cf2927204a6a46ebb
>
> But its not multipart. This happens a lot in this group and I dont
> experience it elsewhere so I dont know if its a "php programmer thing",
> an gmane artifact or something the mailing list does.

I couldn't see anything in RFC2046, section 5.1.4, to suggest that 
multipart/alternative *requires* that there be more than one part. And why does 
it matter, anyway?

--
Cheers  --  Tim

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

Re: [PHP] Re: Php filter validate url

2011-06-26 Thread Shawn McKenzie
On 06/26/2011 04:50 PM, Fatih P. wrote:
> Guys, when you reply a mail, You should write your reply on the top of it,
> not at the bottom of it.
> makes it easier to follow.
> 

Ready flame-throwers!

-- 
Thanks!
-Shawn
http://www.spidean.com

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



Re: [PHP] Re: Php filter validate url

2011-06-26 Thread Fatih P.
On Mon, Jun 27, 2011 at 1:15 AM, Richard Riley wrote:

>
> In mailing lists and usenet you should never top post. You integrate
> your reply or "follow up".  This is well documented and makes sense in
> tech threads were context is everything.
>
> In adidition your content type in your post is incorrect.
>
> Your header contains
>
> Content-Type: multipart/alternative;
> boundary=00151747b53cf2927204a6a46ebb
>
> But its not multipart. This happens a lot in this group and I dont
> experience it elsewhere so I dont know if its a "php programmer thing",
> an gmane artifact or something the mailing list does.
>
>
>
> "Fatih P."  writes:
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

headers are set and sent by gmail itself

Content-Type: multipart/alternative;
boundary=00151747b53cf2927204a6a46ebb


  1   2   3   4   5   6   7   8   9   10   >