The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Your username must be a minimum of 5 characters and a maximum of 10 characters in length, contain alphanumeric characters only and the first character must be alpha.

Your password must be a minimum of 5 characters and a maximum of 10 characters in length, contain alphanumeric characters only, the first character must be alpha and must contain at least 1 numeric character.

The reason I am considering client-side validation is that, as you all know, the form does not need to be submitted for validation and checking to take place. Thus, saving processing at the server-side and also time.

Is that a plausible enough reason to go with the client-side approach rather than embedded validation code within PHP (i.e. server-side).

Would there be any drastic reasons to go with the server-side approach?

Following Sarah's point on client/server-side I'd agree that you should use only server-side for FORM validation.

While I agree that the serverside check is a MUST, if you run a busy website, it would be well worth the extra 15 minutes it takes to add a little javascript checking too. The javascript should add less than 1K to your files, but can save your users from reloading a 10K, 30K or even larger file if the whole form has to be redisplayed with error messages. It saves the end-user time by seeing the error message instantly rather than waiting for the page to be reloaded. And if they have javascript turned off, oh well, you still have the PHP error messages to fall back on. But it saves server resourses if you don't have to reload the page over and over, especially if you only show the first error message that PHP comes across and then redisplay the form. And every little resource saved it worth it

when you got the error it means that it started working which is line 70? and also post the whole page here (minus the chunk of form code like before) but I am interested in the end of the script too, ie making sure the else statement is ended correctly

Okay, line 70 is the '} else {' of the Forename check below (before that is just some HTML code.

Here is how the script goes:

PHP Code:

<?phpinclude("conf.php"); // include the configuration file?><?php if (isset($_POST['submit'])) { // a new member joins using the form belowif ($_POST["Forename"]='') { echo "Please enter your Forename."; } else {

I have added the last } bracket also as you didn't post the whole code so I didn't know if you did that end close bracket part... but have tested this on my system and it works - if this doesn't then check the submit button values for name to make sure they match the isset section