CodeIgniter Forums
Dreaded apostrophe - Printable Version

+- CodeIgniter Forums (
+-- Forum: Archived Discussions (
+--- Forum: Archived Development & Programming (
+--- Thread: Dreaded apostrophe (/thread-45877.html)

Dreaded apostrophe - El Forum - 10-10-2011

Hi everyone,

When I want to redirect this link and I have entered an apostrophe into the $comment variable, it give me the error: "An Error Was Encountered
The URI you submitted has disallowed characters.", I only get it when an apostrophe is entered, anything I can do to solve it?

Code for php:
$comment = $_POST['gucomment'];
        //$comment = preg_replace("/\r?\n/", "\\n", addslashes($comment));
        $comment = htmlspecialchars($comment, ENT_QUOTES);
$formCNS = array('training', 'ci', 'index.php', 'trainsession_control', 'clientNoShow');
                $formUrlCNS = site_url($formCNS);
                $formNCNS = array('training', 'ci', 'index.php', 'trainsession_control', 'viewTrainDate');
                $formUrlNCNS = site_url($formNCNS);
                $msg = '3';

Code for [removed]
                    var where_to= confirm("This client has already been evaluated.\r\nDo you want to still set this client as a no show?");
                    if (where_to== true)
                        self.location ="<? echo $formUrlCNS; ?>/<? echo $masterid; ?>/<? echo $comment; ?>/<? echo $selected; ?>/<? echo $dateid; ?>";
                        self.location = "<? echo $formUrlNCNS; ?>/<? echo $dateid; ?>/<? echo $selected; ?>/<? echo $msg; ?>";