A2xA Posted January 31, 2008 Share Posted January 31, 2008 I wan't to make my form secure. Which means no / or < or leave it blank. You get my point. Would it be best to add it to the code that the form is processing, or the actual form itself? If you could point me to a tutorial I could also follow that. I just couldn't find anything! Form Code: <form name="hubmove" action="taken out" method="post"> <h3>Step 1. Enter Hub ID or Name To Make Hub, Then Come Back And Proceed to Step 2<h3> <input name="dir" value="" type="text"> <INPUT TYPE="submit"> </form> Processing code: <html> <?php $dir = $_POST[dir]; mkdir("taken out", 0755); chmod("taken out", 0777); ?> <h3> Click <a href="taken out">Here</a> to return back to hubs Complete Step 2. To Activate your Hubs<h3> </html> Thanks, I appreciate it! I need to secure my stuff so I can release it. This is the last step. All who helps Thanks! Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted January 31, 2008 Share Posted January 31, 2008 This will make sure they filled the dir out, and also strip any HTML tags. <?php //check if they filled it out if ((!isset($_POST['dir'])) || (empty($_POST['dir'])){ echo "You didn't fill the form out!"; } else { $dir = strip_tags($_POST['dir']); } ?> Quote Link to comment Share on other sites More sharing options...
mem0ri Posted January 31, 2008 Share Posted January 31, 2008 If you really want to make your visitors happy, it's a good idea to throw a little DHTML / JavaScript validation into the form. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.