Jump to content
victordeassis

User Validation PHP + JavaScript

Recommended Posts

Hi guys!

 

I've been working on a login form and I have some problems to validate the input data, I need to consist if the login and password fields aren't with spaces or no allowed characters, for this I've been used JavaScript for client-side validation, but if the fields are Ok, I need to call my php function to see if the user and pass are on mySQL database. I don't know how to "call" the php after the JavaScript validation. If someone could help me I will be thankful.

 

 

Share this post


Link to post
Share on other sites

Javascript inapproriate for validation because a user can turnoff their JS.

 

<?php

some code

?>

 

is how you "call" php.

 

Sounds like you should complete the php tutorials:

 

http://www.w3schools.com/php/default.asp

Edited by niche

Share this post


Link to post
Share on other sites

Validate and sanitize data USING PHP from form first, before checking through database, then use javascript validation before using ajax to go to this php page, from login page.

Edited by dsonesuk

Share this post


Link to post
Share on other sites

Except, users can disable their JS. Then JS validation is no go.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...