Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,150,815 members, 7,810,128 topics. Date: Friday, 26 April 2024 at 09:18 PM |
Nairaland Forum / Science/Technology / Webmasters / Form Validation Tutorial Using Javascript, Php And Ajax! (29545 Views)
Flex Builder Tutorial / Using Some Dhtml Techniques / Form Validation Tutorial Using Javascript, Php, Ajax / Moving To Oop Javascript/php Class Module Creation & Instantiation (2) (3) (4)
Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 1:21am On Jan 08, 2009 |
Yo - so finally we got here. I am alwayz complaining whenever someone ask me to review a site and the site submits an empty form. Anyway, since i am a scripting guy, i think it wont hurt to try put yo guys thru a small class on how to validate forms! What i have in mind can be divided into 3: 1. Ordinary validation with javascript [mainly to help users fill in necessary fields] 2. Validation with php to check if say an email has been previously registered. 3. How to do those 2 validations without leaving that page/refreshing the page [ajax] To continue this thread - i need 8 positive responses [negative responses will not be counted - and no sitting on the fence is allowed] @moderator - please help me with the countdown - immediately it gets to 8 lemme - just click on my special alert button - i need to know if I am making sense - if not just help me delete this thread. |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by OmniPotens(m): 8:43am On Jan 08, 2009 |
As usual, it's me first on all threads. I one! Just 7 more to go. |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 3:31pm On Jan 08, 2009 |
Session timed out, conclusion, seems ppl are not interested in this one, @moderator since you are interested i will have to send you a personal tutorial on that on ebook format - and possibly add it to my site for record purpose. |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by moderatorr: 4:48pm On Feb 16, 2009 |
please send me the tutorial too. bundlesof20@gmail.com |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by yawatide(f): 5:44pm On Feb 16, 2009 |
dhtml, You can't take silence for a lack of interest - even you said you have been observing my posts for months before you decided to start commenting Drop the tutorial and those with ears and eyes will listen and observe |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 8:08pm On Feb 16, 2009 |
dhtml am intrested pls send me the tutorial |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 10:39pm On Feb 16, 2009 |
awright, i will drop the tutorial quite alright. Because i have even stopped watching this thread. Though it was useless. |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 10:11am On Feb 18, 2009 |
please carry go, no yawa |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 8:38pm On Feb 18, 2009 |
Sorry jare, i am in the middle of a project, i have already done the tutorial before creating this thread, just to test properly and paste it in bits and pieces, i will try to do that later tonight. |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 11:35pm On Feb 26, 2009 |
Things have been rather rough. Please see what you can learn from this link: http://www.javascriptkit.com/javatutors/valid3.shtml It basically deals with client-sided form validation. Read it, ask questions and will answer. The code i want to paste is rather advanced for those that are not so used to javascript. |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 9:15am On Feb 28, 2009 |
Let us see a very simple form validation here with javascript. index.php <title>Login Demo</title> login.php <?php Notice that i am not focusing on security here. Securing your login will be discussed on another thread i have already started. Writing Secure Php/*Hacks Feat Yawatide, Nitation,webdezzi,quadrillo,omni: |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 9:22am On Feb 28, 2009 |
Javascript Validation Explanation Notice what happens in that form, the moment you click on submit, the form attempts to submit and the event handler called onsubmit is fired, the handler fires the validate function. If the validate function returns true then the form is submitted to login.php If it returns false then the form is not submitted. PHP Explanation That is just a basic display page. We now need to move forward from there. |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 10:39am On Feb 28, 2009 |
How to retrieve information sent to a php script. 3 basic methods are the post, get and request method. At least on a basic level, the others are slightly complicated. $_GET['username'] - will retrieve info from url where the method is get (using form), or just ordinary url with query like index.php?user=dhtml&pass=jscript $_POST['username'] - will only retrieve data if the method used in the form is: post - considered secure (not really true). $_REQUEST['username'] - is a combination of both. |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 10:43am On Feb 28, 2009 |
PHP Validation Download complete zip here http://mwebng.net/demos/login/step1.zip Online demo available on: http://mwebng.net/demos/login/step1/ username:dhtml and password:jscript I will post it so that i can explain. Remember this is not a training on security. The rules are, learn how to at least do a simple non-secure one, then advance forward and learn how to prevent your site from being soiled. index.php <?php index2.php <?php session_start(); logout.php <?php session_start();
|
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 11:44am On Feb 28, 2009 |
Fine quite alot of codes there - i am not sure of where to start explaining. index.php = is the login page index2.php = is the personal page logout.php = logout script If you have any questions regarding this, please lemme know. |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 8:19am On Mar 01, 2009 |
And finally, the ajax validation and submission too. Demo link: http://mwebng.net/demos/login/step2 Download: http://mwebng.net/demos/login/step2.zip index.php <?php login.php <?php index2.php and logout.php still remain the same as the previous example. For more information on posting stuffs with ajax, please read, http://www.javascriptkit.com/dhtmltutors/ajaxgetpost.shtml THat ends my explanation of validation. The rest is up to you. If you are retrieving information from database and wish to validate it, you can still make use of some of the techniques here. By the way, none of these methods are secure as you will learn from my thread on Writing Secure Php/*Hacks Feat Yawatide, Nitation,webdezzi,quadrillo,omni: From here, i will be expecting question and comments. |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by wizzykid(m): 4:06pm On Feb 10, 2010 |
*dhtml awud lyk us 2 chat on yim so I can get some more xplations, pls give me ur e-mail |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 9:53pm On Feb 10, 2010 |
possible, you can send me an email through my website, i cant post my yim on dis place lyke dat |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 11:40am On Feb 11, 2010 |
HURRAY the name dhtml is back i prefer it to the name with extreme,mehn thank God for Jquery though once in a while going the raw way ain't that bad |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 7:46pm On Feb 11, 2010 |
hmm, that seem rather like a pirated version eh? |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by Nobody: 5:40pm On Apr 23, 2010 |
hoi @ modurator, spammer is on the board! |
Re: Form Validation Tutorial Using Javascript, Php And Ajax! by OmniPotens(m): 6:19am On Apr 25, 2010 |
I've attacked the spammer |
(1) (Reply)
Godwin Benson Wins Internet.org Award After Meeting Mark Zuckerberg In Nigeria / Mark Zuckerberg The Owner Of FACEBOOK Shared This Romantic & Motivating Words! / Youtube Reveals The Most-watched Videos In Nigeria In 2013.
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 46 |