sildenafil billig cipro case in vendita kamagra wo kaufen sildenafil tabletten sildenafil costo cialis holland viagra bestellen cialis apotheek acquisto cialis 5 mg viagra online kaufen erfahrungen viagra preis preis viagra viagra kaufen usa viagra 25 mg rezeptfrei kamagra oral jelly per nachnahme generische viagra comprare finasteride apothekenpreis viagra propecia costo viagra aus holland finasteride 1 mg generico flagyl compresse 250 mg preisvergleich levitra compra viagra online cialis soft kaufen cialis rezeptpflicht cialis per nachnahme costo finasteride generika viagra cialis levitra kaufen ohne rezept tabletten cialis acquisto plavix lasix 500 mg cialis generika bestellen cialis wo kaufen billig viagra ratiopharm viagra rezeptfrei erfahrungsberichte viagra generico opinioni prezzo viagra 25 mg clomid 50 mg viagra billig bestellen kamagra pille 100mg viagra generika kamagra oral jelly günstig kamagra ohne rezept viagra pillenmaster tschechien viagra cialis generika ohne rezept viagra günstig bestellen clomid senza ricetta cialis generika erfahrungen cialis generika billig viagra online bestellen acquisto cialis original levitra rezeptfrei kamagra kautabletten test viagra original rezeptfrei viagra generico online viagra im internet bestellen strafbar viagra ohne rezept holland viagra verschreibungspflichtig levitra kopen viagra tabletten proscar 5 mg viagra kaufen berlin levitra online bestellen propecia generico in italia acquisto priligy viagra preisliste günstiger viagra propecia prezzo viagra rezeptfrei spanien cialis ohne rezept kaufen viagra online bestellen erfahrungen levitra 20mg rezeptfrei viagra online apotheke lasix 25 mg niederlande cialis acquisto cialis generico viagra preise in deutschland generico priligy viagra generika indien viagra bald billiger kamagra schweiz levitra ci vuole ricetta kamagra wien finasteride dove comprare viagra pfizer kaufen viagra im internet kaufen levitra per nachnahme betere erectie priligy compresse tadalafil ricetta super kamagra bestellen viagra bestellen per nachname cialis 5 mg rezeptfrei cialis verkoop mannen erectie kamagra online acquisto flagyl priligy vendita on line cialis nederland viagra kaufen in deutschland cialis rezeptfrei land viagra rezeptfrei günstig generika tadalafil cialis viagra a poco prezzo viagra deutschland rezeptfrei kamagra bijsluiter viagra venda livre zovirax generico kauf viagra cialis rezeptfrei aus deutschland erectiepil viagra online schweiz zovirax labiale prezzo viagra sicher bestellen cialis generico italia tadalafil prezzo viagra generika oder original acquisto viagra generico viagra 100mg ohne rezept viagra billigst viagra generika bestellen generika cialis viagra online kaufen ohne rezept cialis preis apotheke günstig kamagra kaufen plavix compresse propecia generico costo cialis generika internet cialis verkauf comprare viagra online viagra kaufen in münchen super kamagra generika oral jelly kamagra bestellen cialis filmtabletten viagra einzeln kaufen kamagra bijwerkingen cialis generika aus europa tadalafil nachnahme kamagra oral jelly preis cialis 10mg preis cialis alternative finasteride vendita cialis rezeptfrei cialis 5mg preis lasix prezzo levitra rezeptfrei schweiz generische levitra cialis 5mg filmtabletten preisvergleich levitra kaufen tadalafil tabletten tadalafil 20mg kaufen viagra kaufen test prezzo finasteride comprare cialis in italia prezzi viagra viagra kaufen preisvergleich viagra auf rechnung bestellen levitra generika erfahrungen priligy 60 mg vardenafil kaufen cialis dove si compra priligy vendita levitra pil viagra generika 100 mg super kamagra preisvergleich kamagra verkauf viagra in holland schweiz viagra viagra vrouwen viagra generico preiswert cialis cialis generika nebenwirkungen levitra günstig kaufen viagra rezeptfrei erfahrungen plavix vendita viagra schweiz rezeptfrei comprar levitra generica generieke medicijnen cialis preise apotheke levitra in apotheke preisvergleich kamagra cialis rezeptfrei deutschland lasix senza ricetta tadalafil bestellen generico finasteride cialis holland rezeptfrei levitra 10mg rezeptfrei viagra original günstig viagra 100mg preisvergleich zovirax equivalente cialis generika preisvergleich viagra verkauf viagra kaufen mit rezept comprare viagra proscar generico cialis aus indien kamagra rezeptfrei acquisto cialis italia viagra cialis kaufen compra viagra italia sildenafil per donne viagra rezeptfrei in holland nolvadex costo ersatz viagra cialis rezeptfrei schweiz viagra rezept online viagra legal kaufen clomid prescrizione preis kamagra erectie middelen finasteride generico farmacia tadalafil generika viagra preise deutschland cialis billig viagra apothekenpflichtig cialis preisvergleich azithromycin 250 mg preisvergleich levitra 20 mg cialis rezeptfrei bestellen viagra rezeptfrei holland viagra türkei rezeptfrei levitra serve ricetta viagra kaufen paypal viagra 50mg preis sildenafil preise propecia ricetta viagra versand schweiz prescrizione clomid viagra ohne rezept forum sildenafil 100mg preis viagra kaufen günstig levitra tabletten günstig viagra kaufen levitra filmtabletten 20mg prezzo zitromax 500 original viagra ohne rezept apotheke viagra preis viagra zonder recept kamagra oral jelly bestellen cialis original kaufen tadalafil costo viagra nur mit rezept viagra kaufen in wien vardenafil bestellen viagra per nachnahme impotentie kamagra lutschtabletten kamagra tabletten erfahrungen cialis pillen cialis generico acquisto cialis 20mg filmtabletten bestellen compra viagra generico cialis 5mg generika comprar viagra pela net alternativen viagra cialis preiswert kaufen cialis versand cialis bestellen forum cialis generico finasteride quanto costa viagra ohne rezept kaufen cialis in österreich kaufen cialis generico funziona viagra halbe tablette cialis apotheke günstig cialis viagra preis in apotheke viagra online rezeptfrei viagra express versand kamagra generika levitra generika forum viagra online kaufen kamagra online kaufen acquisto zitromax prezzo viagra 50 mg viagra aus indien viagra rezept viagra kosten in der apotheke cialis berlin koop levitra plavix prezzo versandapotheke viagra viagra blitzversand lasix compresse 25 mg cialis rezeptfrei günstig mannen pil viagra ersatz pillenpharm viagra zovirax compresse prezzo finasteride 5 mg cialis rezeptfrei österreich kamagra wirkung viagra bestellen rezeptfrei acquista cialis on line kamagra kopen viagra preiswert viagra rezeptfrei billig generic tadalafil generika flagyl compresse prezzo cialis lilly preis viagra efeitos viagra rezeptfrei bestellen proscar ricetta alternativ viagra kamagra verschreibungspflichtig viagra bestellen erfahrung cialis 20 mg generico viagra rezeptfrei auf rechnung cialis generika indien cialis comprare online pillendienst viagra viagra kaufen wien tadalafil acquisto levitra billig kaufen kaufen cialis kamagra tabletten lioresal compresse cialis niederlande cipro prezzi viagra kaufen ohne rezept forum viagra preisvergleich viagra generika per nachnahme viagra cialis levitra generika viagra bestellen schweiz viagra online kaufen forum viagra einzeln bestellen zovirax pomata prezzo tadalafil naturale sildenafil rezeptfrei priligy generico apotheke online viagra viagra torte rezept generico zovirax levitra rezeptfrei holland kamagra preisvergleich viagra kautabletten kamagra indien viagra rezeptfrei niederlande cialis seriös kaufen priligy prezzo levitra rezeptfrei cialis 10 mg rezeptfrei costo propecia viagra rezeptfrei viagra rezeptfrei in der apotheke cialis generika schweiz cialis generico esiste acquisto nolvadex rezeptpflichtig viagra

