Link to home
Start Free TrialLog in
Avatar of fincon
fincon

asked on

Form text validation

Hi there,

Can you please help me with a php script to compare text entered into a web form to the current date? Date will only be year and month.

Any help would be greatly appreciated...
Avatar of Roonaan
Roonaan
Flag of Netherlands image

What are the comparison requirements?
Avatar of fincon
fincon

ASKER

Hi Roonan...

I need a user to enter a number like 703MSZT010853 (this is a product serial number), the first three digits is the manufacturing date (1st = year, 2nd = month) and the item has a 3 year warranty. I need to check these numbers with the current date to validate warranty on the unit and return with a message.

Thanks
Avatar of fincon

ASKER

Sorry - The 2nd AND 3rd digit is the month..
SOLUTION
Avatar of steelseth12
steelseth12
Flag of Cyprus image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fincon

ASKER

steelseth,

Thank you for your input, however, I get the following error:

PHP Fatal error: Call to undefined function: str_split() in C:\Domains\testcrt.co.za\wwwroot\lgsn.php on line 24
Avatar of fincon

ASKER

Is there possibly a way of checking this in normal HTML?
Avatar of fincon

ASKER

Also, can it be validated in months instead of years?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fincon

ASKER

Thank you guys! As alwasy, expert advice for a beginner like me! I appreciate all your time and effort! Thanks