php-general Digest 17 Jun 2010 09:51:26 -0000 Issue 6803

Topics (messages 306214 through 306218):

Re: Another parse problem
        306214 by: Daniel P. Brown
        306216 by: Robert Cummings
        306217 by: Daniel Brown

Re: User's IP Validation
        306215 by: Ashley Sheridan

Unit testing in PHP
        306218 by: vikash.iitb.gmail.com

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
On Wed, Jun 16, 2010 at 15:52, Robert Cummings <rob...@interjinn.com> wrote:
>
> Additionally, extracting top level domains is not so simple since it may
> have 2 or more parts.

    *Gasp!*  The Great Cummings is.... incorrect.

    /me faints.

    Actually, ccTLD's are just the very last group of letters.  For
example, .il, .uk, and .br.  However, the ICANN, registrar policies,
or sponsorship requirements for some of them require the use of an SLD
as well.  For example, .co.il, .org.uk, and .com.br, respectively.
Some ccTLDs offer the SLD options, but don't require them.  For
example, you can register .co.in, .firm.in, .gen.in, or any other
available SLD+ccTLD, or just the ccTLD .in itself.

    Still others have no such requirement or even official SLD
endorsements, such as good ol' Canada (Land of Clan Cummings),
Ireland, and here in the US.

-- 
</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!

--- End Message ---
--- Begin Message ---
Daniel P. Brown wrote:
On Wed, Jun 16, 2010 at 15:52, Robert Cummings <rob...@interjinn.com> wrote:
Additionally, extracting top level domains is not so simple since it may
have 2 or more parts.

    *Gasp!*  The Great Cummings is.... incorrect.

    /me faints.

    Actually, ccTLD's are just the very last group of letters.  For
example, .il, .uk, and .br.  However, the ICANN, registrar policies,
or sponsorship requirements for some of them require the use of an SLD
as well.  For example, .co.il, .org.uk, and .com.br, respectively.
Some ccTLDs offer the SLD options, but don't require them.  For
example, you can register .co.in, .firm.in, .gen.in, or any other
available SLD+ccTLD, or just the ccTLD .in itself.

    Still others have no such requirement or even official SLD
endorsements, such as good ol' Canada (Land of Clan Cummings),
Ireland, and here in the US.

Hahah, I can't be right all the time :D I didn't mean to use TLD, I meant to use domain name, but not including sub-domained names :) I don't even know what that is rightly called to exclude sub-domains. Anyways, those, by virtue of your above description can have two or more parts and there's not a simple way to extract that part without also extracting the sub-domain portions.

Cheers,
Rob.
--
E-Mail Disclaimer: Information contained in this message and any
attached documents is considered confidential and legally protected.
This message is intended solely for the addressee(s). Disclosure,
copying, and distribution are prohibited unless authorized.

--- End Message ---
--- Begin Message ---
On Wed, Jun 16, 2010 at 21:42, Robert Cummings <rob...@interjinn.com> wrote:
[snip!]
> Anyways, those, by
> virtue of your above description can have two or more parts and there's not
> a simple way to extract that part without also extracting the sub-domain
> portions.

    True.  Not without some static rules and logic, including
knowledge of which ccTLDs have required or potential country-wide
SLDs.  Though I think the solutions provided by yourself, Shawn, and
myself would suffice for most situations.  I'm hoping Tedd will share
his as well.

-- 
</Daniel P. Brown>
daniel.br...@parasane.net || danbr...@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
We now offer SAME-DAY SETUP on a new line of servers!

--- End Message ---
--- Begin Message ---
On Wed, 2010-06-16 at 20:36 +0200, David Cesal wrote:

> Please, don't forget IP address can be same for many users. I see only way 
> with cookies. When user deletes cookies, form pops up again. I don't know any 
> better way.
> 
> David
> 
> Sent from my HTC
> 
> -----Original Message-----
> From: Juan Rodriguez Monti <j...@rodriguezmonti.com.ar>
> Sent: 16. cervna 2010 20:26
> To: php-gene...@lists.php.net
> Subject: [PHP] User's IP Validation
> 
> Hi people,
> I would like to know the best way to perform some kind of validation
> for an application that I've written.
> 
> I have a system that ask through an HTML Form some questions to users.
> I use some cookies to save some information from the user side.
> 
> However, I would like to implement some code in PHP that would let me
> limit to 1 the number of times that the page with the questions was
> executed.
> 
> I mean, the user fills the HTML's Form, then send it through an HTML
> Button, then PHP receives this informations and send an Email
> containing the replies to the questions. I would like to limit to one,
> the times one single user is able to execute this form.
> 
> I thought getting the IP Address, then doing some kind of validation
> with it. However I don't know if using cookies is the best idea. I
> don't have access to a DataBase for this. So I thought might be a good
> idea write to a file in the server the IP, then perform some if to
> know if the user already replied the form.
> 
> As far as I don't know which is the best way to code this, I felt free
> to ask you guys.
> 
> Thanks a lot.
> 
> Juan
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 


Like others have said, unless you have specific user logins, there's no
way to prevent people from viewing the form more than once. As you are
emailing them the answers, I assume there is some form of login system
being used, so you could use that, with some sort of flag to indicate
the email has been sent. If you want to future-proof the system, you
could use some sort of binary bit flag to indicate what forms they've
been sent answers to, for example:

0 - no answers have been sent
1 - only the first set of answers
4 - the 3rd set of answers only
5 - the 3rd and 1st set of answers

etc. This would allow you to use one field to hold sent info on as many
forms as you need.

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



--- End Message ---
--- Begin Message ---
Hi,

What do you use for unit testing in PHP? phpUnit, SimpleTest or any other?

Thanks,
Vikash Kumar
--
http://vika.sh

--- End Message ---

Reply via email to