The following warnings occurred:
Warning [2] Undefined variable $unreadreports - Line: 26 - File: global.php(961) : eval()'d code PHP 8.2.25 (Linux)
File Line Function
/global.php(961) : eval()'d code 26 errorHandler->error
/global.php 961 eval
/showthread.php 28 require_once





× This forum is read only. As of July 23, 2019, the UserSpice forums have been closed. To receive support, please join our Discord by clicking here. Thank you!

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Adding inputs to join.php
#10
You would basically have to do your own validation... If this isn't exact, it's close. Notice you can test the logic by using the birthday I commented out instead of the form input....

//date in mm/dd/yyyy format; or it can be in other formats as well
//to test it use this line instead of the Input::get line
// $birthDate = "12/17/1983";
$birthDate = Input::get('birthDate'); //give your form input a name of birthDate in mm/dd/Y format.
//explode the date to get month, day and year
$birthDate = explode("/", $birthDate);
//get age from date or birthdate
$age = (date("md", date("U", mktime(0, 0, 0, $birthDate[0], $birthDate[1], $birthDate[2]))) > date("md")
? ((date("Y") - $birthDate[2]) - 1)
: (date("Y") - $birthDate[2]));
if($age > 17){
//continue your form processing
} else {
Redirect::to('join.php?err=Sorry+you+must+be+18+to+join');
};
  Reply


Messages In This Thread
Adding inputs to join.php - by Disruptionz - 08-02-2016, 03:17 PM
Adding inputs to join.php - by Disruptionz - 08-02-2016, 04:09 PM
Adding inputs to join.php - by dan - 08-02-2016, 05:12 PM
Adding inputs to join.php - by Disruptionz - 08-03-2016, 02:28 PM
Adding inputs to join.php - by snifer999 - 08-03-2016, 09:36 PM
Adding inputs to join.php - by dan - 08-04-2016, 01:45 AM
Adding inputs to join.php - by dan - 08-05-2016, 12:44 AM
Adding inputs to join.php - by Disruptionz - 08-05-2016, 09:10 AM
Adding inputs to join.php - by Kighlander - 10-29-2016, 10:51 AM
Adding inputs to join.php - by mudmin - 10-29-2016, 11:58 AM
Adding inputs to join.php - by Kighlander - 10-29-2016, 05:41 PM

Forum Jump:


Users browsing this thread: 2 Guest(s)