- Code: Select all
if (empty($_POST['id'])) $id = 0; else $id = $_POST['id'];
if (!preg_match("/[a-z0-9].\:\?\!\"\-]$/i), $id);
{
preg_replace("*")
{else return $id;
}
}
I get an error way down the page, so I am not sure the error is with the syntax coding. Does anyone see a problem with my code.
Second, am I doing the best thing here. This is for a profile submission, so it is important that because someone use a bad character, the connection not die, hence destroying a valuable submission. I can live with * in place of bad characters, but I would like to use the best method.
Am I under the right impression that this !preg_match will not allow characters other than what I have specified to be put into the database nor pulled to the HTML page? Or echoed after the code? ( I beat my head for a week learning that mysql_real_escape_string() did not actually put / in the output.
Thanks Greg


