Jump to content

calculate date


b3nky

Recommended Posts

Hello!

 

first of sorry if similar thread exist. i'm little bit in hurry, i have exam on wednesday. this is beginner question.

 

i'm working on some jqm site (ovulation calculation calendae).

 

i have a form in which user enters in first field number (days of cycle)

in second one enters the date from calendar. the date is in format y-m-d

 

my problem is how to manage in php, so he can take days of cycle and add it to date chosen by user?

 

this is my current progress...i know it looks simple to you...but this is my beginning.

 

<form action="php.php" method="post">
		<label for="slider-0">Cycle:</label>
		<input type="range" name="slider" id="slider-0" value="30" min="20" max="40" />
		<label for="defcal">Beginning of last menstrual cycle?</label><input name="defcal" type="date" data-role="datebox" id="defcal" data-options='{"mode": "calbox"}'/>
		<input type="submit" value="Calculate" />
	</form>

 

<?php

$ciklus= $_POST["slider"];
$zciklus= $_REQUEST["defcal"];
$zciklus= strtotime($zciklus);

$ciklus= date('d');
$datum= date('d-M-y	', strtotime("+10 days"));

echo "Cycle value is bla bla bla: ".$ciklus . "days.<br>";
?>

 

 

Thank you!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.