php-general Digest 27 Jun 2011 02:42:23 -0000 Issue 7377
Topics (messages 313723 through 313741):
Re: dropdown with two Sql query
313723 by: Tamara Temple
313724 by: Tamara Temple
313725 by: Ashley Sheridan
313738 by: Tamara Temple
Php filter validate url
313726 by: Adam Tong
313727 by: Shawn McKenzie
313728 by: Stuart Dallas
313729 by: Ashley Sheridan
313730 by: Stuart Dallas
313731 by: Shawn McKenzie
313732 by: Fatih P.
313733 by: Stuart Dallas
313734 by: Fatih P.
313735 by: Ashley Sheridan
313736 by: Richard Riley
313737 by: Fatih P.
313739 by: Shawn McKenzie
Re: Upgrade or Die?
313740 by: Eric Butera
asynchronous launch of a script
313741 by: Tamara Temple
Administrivia:
To subscribe to the digest, e-mail:
[email protected]
To unsubscribe from the digest, e-mail:
[email protected]
To post to the list, e-mail:
[email protected]
----------------------------------------------------------------------
--- Begin Message ---
On Jun 25, 2011, at 3:57 PM, asp kiddy wrote:
SELECT td.id_resultat,td.fld_email_id,email.fld_name_email
FROM $table_db td
JOIN $table_db_email email ON td.fld_email_id = email.id_email
WHERE td.id_resultat = $id
I see two small problems right away:
> FROM $table_db td
should read:
FROM $table_db AS td
and:
> JOIN $table_db_email email
should read
JOIN $table_db_email AS email
Maybe that's it?
--- End Message ---
--- Begin Message ---
On Jun 25, 2011, at 3:57 PM, asp kiddy wrote:
This code works also but I don't know how I can include this second
query in my menu...
I'm not exactly sure what you want it to do -- perhaps you could mock
up some sample output to show what you're expecting? If you are simply
planning on replacing the select statement in the first version, that
should be very straight-forward. If you are planning on having a
second set of select options, that shouldn't be too hard, either. If
you are wanting to somehow modify or mix the two selected set of
options, that may be a bit harder. Just not sure what you actually
want to do.
--- End Message ---
--- Begin Message ---
On Sun, 2011-06-26 at 10:29 -0500, Tamara Temple wrote:
> On Jun 25, 2011, at 3:57 PM, asp kiddy wrote:
>
> > SELECT td.id_resultat,td.fld_email_id,email.fld_name_email
> > FROM $table_db td
> > JOIN $table_db_email email ON td.fld_email_id = email.id_email
> > WHERE td.id_resultat = $id
>
> I see two small problems right away:
>
> > FROM $table_db td
>
> should read:
>
> FROM $table_db AS td
>
> and:
>
> > JOIN $table_db_email email
>
> should read
>
> JOIN $table_db_email AS email
>
> Maybe that's it?
>
>
>
I don't think that MySQL requires the 'AS' in that context, I write
queries like that without the 'AS' all the time.
--
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Jun 26, 2011, at 10:34 AM, Ashley Sheridan wrote:
I don't think that MySQL requires the 'AS' in that context, I write
queries like that without the 'AS' all the time.
This is what i get for trying to be coherent on 2 hours sleep....
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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
No, because http:// is not a URL, it's a scheme or protocol.
--
Thanks!
-Shawn
http://www.spidean.com
--- End Message ---
--- Begin Message ---
On Sunday, 26 June 2011 at 18:31, 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
As noted in the documentation (http://php.net/filter.filters.validate), URLs
are validated according to the format specified in RFC2396
(http://www.faqs.org/rfcs/rfc2396). It does not validate that it's an HTTP URL,
or that the hostname contains .s.
Thus, "http://wwwtestcom" is a perfectly valid URL, as is "banana://in.syrup",
and anything else that can be parsed as a URL according to the rules in the
above RFC.
If you need to check for a specific type of URL you'll need to implement your
own validation function, or google for one - there's loads out there.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--- End Message ---
--- Begin Message ---
On Sun, 2011-06-26 at 20:10 +0100, Stuart Dallas wrote:
> On Sunday, 26 June 2011 at 18:31, 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
>
> As noted in the documentation (http://php.net/filter.filters.validate), URLs
> are validated according to the format specified in RFC2396
> (http://www.faqs.org/rfcs/rfc2396). It does not validate that it's an HTTP
> URL, or that the hostname contains .s.
>
> Thus, "http://wwwtestcom" is a perfectly valid URL, as is
> "banana://in.syrup", and anything else that can be parsed as a URL according
> to the rules in the above RFC.
>
> If you need to check for a specific type of URL you'll need to implement your
> own validation function, or google for one - there's loads out there.
>
> -Stuart
>
> --
> Stuart Dallas
> 3ft9 Ltd
> http://3ft9.com/
>
>
I've not really read the spec, so excuse me if I'm very wrong, but
wouldn't that make it more of a URI syntax validator instead of a URL
syntax validator?
--
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
On Sunday, 26 June 2011 at 21:59, Ashley Sheridan wrote:
> On Sun, 2011-06-26 at 20:10 +0100, Stuart Dallas wrote:
> > On Sunday, 26 June 2011 at 18:31, 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 As noted in
> > the documentation (http://php.net/filter.filters.validate), URLs are
> > validated according to the format specified in RFC2396
> > (http://www.faqs.org/rfcs/rfc2396). It does not validate that it's an HTTP
> > URL, or that the hostname contains .s. Thus, "http://wwwtestcom" is a
> > perfectly valid URL, as is "banana://in.syrup", and anything else that can
> > be parsed as a URL according to the rules in the above RFC. If you need to
> > check for a specific type of URL you'll need to implement your own
> > validation function, or google for one - there's loads out there. -Stuart
> > -- S
tuart Dallas 3ft9 Ltd http://3ft9.com/
>
>
> I've not really read the spec, so excuse me if I'm very wrong, but wouldn't
> that make it more of a URI syntax validator instead of a URL syntax validator?
Yes, but the referenced RFC is titled "Uniform Resource Identifiers (URI):
Generic Syntax," so the only thing that's "wrong" is the FILTER_VALIDATE_URL
constant.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
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.
On Sun, Jun 26, 2011 at 11:44 PM, Shawn McKenzie <[email protected]>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
>
>
--- End Message ---
--- Begin Message ---
On Sunday, 26 June 2011 at 22:50, 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.
This is a holy war, and not worth getting into again. The bottom line is that
top posting breaks the rules, regardless of people's personal opinion of the
merits of any particular posting style.
http://php.net/reST/php-src/trunk_README.MAILINGLIST_RULES - item 3 near the
bottom of the page.
-Stuart
--
Stuart Dallas
3ft9 Ltd
http://3ft9.com/
--- End Message ---
--- Begin Message ---
well, anyway ignore it then
On Sun, Jun 26, 2011 at 11:57 PM, Stuart Dallas <[email protected]> wrote:
>
> On Sunday, 26 June 2011 at 22:50, 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.
> This is a holy war, and not worth getting into again. The bottom line is
> that top posting breaks the rules, regardless of people's personal opinion
> of the merits of any particular posting style.
>
> http://php.net/reST/php-src/trunk_README.MAILINGLIST_RULES - item 3 near
> the bottom of the page.
>
> -Stuart
>
> --
> Stuart Dallas
> 3ft9 Ltd
> http://3ft9.com/
>
--- End Message ---
--- Begin Message ---
On Mon, 2011-06-27 at 00:00 +0200, Fatih P. wrote:
> well, anyway ignore it then
>
> On Sun, Jun 26, 2011 at 11:57 PM, Stuart Dallas <[email protected]> wrote:
>
> >
> > On Sunday, 26 June 2011 at 22:50, 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.
> > This is a holy war, and not worth getting into again. The bottom line is
> > that top posting breaks the rules, regardless of people's personal opinion
> > of the merits of any particular posting style.
> >
> > http://php.net/reST/php-src/trunk_README.MAILINGLIST_RULES - item 3 near
> > the bottom of the page.
> >
> > -Stuart
> >
> > --
> > Stuart Dallas
> > 3ft9 Ltd
> > http://3ft9.com/
> >
No, the bottom-posting is a rule for this list. Don't like it, you don't
have to use the list.
--
Thanks,
Ash
http://www.ashleysheridan.co.uk
--- End Message ---
--- Begin Message ---
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." <[email protected]> writes:
--- End Message ---
--- Begin Message ---
On Mon, Jun 27, 2011 at 1:15 AM, Richard Riley <[email protected]>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." <[email protected]> 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
--- End Message ---
--- Begin Message ---
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
--- End Message ---
--- Begin Message ---
On Sat, Jun 25, 2011 at 12:13 AM, <[email protected]> wrote:
> The message for Netscape was very clear, the development community refused to
> write for it they had started a precedence that could not be forgotten.
> I say communities will not forget this act and remove the browser from their
> systems rather than be forced into an update for security reasons.
>
> Honestly, rarely do any of my customers use FF, and their reasons are
> justified in their mind, so I do not argue the point.
>
> This is another reason for security personnel, to credit their policies in
> denying FF on their network the same as they did with Netscape.
>
>
>
>
> Richard L. Buskirk
> Senior Software Engineer/Systems Administrator
>
> You can’t grow your business with systems that are on life support...
>
> -----Original Message-----
> From: Richard Quadling [mailto:[email protected]]
> Sent: Friday, June 24, 2011 5:38 PM
> To: [email protected]
> Cc: Andy McKenzie; [email protected]
> Subject: Re: [PHP] Upgrade or Die?
>
> On 24 June 2011 19:39, Ashley Sheridan <[email protected]> wrote:
>> On Fri, 2011-06-24 at 13:38 -0400, Andy McKenzie wrote:
>>
>>> On Fri, Jun 24, 2011 at 1:30 PM, <[email protected]> wrote:
>>> > Chrome. Enough said. Now, if we can only convince the rest of the world
>>> > ...
>>> >
>>>
>>> Ugh. I can't stand Chrome. Of course, I gave up on Firefox years ago
>>> and went back to Opera, so it doesn't bother me when Firefox does
>>> something weird like this...
>>>
>>> -Andy
>>>
>>
>>
>> Meh, I'm still using 3.6 on my main computer and 3.5 on my laptop. Using
>> Fx4 at work, and I have to say, I prefer 3.6. Fx4 is slower, prone to
>> crashing and a bit of a memory hog. I really hope Mozilla doesn't go the
>> way of Google and create loads of new versions dropping support for the
>> older ones as it goes, even if the 'older' versions are barely that old
>> at all.
>
> That pattern of behaviour sounds exactly like Netscape all those years ago.
>
>
>
> --
> 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
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
Just to throw my two pennies into this - I believe that all browsers
should auto-upgrade. The browser has become the most important
application on desktops and it is remiss of all parties involved to
allow the masses to use exploitable out-dated software. If someone is
paranoid about their supposed privacy, afford them the luxury of
finding ways to use software that has known defects. I entreat you to
consider how much time and pain this would have prevented over the
last decade.
--- End Message ---
--- Begin Message ---
How do I launch a php script from another running php script
asynchronously?
--- End Message ---