php-windows Digest 31 Oct 2002 01:37:01 -0000 Issue 1415

Topics (messages 16622 through 16630):

Date Increment Problem
        16622 by: Raheel Hussain
        16623 by: Constantin Baciu
        16624 by: Cam Dunstan
        16628 by: Stephen Edmonds

forms POST help
        16625 by: Richard
        16626 by: Abdolhamid Joukar

POST file transfer
        16627 by: Maris Kalnins

Interesting tidbit
        16629 by: R.S. Herhuth

Using ADO->GetRows methods :: not supported?
        16630 by: ferdhie

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
hi, I m a newbie programmer, may b solve to this prob. is a cheap thing, but i cant 
get solution of it.

i have two variables
$RegisterDate, and $ExpireDate

what I want to do is the the $RegisterDate will be taken from the system. 
but the $ExpireDate will be three days after the $RegisterDate,

i m doing this in the following way, but having problems, i cant find the way to 
increment the data for after three days

$RegisterDate=date("m/d/y");
$ExpireDate=$RegisterDate + 3 //creating problem, 

if the register date is 10/29/01 then the expire date should be 11/2/02.
 
plz help 



---------------------------------
Do you Yahoo!?
HotJobs - Search new jobs daily now
--- End Message ---
--- Begin Message ---
You will need to add the seconds that are in 3 days to the current
timestamp....

Try the following:

$RegisterDate=date("m/d/y", time());
$ExpireDate=date("m/d/y", time()+4320);

"Raheel Hussain" <[EMAIL PROTECTED]> wrote in message
news:20021030110432.9579.qmail@;web21202.mail.yahoo.com...
>
> hi, I m a newbie programmer, may b solve to this prob. is a cheap thing,
but i cant get solution of it.
>
> i have two variables
> $RegisterDate, and $ExpireDate
>
> what I want to do is the the $RegisterDate will be taken from the system.
> but the $ExpireDate will be three days after the $RegisterDate,
>
> i m doing this in the following way, but having problems, i cant find the
way to increment the data for after three days
>
> $RegisterDate=date("m/d/y");
> $ExpireDate=$RegisterDate + 3 //creating problem,
>
> if the register date is 10/29/01 then the expire date should be 11/2/02.
>
> plz help
>
>
>
> ---------------------------------
> Do you Yahoo!?
> HotJobs - Search new jobs daily now


--- End Message ---
--- Begin Message ---
raheel
The method Constantin suggests is a good solution for your problem, but also
have a thorough read of the manual under date functions, there is a lot of
additional useful info there with the use of several of the functions in
unison - for example...

$tomorrow  = mktime (0,0,0,date("m")  ,date("d")+1,date("Y"));
$lastmonth = mktime (0,0,0,date("m")-1,date("d"),  date("Y"));
$nextyear  = mktime (0,0,0,date("m"),  date("d"),  date("Y")+1);

(taken straight from the manual) -
then you will be able to write some handy little functions of your own to do
a lot of these common tasks easily.

