Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Tutorials
How to sanitize (filter) GET and POST data inputs
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Chronical" data-source="post: 284597" data-attributes="member: 36803"><p>Alright</p><p></p><p>So clearly a whole bunch of faggots trying to make CMSs thinking they're the next big thing don't know how to make a secure CMS and need to kill themselves.</p><p>However, I'm going to post this so that fagdicks don't get flamed for having insecure shit.</p><p></p><p>Let's get started.</p><p></p><p>Head over to wherever your functions.php is located (if you have one, it may not be "functions.php" It will probably be global.php) If you don't have one, make one. It doesn't matter where it's located. </p><p>Inside the functions.php page, add this code</p><p>[PHP] function filter($var)</p><p> {</p><p> return mysql_real_escape_string(stripslashes(htmlspecialchars($var)));</p><p> }</p><p>[/PHP]</p><p></p><p>Inside your <?php ?> tags of course.</p><p>What this does this do you ask? It filters meta characters (75% of you faggots don't even know what that is) and tags out of user input requests so that they can't execute malicious codes or scripts.</p><p>We're not done yet, we still have to apply this to anything that's not filtered.</p><p>In order to make this way easier and save a shit ton of time, go to your other input functions (such as shit to do with email, password, username, motto, etc) include the file the filter function is in, and filter it using the function. Here's an example:</p><p>[PHP]filter($_GET['id'])</p><p>filter($_POST['id'])</p><p>[/PHP]</p><p></p><p>In most CMSs you don't have to do this because widely used CMSs are already secured (such as RevCMS)</p><p>This is mainly for bobbas trying to edit a CMS or make one from scratch and haven't thought of securing it yet.</p><p></p><p>If you have any questions regarding security in PHP feel free to ask in the posting section. I'll answer to the best of my ability.</p></blockquote><p></p>
[QUOTE="Chronical, post: 284597, member: 36803"] Alright So clearly a whole bunch of faggots trying to make CMSs thinking they're the next big thing don't know how to make a secure CMS and need to kill themselves. However, I'm going to post this so that fagdicks don't get flamed for having insecure shit. Let's get started. Head over to wherever your functions.php is located (if you have one, it may not be "functions.php" It will probably be global.php) If you don't have one, make one. It doesn't matter where it's located. Inside the functions.php page, add this code [PHP] function filter($var) { return mysql_real_escape_string(stripslashes(htmlspecialchars($var))); } [/PHP] Inside your <?php ?> tags of course. What this does this do you ask? It filters meta characters (75% of you faggots don't even know what that is) and tags out of user input requests so that they can't execute malicious codes or scripts. We're not done yet, we still have to apply this to anything that's not filtered. In order to make this way easier and save a shit ton of time, go to your other input functions (such as shit to do with email, password, username, motto, etc) include the file the filter function is in, and filter it using the function. Here's an example: [PHP]filter($_GET['id']) filter($_POST['id']) [/PHP] In most CMSs you don't have to do this because widely used CMSs are already secured (such as RevCMS) This is mainly for bobbas trying to edit a CMS or make one from scratch and haven't thought of securing it yet. If you have any questions regarding security in PHP feel free to ask in the posting section. I'll answer to the best of my ability. [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Tutorials
How to sanitize (filter) GET and POST data inputs
Top