05-11-2010, 06:13 AM
05-11-2010, 12:07 PM
By using PHP validation (which you should use anyway). If a certain field isn’t filled out (i. e. empty) the form processing script redirects back to the page and displays a message.
05-11-2010, 08:57 PM
Could you help me out with the structure of that?
I tried doing this:
// store input
The error checking part (the first part) only redirects to the previous page if I remove the bottom part. I guess that's how header works. Is there a way to make header redirect immediately? Or is there some other thing I'm doing wrong?
05-11-2010, 09:55 PM
you want to learn about "regular expressions". those are the coding instruction sets that tell a program to accept or reject a user input based on how you set up the regular expression(s).
if you know about regular expressions already, then my post isn't offering anything new. however, if you haven't heard about regular expressions, it's the exact thing you should look into in detail.
the term itself is misleading and too general. if they were called gatekeeper instructions, it would be much more obvious.
05-12-2010, 01:45 AM
Thanks. :) I'll check it out and let you know how it goes.
05-12-2010, 01:57 AM
Ok, I checked out regular expressions. I see that's how I can validate the input, but can someone help me with the file structure? See above post.
Should I be using exit() or something like that? Thanks. :)
edit: I see that you must put exit; after a redirect if you don't want the code below it to execute.
05-12-2010, 09:13 PM
I found something much better than regular expressions if you have PHP5. filter_var is a lot less work.
Powered by vBulletin® Version 4.2.2 Copyright © 2016 vBulletin Solutions, Inc. All rights reserved.