mysqli - securing sql queries against malicious intent -


for prototyping, use self-built plugin this

$.databasecontents({    url: '/sqliquery.php',    data : {query : 'select * members id = 45'} }); 

the php script execute query , return json-encoded result.

in localhost environment don't worry securing server malicious intent.

so wonder, best if wanted deploy on live website? i'm not keen on doing lot of unnecessary security engineering - it's not i'm going getting 12,000 hits day. i'd sure don't end having database injected nasty queries.

after reading, impression can secure php query variable doing mysql_real_escape_string($_post["query"]); seems not safe - can't directly interact php script , submit data spoofing host or something? i'm not familiar stuff.

i thought maybe allowing specific url access good. or can circumvented easily?

thanks pointers.

so wonder, best if wanted deploy on live website?

that's simple

quit approach of creating queries on client side.

and create them everyone - on server side only. using prepared statements represent whatever dynamical data in query.

so - write queries placeholders in server-side script, send only data client, bind data prepared statement , run query.

that's way.


Comments

Popular posts from this blog

java - Jmockit String final length method mocking Issue -

asp.net - Razor Page Hosted on IIS 6 Fails Every Morning -

c++ - wxwidget compiling on windows command prompt -