ghjk 250
Contributor
I want to expire user account in my php application. Below is my code . But i got "mktime() expects parameter 6 to be long, string given in ". Could anyone tell me what is wrong? Please.. -
list($year, $month, $day) = split('[/.-]', $Valid_From);
-
$daystoadd="$Validity_Period";
-
$hours=$daystoadd * 24;
-
$newdate=date("Y-m-d", mktime($hours, 0, 0, $month, $day, $year));
-
$today = date("Y-m-d");
-
if($newdate>$today)
-
{
-
-
}
-
else
-
{
-
You Are Logged in As Guest
-
3 15543 pbmods 5,821
Recognized Expert Expert
Heya, Ghjk.
Cast your values as ints: -
mktime( ..., (int) $year );
-
Hey pbmods;
Ur a genius man... I assure everyone tat this works 100%..
great work dude..
where include it in codigniter code...
mktime( ..., (int) $year );
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Sandman |
last post by:
Hi.
On my Linux RedHat 8 system, I can't obtain dates earlier than 1970 with PHP.
That is, when feeding a function that turns dfates into unixtime, such as
mktime() and strtotime()
print date("Y-m-d", mktime(0,0,0,1,1,1930));
-> "1969-12-31" (since the result of mktime is "-1")
But date() gets it though, so if I do
|
by: Mini Mouse |
last post by:
Hiya folks,
I'm getting the following error(s) below and I'm at a bit of a loss as
to how to correct it. When I give it a parameter it then complains it
needs two parameters and the second one being an integer or something
like that.
Warning: domdocument() expects at least 1 parameter, 0 given in
orders.php on line 157
|
by: Gore |
last post by:
hi,
I tried the following piece of code
long sec = -1;
struct tm date;
date.tm_year = 1995 - 1900;
date.tm_mon = 7 - 1;
date.tm_mday = 16;
date.tm_hour = 0;
date.tm_min = 0;
|
by: John Hanley |
last post by:
I created a function that breaks down a date into broken down time, I
subtract a certain number of seconds from that, then use mktime() to
recompute the calendar time.
It works basically except every so often, I get the date 060207 (Feb 7,
2006) which is obviously not correct. When it does this it always gives me
this date.
I tracked it down to my mktime() call, when I get to a certain date, mktime
returns a number in 4000000000,...
|
by: TJ |
last post by:
I need to be able to pass a pointer to a (managed code) Stream object to a
COM method so it can serialize its data into the stream.
I have a C# application that makes uses of Randolf Duke's MimeSniffer COM
component (http://www.codeproject.com/internet/mimesniffer.asp). My
application (pop3ImageGrabber) uses MimeSniffer to identify each image
attachment in emails that have been collected from a POP3 mailbox.
MimeSniffer gives the...
| |
by: JohnnyGr |
last post by:
I have heard theres a new way to start threads with parameters in
framework 2.0, does anyone know how to do that?
this is what i need to do...
Start a thread that executes some stuff, in this case it does gets all
files from a directory. then i need to update the GUI with information
from the thread...
the thread should be started with a parameter, in this case its a string
|
by: amhjones |
last post by:
Hey I was wondering if anyone could help me with some time code that I am using to determine if a year is a leap year or not. The code I have takes a given year, creates a time structure of the given year, and sets the date to 28th of Febuary, I then need to convert it using mktime(), add the amount of time to move to the next day, then reconvert it in order to take the month and determine whether it is a leap year or not by whether the month is...
|
by: malayappa |
last post by:
Hi All
here is the error what i m getting
Warning: domdocument::domdocument() expects parameter 2 to be long, string given in D:\Program Files\Apache Software Foundation\Apache2.2\htdocs\sample\mssql.php on line 47
Here is My code
<?php
/*session_start();
set_time_limit(0);
error_reporting(E_ALL);*/
|
by: roseple |
last post by:
Hi, can anyone please help me why I got this error every I uploaded files.
Error:
Here is the code on the said warning message:
# Gather all required data
$name = mysql_real_escape_string($dbLink, $_FILES);
$mime = mysql_real_escape_string($dbLink, $_FILES);
$size = $_FILES;
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
| |
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| | |