Search code examples
phpmysql-real-escape-stringstrip-tags

Can I use mysql_real_escape_string together with strip_tags?


Sorry if this is a silly question, but I currently have the following and it SEEMS to be working in the browser, but Dreamweaver is telling me there is a syntax error:

$formdescription = mysql_real_escape_string(strip_tags($_POST['form_description']));

Solution

  • Yes, it's ok :) Forget Dreamweaver!

    You can also split the above:

    $formdescription = $_POST['form_description'];
    $formdescription = strip_tags($formdescription);
    $formdescription = mysql_real_escape_string($formdescription);