homepage Welcome to WebmasterWorld Guest from 72.44.48.122
register, login, search, subscribe, help, library, PubCon, announcements, recent posts, open posts,
Subscribe to WebmasterWorld
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library : Charter : Moderators: coopster & eelixduppy & jatar k

PHP Server Side Scripting Forum

    
Secure Form Security
chrissim




msg:4424010
 7:37 am on Mar 2, 2012 (gmt 0)

hi,

Guys, i have a form page and output page below and im seeking what is the best method security to secure my form from all kind of threats out there.


<form action="welcome.php" method="post">
Name: <input type="text" name="fname" />
Age: <input type="text" name="age" />
<input type="submit" />
</form>



Welcome <?php echo $_POST["fname"]; ?>!<br />
You are <?php echo $_POST["age"]; ?> years old.


Thanks

 

enigma1




msg:4424089
 11:24 am on Mar 2, 2012 (gmt 0)

You validate the input posted before you echo it. For instance age is expected to be an integer between 12-90. fname should be a string so you could verify it contains alphabetic chars between certain length limits. It then depends what your PHP code does with the values posted.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
WebmasterWorld ® and PubCon ® are a Registered Trademarks of Pubcon Inc.
© Pubcon Inc. 1996-2012 all rights reserved