Archive

Archive for the ‘Series’ Category

Authentication 101 – Part 1 – Concepts

August 14th, 2009 Galvão 2 comments

Intro

Authentication always been one of the main concerns when developing web applications. This is a first post of a series of three (that’s what I’ve initially planned, I may extend it)that tries to shed some light on this subject. Although all examples in this series are presented using PHP and PostgreSQL, you’ll notice that the concepts involved are pretty common to other web technologies as well.

Part 1 – Concepts

I always liked to think before doing something or, in the worst case, think while doing it. Both strategies work for me, although the second one always requires more time re-coding everything =) The important thing here, and this is commonly overlooked in most development environments I’ve watched in almost 15 years working on the web, is to define which are the concepts involved in authenticating a user, how the application (or, at least this part of the application) should flow.

Read more…

Form Validation Part II – The special fields

June 4th, 2007 Galvão No comments

[pt-BR]

On the first article of this series, we defined the concepts involved in validating an element of a HTML form and created a coding pattern that we’ll use in the ‘name’ attribute which will carry the information regarding this validation.

Today we’ll see the definition of special form fields and how we’ll adapt our pattern to them.

When working with text-type fields it’s very simple to implement whether the field is required or not: we just test the number of characters of it’s ‘value’ attribute or it’s entire value to see if it’s empty. More on this on the next articles of this series.

