Thanks,
Someone else told me that but I can't get it to work.
Do I just replace the lines:
PHP Code:
if (!ereg("^[0-9]{1,}$",$mobile)) {
header( "Location: http://www.mysite.com/badnumber.php" );
}
With:
PHP Code:
if (is_numeric($mobile)) {
header( "Location: http://www.mysite.com/badnumber.php" );
}
Because this is what I did and it doesn't work like ereg does?
This is as far as I have got with the form field validation bit too. If someone can help me finish this, it may be the quickest $30 paypal they've ever made!
So I add:
PHP Code:
$username="username";
$password="password";
$database="databasename";
mysql_connect('localhost',$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$sql = "select count(*) items from tablename where code = '$code'";
//Run the query
if (items == 0) {
header( "Location: http://www.mysite.com/badcode.php" );
}
With this I'm trying to validate that $code submitted in the form is in a table. If it is progress with the action (sending an email- noted in first post) PLUS then I would need to have this $code value deleted from the mysql database table.
If the value of $code isn't on the table then I have the redirect to
http://www.mysite.com/badcode.php
PLEASE help if you can and I will paypal you $50 as soon as I have it working. I'm sure that this is easy for a lot of people.
Thanks.