A lot of the scripts you write will probably require frequent manipulation
and calculation of date info, expressed as timestamps, user friendly dates,
mysql "datetime" type fields and so on and if you don`t streamline these
jobs sooner rather than later they will drive you nuts.

Time spent now studying the manual and playing with these date functions
will be well spent believe me.  Writing a simple calender program is a good
way to get used to the sometimes tricky date issues, leap years, 29th
Feburary, "tomorrow, "next week", "6 months time"  etc etc etc.

cheers and good luck, CD


----- Original Message -----
From: "Raheel Hussain" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 10:04 PM
Subject: [PHP-WIN] Date Increment Problem


>
> hi, I m a newbie programmer, may b solve to this prob. is a cheap thing,
but i cant get solution of it.
>
> i have two variables
> $RegisterDate, and $ExpireDate
>
> what I want to do is the the $RegisterDate will be taken from the system.
> but the $ExpireDate will be three days after the $RegisterDate,
>
> i m doing this in the following way, but having problems, i cant find the
way to increment the data for after three days
>
> $RegisterDate=date("m/d/y");
> $ExpireDate=$RegisterDate + 3 //creating problem,
>
> if the register date is 10/29/01 then the expire date should be 11/2/02.
>
> plz help
>
>
>
> ---------------------------------
> Do you Yahoo!?
> HotJobs - Search new jobs daily now

--- End Message ---
--- Begin Message ---
Firstly, you need to understand time.

Time in computers is stored as the number of seconds since January 1st,
1970. The time now is 1035999078 (Or to humans, 17:31:30 on the 30th Oct).
When you call the current time with time() it returns that long number
above. You can then add on 1 days worth of seconds to figure out when
tommorow is

$CurrentTime = time();
$TommorowTime = $CurrentTime + ( 60 * 60 * 24 * 3 );

You can then use date() to transform that number in to human form

$HumanDate = date( d/n/y H:i, $TommorowTime );
print $HumanDate;

Hope this helps

Stephen

----- Original Message -----
From: "Raheel Hussain" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 11:04 AM
Subject: [PHP-WIN] Date Increment Problem


>
> hi, I m a newbie programmer, may b solve to this prob. is a cheap thing,
but i cant get solution of it.
>
> i have two variables
> $RegisterDate, and $ExpireDate
>
> what I want to do is the the $RegisterDate will be taken from the system.
> but the $ExpireDate will be three days after the $RegisterDate,
>
> i m doing this in the following way, but having problems, i cant find the
way to increment the data for after three days
>
> $RegisterDate=date("m/d/y");
> $ExpireDate=$RegisterDate + 3 //creating problem,
>
> if the register date is 10/29/01 then the expire date should be 11/2/02.
>
> plz help
>
>
>
> ---------------------------------
> Do you Yahoo!?
> HotJobs - Search new jobs daily now


--- End Message ---
--- Begin Message ---
i have php4 up and running, but whenever i POST an html form to a php page i
always get a 404 error message, even though the php page is present.

Can anyone help?


--- End Message ---
--- Begin Message ---
hi
 if you are running your script on your computer your form action should be
like this
 <form action="http://localhost/file.php>
else
if you are testing your script on the net may be your host have a directory
that named cgi-bin
your php files should be placed there!
thanks
----- Original Message -----
From: "Richard" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 5:11 PM
Subject: [PHP-WIN] forms POST help


> i have php4 up and running, but whenever i POST an html form to a php page
i
> always get a 404 error message, even though the php page is present.
>
> Can anyone help?
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi guys!

The situation is following:

I need to transfer a file from one server to another by POST
method. Goal server has a getfile.php script that actually
is placing the file in temp directory for further opening and reading
using fopen(..)

the thing i cannot get into is how to send from one php script
(without any forms) to another a file and get this filename and
the file itself out of some POST variables in getfile.php

could somebody explain me this?

Thanks

P.S. I saw some partially and poor documented info about using
curl, but the whole picture didnt come clear!


--- End Message ---
--- Begin Message ---
We are running Tomcat and PHP under IIS on Windows 2k sp2.  While we
were watching the memory manager we noticed that whenever PHP was
invoked Tomcat's memory increased by about 5mb.  This was consistent
over about a half an hour, we have no reason to believe that it hasn't
been occuring like this since we have been using both on the same server
(about 2 months).  PHP has been very stable although the same cannot be
said about Tomcat, but that's another issue.

Specifically my question is why would the Tomcat memory increase while
it should be steady when PHP is invoked?

Ron
--- End Message ---
--- Begin Message ---
Hi peoples,..
This is my first post here, so if problems like this,
please notify me,...

My problem is like this.
I;ve read the manual, -- the CHM version,

It;s about the COM object.
I've try to query an access database using PHP.
So far it works fine.

The only problems is that when i tried to
use the GetRows method, it start complaining.

This is the error when executed
Warning:  Unsupported: multi-dimensional (2) SafeArrays in
C:\Apache\htdocs\www\test.php on line 19

The error seems to be pointing at the GetRows, and the result of
getrows that
maybe not supported in PHP. I know there;s a workaround of these kind
of problems
when using Javascript under ASP -- using the enumerator object.

My question : How bout PHP? Is there any workaround instead of getting
the result
by iterating one by one line in the manuals?

btw, here's the code:
<?php

/** Create An Ado COM object **/
$conn = new COM("ADODB.Connection") or
    die("Cannot Create ADO Object");

/** Define the datasource names **/
$dsn = "Provider=Microsoft.Jet.OLEDB.3.51;
Data Source=C:\\Program Files\\Microsoft Visual
Studio\\VB98\\Biblio.mdb";

/** open the connection here **/
$conn->Open($dsn);

/** Execute the sql query **/
$rs = $conn->Execute("SELECT * FROM Authors");

/** Get All The result rows **/
$result = $rs->GetRows();

/** Test if its there , Should be an array **/
print_r($result);

/** close the recordset and the connection **/
$rs->Close();
$conn->Close();

/** release the com **/
$rs->Release();
$conn->Release();

/** make sure that it was clean **/
$rs = null;
$conn = null;

?>

thanks,....



=====
eval(preg_replace("/x/xis","print",/** ferdhie | be-different **/
'x"Just ";eval(\'x"Another ";x"PHP ";eval("x\"Hacker,\";");\');'));

__________________________________________________
Do you Yahoo!?
HotJobs - Search new jobs daily now
http://hotjobs.yahoo.com/
--- End Message ---

Reply via email to