Our job start to get complicated when we work with data types that may contain special characters and formatting. In these cases, it’s not enough to worry if the field was filled. Let’s take an example:

In a customer sign up form we have a text type field where the user must type his phone number. Our problem consists in the variety of representations of a phone number. Our hypothetical user could, for an example, type the following variations:

3555-0081
3555.0081
3555 0081
35550081
35.55.00.81

In all of these cases, our well mannered user is informing what we’ve asked – his phone number. When we have to store this data, however, this variety of formatting masks will be a problem to the organization, indexing and readability of these informations.

The solution to our problem begins with the definition of which special fields we’ll need to validate and how we’ll pass these validation informations both to the client side script (JavaScript) as well to the server side (PHP). As we’ve discussed previously, we’ll use four characters of the ‘name’ attribute to achieve this goal.

So we’ll define six different types of special fields which will be validated by our scripts:

Code Pattern Meaning Rule Example
TELE Telephone 9 characters: 4 digits, a dash and 4 more digits 3555-0081
DTNS Birth Date 10 characters: 2 digits for month, a slash, 2 digits for day, another slash and 4 digits for the year. Must be lesser than today. 1973/01/27
DTFT Current or future date 10 characters: 2 digits for month, a slash, 2 digits for day, another slash and 4 digits for the year. Must be equal or greater than today. 2007/06/03
EMIL E-mail address Must have one and only one ‘at’ symbol (‘@’). galvao@galvao.eti.br
PWD1 Password Only letters and numbers. abc123
PWD2 Password – Consistency Only letters and numbers and must be equal to the previously typed password. abc123

Sure, there are dozens of other special fields that we can validate, but as soon you understand those six it will be relatively simple to implement any other kind of validation.

On the next article of this series we’ll finally begin to see some code and define how we’ll implement an automatic formatting mask in our special fields, so it saves both our time as well as the user’s.

See you there!


No primeiro artigo desta série, definimos os conceitos envolvidos na validação de um campo presente em um formulário HTML e criamos um padrão à ser utilizado no atributo ‘name’ que carregará a informação referente à esta validação.

Hoje veremos as definições de tipos de campos especiais e como adaptaremos nosso padrão à validação destes.

Quando trabalhamos com campos do tipo texto em um formulário HTML, nos é muito simples implementar a obrigatoriedade do preenchimento deste campo: basta testarmos pelo número de caracteres presentes no atributo ‘value’ deste ou ainda testarmos se o valor deste campo é diferente de vazio. Veremos mais detalhes sobre isso nas próximas partes desta matéria.

A situação começa a se complicar quando trabalhamos com tipos de dados que podem conter caracteres e formatações especiais. Nestes casos, o preenchimento ou não do campo deixa de ser nossa única preocupação. Observe o seguinte exemplo:

Em um formulário de cadastro de clientes, possuo um campo simples do tipo ‘text’ onde o usuário deve digitar seu telefone. Nosso problema consiste na existência de diversas formas de representação de um número telefônico. Nosso usuário hipotético poderia, por exemplo, utilizar as seguintes variações:

3555-0081
3555.0081
3555 0081
35550081
35.55.00.81

Em todos estes casos, nosso bem-intencionado usuário está nos informando o que pedimos – o seu número de telefone. Entretanto, a partir do momento em que precisamos armazenar esta informação, a existência desta variedade de máscaras de formatação certamente representará um obstáculo para a organização, indexação e legibilidade destas informações.

A solução do problema começa por uma definição de que tipos de campos especiais precisaremos validar e como passaremos estas informações para o script client-side (JavaScript) e para o script server-side (PHP). Como publicado na matéria anterior, utilizaremos quatro caracteres do atributo ‘name’ de nosso campo de formulário para alcançarmos este objetivo.

Sendo assim, definiremos seis tipos diferentes de campos especiais com o qual nossos scripts trabalharão:

Padrão de código Significado Regra Exemplo
TELE Telefone 9 caracteres: 4 dígitos, um hífen e outros 4 dígitos 3555-0081
DTNS Data de Nascimento 10 caracteres: 2 dígitos para o dia, uma barra, 2 dígitos para o mês, outra barra e 4 dígitos para o ano. Deve ser menor do que a data de hoje. 27/01/1973
DTFT Data atual ou futura 10 caracteres: 2 dígitos para o dia, uma barra, 2 dígitos para o mês, outra barra e 4 dígitos para o ano. Deve ser maior ou igual à data de hoje. 12/06/2007
EMIL E-mail Deve ter uma e apenas uma arroba. galvao@galvao.eti.br
PWD1 Senha Somente letras e números. abc123
PWD2 Senha – Consistência Somente letras e números. Deve ser igual à senha digitada anteriormente. abc123

É claro que existem dezenas de outros campos especiais que podemos validar, mas a partir do momento que estes seis forem compreendidos, será relativamente simples implementar quaisquer outros tipos de validação.

