echo "sed -i 's/NULL/\\N/g' ".$_REQUEST['para'].".sql";
The above statement works. But it fail when I use it in exec like this…
exec("sed -i 's/NULL//\/\/\N/g' ".$_REQUEST['para'].".sql");
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You should escape backslashes with backslashes, not with forward slashes, like this:
EDIT I wrote the answer without looking at what the code actually does. Don’t do this, because
$_REQUEST['para']can be whatever the user wants, which can be used for code injection. Use the PHP functions as the other answer suggests.