Tag Archives: PHP
Building query strings in PHP
Posted on 15. Jul, 2009 by Nikhil Sheth.
Passing query parameters in the url is something which most of the programmers encounters everyday. Typical way of doing is keep on appending parameters in a variable.
ex:
$fname=”Nikhil”;
$lname=”Sheth”;
$city=”Mumbai”;
$myUrl=”http://www.nikhilsheth.net/example.php?fname={$fname}&lname={$lname}&city={$city}”;
This is fine if you have to add just 1 or 2 query paramters in the url. But it would be difficult if you need to pass large number [...]
Continue Reading
Filtering input data
Posted on 22. Sep, 2008 by Nikhil Sheth.
This guide goes over the basics of cleaning user input for safe use. This includes escaping strings correctly, stripping html and tags, preventing SQL injection, and other security issues. Anytime you use a $_POST, $_GET, or are receiving any information that the user can modify, you must be sure that you properly escape it, and [...]
