Reputation: 470
what functions i have to use to encode/decode/escape/stripslash data for following purposes?
page.php?data=don't_use_#_and_%_in_URL_params
don%27t_use_%23_and_%25_in_URL_params
"``'
)"``'
sequence with an expression"``'
and i want to use it in a PHP eval() macrosubstitution"``'
characterssomething like this diagram:
JS(encode) --> (decode)PHP(encode) --> (decode?)MySQL(encode?) --> (decode)MySQL(encode) --> (decode)JS
if anyone have the time and pleasure to answer, or to correct me if i made any mistakes here, thanks in advance
Upvotes: 4
Views: 1319
Reputation: 157889
Upvotes: 1
Reputation: 943624
$_GET
eval
smells bad though.eval()
is JS is when you are implementing a support for json
in browsers without a native version (and you can use Crockford's json2.js for that). So don't.Upvotes: 2