Skip to Main Content
Secure Development for Mobile Apps
book

Secure Development for Mobile Apps

by J. D. Glaser
October 2014
Intermediate to advanced content levelIntermediate to advanced
472 pages
10h 44m
English
Auerbach Publications
Content preview from Secure Development for Mobile Apps
20
seCure develoPment For mobIle APPs
POST Requests
For this example, the $_POST request does indeed contain a string, a user name.
equestion then becomes what is this string for and where does it go? e string is
to be stored in the database, queried from the database, and sent back to the client as
static HTML, not as a hyperlink. is tells us the steps we need to take in processing
this input variable.
Assuming both PHP character set and PDO connection character set are both
UTF-8, we can operate on our string.
e first step is to cut it. Our database column has a limit of 25 characters for
the username.
$userName = mb_substr($_POST['name'], 0, 25);//make requiredlength
e second step is to ensure it is only alpha-numeric.
if(ctype_alnum($userName))//only ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Developing with Web Standards

Developing with Web Standards

John Allsopp
Mobile Cloud Computing

Mobile Cloud Computing

Dijiang Huang, Huijun Wu

Publisher Resources

ISBN: 9781482209037