note 89486 added to reserved.variables.post

From: Date: Tue, 10 Mar 2009 16:17:22 +0000
Subject: note 89486 added to reserved.variables.post
Groups: php.notes 
Request: Send a blank email to php-notes+get-151693@lists.php.net to get a copy of this message
Note that the data type of POST data is always a string: <?php gettype($_POST['whatever']) === 'string'; // always TRUE if $_POST['whatever'] contains data // You may find it helpful for security reasons (to avoid possible SQL // injection vulnerability, etc) to do something like this: $id = (int)$_POST['id']; orObject->addRecord(int)($_POST['id']); $price = (float)$_POST['price']; // you get the idea... // to avoid silly things like this: $id = addslashes($_POST['id']); Object->addRecord(addslashes($_POST['id'])); ?> ---- Server IP: 69.147.83.197 Probable Submitter: 76.243.214.183 ---- Manual Page -- http://www.php.net/manual/en/reserved.variables.post.php Edit -- https://master.php.net/note/edit/89486 Del: integrated -- https://master.php.net/note/delete/89486/integrated Del: useless -- https://master.php.net/note/delete/89486/useless Del: bad code -- https://master.php.net/note/delete/89486/bad+code Del: spam -- https://master.php.net/note/delete/89486/spam Del: non-english -- https://master.php.net/note/delete/89486/non-english Del: in docs -- https://master.php.net/note/delete/89486/in+docs Del: other reasons-- https://master.php.net/note/delete/89486 Reject -- https://master.php.net/note/reject/89486 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#151693) next »