Na próxima parte desta matéria trataremos da questão de como implementar automaticamente uma máscara em nossos campos especias, de forma à garantir o mínimo de trabalho para nosso usuário e para nosso script server-side.

Até lá!

Categories: Code, DOM, Form Validation, JavaScript, PHP, Series Tags:

Form Validation Part I – The Concept

May 24th, 2007 Galvão No comments

[pt-BR]

This is a series of 5 articles originally published on iMasters that I’m finally publishing here and also translating to english.

The intention of these articles is to suggest a way to validate form input both in the client (with JavaScript) and server (using PHP) side.

In this first part we’ll discuss something that is vital for any software development process, but often overlooked when we deal with this type of application. Before we do anything we must understand some concepts involved in the process of validation.

There are two general types of validation:

• Requirement: It’s a general characteristic that can be applied to any type of form element.
• Speciality: It’s a specific type of validation that is used on specific form elements.

Beyond that we should consider a feature that recently became very popular on the web:

• Interface Manipulation: Defines a formatting standard or mask to be applied on certain form elements.

Once we get aware of that we should then decide in which way our form elements will carry these characteristics. We know that both PHP and JavaScript can access two form element informations: it’s name (the “name” HTML attribute) and it’s value (the “value” attribute).

We also know that change an element’s value would be too complicated, since we’d have to make dozens of routines so the user don’t get the impression that the information he provided is being adultered.

So, we end up with the “name” attribute, on which we will define a coding standard that wil carry all the validation information we need. This will be achieved by using the first eight characters of the element’s name:

• Requirement: We will define if the element is required or not by starting it’s name with a ‘R’ or any other character.
• Speciality: The second character will define if this element must contain only letters, numbers or both.
• Requirement: The next two characters will define the minimum ammount of characters that this element’s value must have to be considered valid.
• Speciality: The next four characters will define the special validation type, which we’ll discuss on the next article of this series.

Finally the rest of the name’s attribute characters will be the element’s label, which we’ll use on our error messages. The following illustration shows the coding standard that we’ll use on the “name” attribute of our form’s elements:

Coding Standards Illustration

Esta é uma série de 5 artigos originalmente publicada no iMasters que eu finalmente estou postando aquie também traduzindo para o inglês.

A intenção destes artigos é sugerir uma forma de validar a entrada de dados por formulário tanto no lado cliente (com JavaScript) como no lado servidor (com PHP).

Nesta primeira parte discutiremos algo que é vital em qualquer processo de desenvolvimento de software, mas que é frequentemente ignorada quando tratamos deste tipo de aplicação. Antes de fazermos qualquer coisa, precisamos entender os conceitos envolvidos no processo de validação.

Existem dois tipos gerais de validação:

• Obrigatoriedade: É uma característica geral que pode ser aplicada à qualquer elemento de um formulário.
• Especialidade: É um tipo de validação específico que é utilizado em elementos também específicos.

Além disso devemos considerar uma feature que recentemente se tornou muito popular na web:

• Manipulação de Interface: Define um padrão ou máscara de formataçãopara ser aplicada em certos elementos de formulário.

A partir do momento em que nos damos conta disto devemos então decidir de que forma nossos elementos de formulário carregarão essas características. Nós sabemos que tanto o PHP quanto o JavaScript têm acesso à duas informações sobre um elemento de um formulário: o seu nome (o atributo HTML “name”) e seu valor (o atributo “value”).

Também sabemos que seria complicado demais modificarmos o valor de um elemento, pois teríamos que fazer dúzias de rotinas para evitar que o usuário tenha a impressão que as informações que ele forneceu estão sendo adulteradas.

O que nos resta então é o atributo “name”, onde definiremos uma padronização de código que carregará todas as informações de validação que precisamos. Isto serpa feito utilizando os oito primeiros caracteres do nome do elemento:

• Obrigatoriedade: Definiremos se um elemento é requerido ou não iniciando o seu nome com um ‘R’ ou qualquer outro caractere.
• Especialidade: O segundo caractere nos dirá se o elemento precisa conter somente letras, números ou ambos.
• Obrigatoriedade: Os próximos dois caracteres definirão a quantidade mínima de caracteres que o valor deste elemento precisa conter para ser considerado válido.
• Especialidade: Os próximos quatro caracteres definirão o tipo especial de validação, que discutiremos no próximo artigo desta série.

Finalmente os caracteres restantes do atributo “name” serão o rótulo do elemento, que usaremos em nossas mensagens de erro. S ilustração seguinte mostra o padrão de código que usaremos no atributo “name” dos elementos do nosso formulário:

Coding Standards Illustration

Categories: Code, DOM, Form Validation, JavaScript, PHP, Series Tags: