![]() |
Form validation in PHP
Form validation in PHP
When someone enters a string similar to this in my address input field: Some street 98, 1'st floor. I get an error due to the ' char. It's substituted by / and a space! This is no good... Does anyone have the valid php ereg function to disable or replace the illigal chars like ' & // $ etc etc... ? If someone enters something like this in a form that submits it to a php page, it errors on me big time. :helpme |
try addslashes();
example <? php echo "This is correct field value: ".addslashes($_POST["form_field"]); ?> Edited: there is space between '<?' and 'php' - just remove it to get it work Edited 2: whe your form method is GET then change $_POST to $_GET |
Great idea... Thanks!
|
All times are GMT -7. The time now is 01:33 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123