Validating date server side in php

by  |  27-Sep-2019 23:31

This article follows on from Web Services using XMLHttp Request (Ajax) and demonstrates the usage of the Ajax class for validating online forms.

This example uses the Java Script XMLHttp Request object and PHP server-side scripting to check that the Email address entered is valid (at least that it matches a particular regular expression) and that the Age lies between 16 and 100.

validating date server side in php-47

Most of the pages were displayed correct, but on some of them apache added weird content to it: A 4-digits Hex Code on top of the page (before any output of my php script), seems to be some kind of checksum, because it changes from page to page and browser to browser.

(same code for same page and browser) "0" at the bottom of the page (after the complete output of my php script) It took me quite a while to find out about the wrong protocol in the HTTP-header.

Instead of as this lets the browser (and the user) know that the contents of that field need to be secured.

The password won't appear on the screen as you type and most browsers also won't 'remember' the values entered in fields as they do with other form elements.

If the purpose of registration is to confirm that the person exists, and that they have supplied a valid email address, then as part of the registration processe you a should either email them a random password or a confirmation token rather than letting them choose their own password and use it immediately.

Community Discussion