Welcome Guest, Not a member yet? Register   Sign In
Escapting String for Eval
#1

[eluser]CodeIgniterNewbie[/eluser]
Assume I have a function that accepts one string argument:

Code:
function foo($bar)

Assume also that I will execute this function via Eval:

Code:
eval("foo($string-from-form);");

As suggested by the above snippet, the value for the argument will come from form input.

QUESTION: how do I prepare the form input so that it doesn't cause an problems when it is passed to the function inside the eval? "addslashes" doesn't seem to be sufficient; I still get failures if I try to enter something with a double quote (and probably a few other characters).

The string argument is to be stored in an object, then later stored in MySQL.


Messages In This Thread
Escapting String for Eval - by El Forum - 06-03-2008, 03:56 PM
Escapting String for Eval - by El Forum - 06-03-2008, 04:04 PM
Escapting String for Eval - by El Forum - 06-03-2008, 04:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB