wwfc_barmy_army Posted October 31, 2007 Share Posted October 31, 2007 Hello. I have this code to check the age of people signing up: <?php $month = $_POST['birthmonth']; $day = $_POST['birthdate']; $year = $_POST['birthyear']; // create timestamp for user's age $user_timestamp = mktime(12,0,0,$month,$day,$year); // work out difference between now and the user's timestamp $age = $time() - $user_timestamp; // convert $age timestamp to years (1yr = 31556926secs) $age = $age / 31556926; if($age < 18) { echo "18-"; } else { echo "18+"; } ?> Although i'm getting the following error: Fatal error: Function name must be a string in myfilename on line 68 Line 68 being: $age = $time() - $user_timestamp; Any ideas? Thanks. Quote Link to comment Share on other sites More sharing options...
kenrbnsn Posted October 31, 2007 Share Posted October 31, 2007 Remove the "$" from "$time()". The funtion name is "time()". Ken Quote Link to comment Share on other sites More sharing options...
wwfc_barmy_army Posted October 31, 2007 Author Share Posted October 31, 2007 Ahhhh! Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.