smiley_kool Posted June 12, 2008 Share Posted June 12, 2008 Hey all, i know how to do the client side validation for date in php but i dont know how to do the server side validation.. i have a field called date.. if the date selected less than today then it should print the message saying " date should not be less than today".. i have done this in client side but i dont knw how to do in server side.. can someone help melida Link to comment https://forums.phpfreaks.com/topic/109846-server-side-date-validation-in-php/ Share on other sites More sharing options...
corbin Posted June 12, 2008 Share Posted June 12, 2008 Depending on the type of user input you're expecting, you'll want to look into either mktime() or strtotime(). Link to comment https://forums.phpfreaks.com/topic/109846-server-side-date-validation-in-php/#findComment-563685 Share on other sites More sharing options...
smiley_kool Posted June 12, 2008 Author Share Posted June 12, 2008 Depending on the type of user input you're expecting, you'll want to look into either mktime() or strtotime(). sorry , i dint get u.. i'm using a pop up calender to select a date .. Link to comment https://forums.phpfreaks.com/topic/109846-server-side-date-validation-in-php/#findComment-563688 Share on other sites More sharing options...
bluejay002 Posted June 12, 2008 Share Posted June 12, 2008 what is the format of the input date? to which do you compare it? how do you validate it? if you want to validate a date in php, you may want to convert it into more like a timestamp using strtotime() or mktime(). from this you can compare it to other dates. Link to comment https://forums.phpfreaks.com/topic/109846-server-side-date-validation-in-php/#findComment-563691 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.