Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Substituting a number in a Date edit script 1

Status
Not open for further replies.

krappleby025

Programmer
Sep 6, 2001
347
NL
Hi all.

Please see below,

$nextpaydue2 = date('Y-m-d h:i:s', strtotime('+3 month', strtotime($DateNextPayment)));

I am using this line on one of my sites, and have changed the way the time is set.. Now it is possible to increase the time by any number of months..

at the moment the above is set at +3 monhts, I need to do it so that i can set any period..

for instance, i have tried

$nextpaydue2 = date('Y-m-d h:i:s', strtotime('+$Number_months month', strtotime($DateNextPayment)));

$nextpaydue2 = date('Y-m-d h:i:s', strtotime('+" . $Number_months . " month', strtotime($DateNextPayment)));

and many other variables, but none seem to work


 
Have you tried...

Code:
[blue]
[red]$myTime = "+$Number_months month";[/red]

$nextpaydue2 = date('Y-m-d h:i:s', strtotime([red]$myTime[/red], strtotime($DateNextPayment)));
[/blue]

~Ron

cout << "If you don't know where you want to go, we'll make sure you get taken";
 
Thanks very much that helped greately

cheers

I do have one more question

i have almost finished what i am doing and would be grateful if you or anyone else can answer this question

I have a php page.. Which retrieves data from a db and produces a page with a list of links

now i need to include that page on other websites. some sites are ASP, some are PHP and some are basic HTML,

i was thinking on using javascript to include the php page. however when i try i get a script error...

Any ideas
 
Interesting,

Not really sure if this would be a solution because I am confused on what you are asking,but...
Have the php write an HTML page with the links on it and everytime the php links are update the html page is rewritten and the other scripts use that.

-Ron

cout << "If you don't know where you want to go, we'll make sure you get taken";
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top