Re: [PHP] Date comparison going wrong, wrong, wrong

2012-11-12 Thread Kanishka
if we use a date after 19 January 2038, we can not use 'strtotime' to get
timestamp.
http://en.wikipedia.org/wiki/Year_2038_problem


On Mon, Nov 12, 2012 at 3:36 PM, Duken Marga  wrote:

> Try this:
>
> $todaydate = strtotime(date("D, M jS, Y g:i:s a"));
> $showenddate = strtotime(date("D, M jS, Y g:i:s a",
> strtotime($showsRecord['end_date'])));
>
> if ($todaydate < $showenddate):
> echo "The date of the show has not yet arrived";
> else:
> echo "The show has ended";
> endif;
>
> You must convert both $todaydate and $showendate with strtotime() function,
> then you can compare them.
>
> On Mon, Nov 12, 2012 at 1:30 AM, Terry Ally (Gmail)  >wrote:
>
> > Hi all,
> >
> > I am having a problem with comparing time. I am using the following:
> >
> > $todaydate = date("D, M jS, Y g:i:s a");
> > $showenddate = date("D, M jS, Y g:i:s a",
> > strtotime($showsRecord['end_date']));
> >
> > if ($todaydate > $showenddate):
> > echo "The date of the show has not yet arrived";
> > else:
> > echo "The show has ended";
> > endif;
> >
> > The problem that I am encountering is that PHP is rendering the reverse
> of
> > the equation. For example:
> >
> > If today's date is *11 Nov 2012* and the show's end date is *18 Nov
> 2012*,
> > the message that I am getting is *the show has ended* which is wrong. A
> > test example is at http://www.lakesidesurrey.co.uk/test.php.
> >
> > You can also me what I am doing wrong?
> >
> > Thanks
> > Terry
> >
>
>
>
> --
> Duken Marga
>


[PHP] XML array

2011-07-05 Thread Kanishka
hi this is my first post on php general mailing list, i want to read a xml
file to retrieve data. i tried by using "DOM" and "simple xml" but i
couldn't.
the xml file looks like this..

*

   the the title
   7-6-2011




book 1
author 1



book 2
auther 2



*

i want to put both "name" and "author" values in a multy dimensional array.
what dimension is suitable? what should i do for resolve my problem?
thanks.


[PHP] NuSOAP

2011-08-04 Thread Kanishka
NuSOAP

Hi, I am learning “SOAP web services” using “NuSOAP” I tried to
execute hello world program, but it didn’t work. When I execute the
server script It generate the wsdl without giving any warning or
error. But when I execute the client it gives following message.

” Warning: SoapClient::SoapClient(http://localhost/nusoap/server.php?wsdl)
[soapclient.soapclient]: failed to open stream: A connection attempt
failed because the connected party did not properly respond after a
period of time, or established connection failed because connected
host has failed to respond. in E:\xampp\htdocs\nusoap\client.php on
line 5

Warning: SoapClient::SoapClient() [soapclient.soapclient]: I/O warning
: failed to load external entity
"http://localhost/nusoap/server.php?wsdl"; in
E:\xampp\htdocs\nusoap\client.php on line 5

Fatal error: Maximum execution time of 60 seconds exceeded in
E:\xampp\htdocs\nusoap\client.php on line 10
*
.I have attached “client.php” and “server.php”.

server.php
**
“configureWSDL('hellowsdl', 'urn:hellowsdl');
// Register the method to expose
$server->register('hello',// method name
array('name' => 'xsd:string'),// input parameters
array('return' => 'xsd:string'),  // output parameters
'urn:hellowsdl',  // namespace
'urn:hellowsdl#hello',// soapaction
'rpc',// style
'encoded',// use
'Says hello to the caller'// documentation
);
// Define the method as a PHP function
function hello($name) {
return 'Hello, ' . $name;
}
// Use the request to (try to) invoke the service
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : '';
$server->service($HTTP_RAW_POST_DATA);
?>
*”
client.php
*
http://localhost/nusoap/server.php?wsdl";);
// Call the SOAP method
$result = $client->call('hello', array('name' => 'Scott'));
// Display the result
print_r($result);
?>
***
This examples is taken from the
http://www.scottnichol.com/nusoapprogwsdl.htm
can anybody tell me what’s wrong with this code.

Thank you
<>
<>
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] detect file upload time

2011-10-04 Thread Kanishka
hi everybody,
is any method available for detect file upload time in a php script ?
or detect network connections upload speed.
i'm using php 5.3.5(xampp 1.7.4) and my os is windows 7.
thank you
regards
kanishka