Another PHP problem need help solving

SpaceshipSpaceship
Watch

tech4

Established Member
Impact
160
New problem please see below.

Warning: mktime() expects parameter 1 to be long, string given in /file.php on line 328

Warning: Cannot modify header information - headers already sent by (file.php:328) in file.php on line 483

basically it will not proceed. For some reason.
 
Last edited:
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
What does the error mean? I need to know to fix it.

Warning: mktime() expects parameter 1 to be long, string given in /file.php on line 328

Warning: Cannot modify header information - headers already sent by (file.php:328) in file.php on line 483

Here's line 328 $date2 = mktime($tmpTime[0],$tmpTime[1],$tmpTime[2],$tmpDate[1],$tmpDate[2],$tmpDate[0]);
Here's line 483 header("Location:../file.php?Err=1");

---------- Post added at 05:21 PM ---------- Previous post was at 05:03 PM ----------

Here's some more if this will help

$insertime=$row_list['dateCreated'];
}
$date1 = time();
$dat = explode(" ",$insertime);
$tmpDate = explode("-", $dat[0]);
$tmpTime = explode(":", $dat[1]);
$date2 = mktime($tmpTime[0],$tmpTime[1],$tmpTime[2],$tmpDate[1],$tmpDate[2],$tmpDate[0]);
$dateDiff = $date1 - $date2;
$fullMinutes = floor(($dateDiff-($fullDays*60*60*24)-($fullHours*60*60))/60);
$query = "SELECT minutes FROM user_register WHERE id='$user_id'";
$q2=mysql_query($query) or die(mysql_error());
$minutes=mysql_fetch_array($q2);
if($fullMinutes > ((int)$minutes[0])&& $minutes[0]!='0') {

---------- Post added at 05:30 PM ---------- Previous post was at 05:21 PM ----------

Someone suggested to change it to :


$date2 = mktime((int)$tmpTime[0],(int)$tmpTime[1],(int)$tmpTime[2],$tmpDate[1],$tmpDate[2],$tmpDate[0]);

Good?
 
Last edited:
0
•••
yeah its saying that the variables your passing are not intervals, but are strings you can cast them to intervals with the method you mentioned.
 
0
•••
You can't send header information if you have already rendered content. If you want to do this use output buffering/control or store the contents to be outputted in an internal cache and release the contents of the cache at the end of the script.

PHP: Output Control
 
0
•••
0
•••
Thanks everyone. Problem solved. (I don't know how) but programmer said its solved.

I will check back.
 
0
•••
yeah its saying that the variables your passing are not intervals, but are strings you can cast them to intervals with the method you mentioned.

Just to pull you up on this, they are not called intervals they are actually called integers (also known as int)

---------- Post added at 08:08 PM ---------- Previous post was at 08:07 PM ----------

You can't send header information if you have already rendered content. If you want to do this use output buffering/control or store the contents to be outputted in an internal cache and release the contents of the cache at the end of the script.

PHP: Output Control


The only reason he was getting the header error message is becuase of the error message that PHP had output regarding the mktime issue.
 
0
•••
Because that things are just warnings, you can put the function in your php page to stop error reporting, just for "warnings" or "notices"
 
0
•••
correct but for a production envronment you should use:

error_reporting(0);

This will stop almost all errors however while in development best having:

error_reporting(E_ALL);

and to fix any errors (even warnings and notices). Those warnings and notices are there for a reason.
 
0
•••
Appraise.net

We're social

Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back