MrCreeky Posted January 20, 2009 Share Posted January 20, 2009 Hi, Today I have started getting this error: Notice: Use of undefined constant void - assumed 'void' Line of code: <?php $day = ($row_rs1_events['ddate']); // Day of the countdown $month = ($row_rs1_events['mdate']); // Month of the countdown $year = ($row_rs1_events['ydate']); // Year of the countdown $hour = 24; // Hour of the day (east coast time) $event = ($row_rs1_events['name']); //event $calculation = ((mktime ($hour,0,0,$month,$day,$year) - time(void))/3600); $hours = (int)$calculation; $days = (int)($hours/24); ?> and this one: Notice: Undefined index: loginid in Line of code: <div class="login_div" id="login_div"><form action="index.php" method="get" enctype="multipart/form-data" name="login" class="login_form" id="login_form"> <span class="login_text">Login ID</span> <input name="loginid" type="text" size="10" /></form></div> What would make that just start to happen? Windows Server 2003, PHP 5.2.8 http://www.hifisquad.com/test.php Quote Link to comment Share on other sites More sharing options...
revraz Posted January 20, 2009 Share Posted January 20, 2009 Does it work ok if you remove void? Quote Link to comment Share on other sites More sharing options...
trq Posted January 20, 2009 Share Posted January 20, 2009 time does not eccept any arguments, you have misread the manual. Quote Link to comment Share on other sites More sharing options...
MrCreeky Posted January 20, 2009 Author Share Posted January 20, 2009 That's odd. Removing it worked but why would it have only just started to show this error on my part? Quote Link to comment Share on other sites More sharing options...
DarkWater Posted January 20, 2009 Share Posted January 20, 2009 Why were you passing a string literal containing 'void' into time()? Quote Link to comment Share on other sites More sharing options...
MrCreeky Posted January 20, 2009 Author Share Posted January 20, 2009 Because I guess I'm not so good at coding Quote Link to comment Share on other sites More sharing options...
revraz Posted January 20, 2009 Share Posted January 20, 2009 Some sites show (void) as a optional parameter. Quote Link to comment Share on other sites More sharing options...
trq Posted January 20, 2009 Share Posted January 20, 2009 Some sites show (void) as a optional parameter. Like the manual you mean? The meaning of the word void.... Containing nothing; empty; vacant; not occupied; not filled. Some people need to read a manual about reading manuals. Optional arguments are surrounded by [] brackets. Removing it worked but why would it have only just started to show this error on my part? Maybe your error_reporting level has changed? Quote Link to comment Share on other sites More sharing options...
revraz Posted January 20, 2009 Share Posted January 20, 2009 And some people need to not assume... http://www.w3schools.com/PHP/func_date_time.asp Some sites show (void) as a optional parameter. Like the manual you mean? The meaning of the word void.... Containing nothing; empty; vacant; not occupied; not filled. Some people need to read a manual about reading manuals. Optional arguments are surrounded by [] brackets. Quote Link to comment Share on other sites More sharing options...
trq Posted January 20, 2009 Share Posted January 20, 2009 And some people need to not assume... http://www.w3schools.com/PHP/func_date_time.asp Some sites show (void) as a optional parameter. Like the manual you mean? The meaning of the word void.... Containing nothing; empty; vacant; not occupied; not filled. Some people need to read a manual about reading manuals. Optional arguments are surrounded by [] brackets. Thats what you get reading an unreliable source. Whoever wrote that also cannot read the manual. Quote Link to comment Share on other sites More sharing options...
DarkWater Posted January 20, 2009 Share Posted January 20, 2009 Traditionally, 'void', when used in function headers, means that nothing gets passed in. Not sure why it says "optional" next to it on W3schools. Regardless, the PHP manual is the best source to rely on for these function prototypes. 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.