View Single Post
Old 09-20-2010, 05:02 PM  
BestXXXPorn
Confirmed User
 
BestXXXPorn's Avatar
 
Join Date: Jun 2009
Location: Asheville, NC
Posts: 2,277
Quote:
Originally Posted by rowan View Post
Quick tip: if the value you're expecting should be an integer, you can force PHP to treat it as such like this:

$val = 0 + $_POST["variable"];
Ouch... no don't do that and if you really must typecast instead use

$val = intval($_POST['variable']);

And always use single quotes unless you need special escaped chars... Every time you use double quotes for a string in PHP you cause the string interpreter to parse the entire string looking for variables, special chars, etc... Using single quotes instead ensures that doesn't happen...
__________________
ICQ: 258-202-811 | Email: eric{at}bestxxxporn.com

Last edited by BestXXXPorn; 09-20-2010 at 05:03 PM..
BestXXXPorn is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote