I have built a system on my localhost, which is running PHP 5.2.1 and mySQL 5.0.33. I have used the following code:
Code: Select all
function validateTextOnly($theinput,$description = '') {
$result = ereg ("^[A-Za-z0-9\ ]+$", $theinput );
if ($result) { return true; }
else {
$this->errors[] = $description;
return false; }}
I added * to my array for EREG but this still failed. I then realised that EREG has gone and that I should now use PREG_MATCH. However, I tried this:
Code: Select all
$result = preg_match ("/^[A-Za-z0-9\ ]+$*/", $theinput );
My hosted system uses PHP 5.2.13 and mySQL 5.0.90.
***** EDIT ******
Okay, I now realise that I should have used \* rather than * to rule out it's use as a command. However, local is logging in, remote site is not. Any ideas?