Jump to content

help with date validation


xcoderx

Recommended Posts

ok why am i getting error here anyone can guess?

 

all im trying to do is the fields should be numeric and length should be 10 along with 2 -

 

$date = $_POST['!date'];
if(strlen($date) < 10 || !is_numeric($date) !=1-1);
    $user_profile['id'] = $_POST['user_id'];
{
$error['date']='error';
    }

Link to comment
https://forums.phpfreaks.com/topic/208332-help-with-date-validation/
Share on other sites

What are you trying to do with this part of your conditional:

 

!is_numeric($date) !=1-1

 

??

 

Haha, yes.

 

If $date is numeric then your condition says if !true which is false is not equal to 0.

If $date is NOT numeric then your condition says if !false which is true is not equal to 0.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.