Welcome Guest, Not a member yet? Register   Sign In
Dreaded apostrophe
#1

[eluser]Unknown[/eluser]
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:
Code:
$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]
Code:
[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; ?>";
                    }
                    else
                    {
                        self.location = "<? echo $formUrlNCNS; ?>/<? echo $dateid; ?>/<? echo $selected; ?>/<? echo $msg; ?>";
                    }
                [removed]




Theme © iAndrew 2016 - Forum software by © MyBB