TIME NOW
World current time now,
CALENDAR
Calendar monthly, yearly
login GOLD PRICE, RATE
login HOROSCOPE
login DICTIONARIES, LISTS
login SCIENCE EDUCATION RELIGION
login FINANCE, BUSINESS
login WORLD COUNTRIES, WIKI

PHP scripts, code, examples, tutorial

Previous articlePage bottomNext article  ALL TOPICS

PHP. Date, time. Year link's menu and form

 
<?php

extract ($_GET);
$id = (int) $id ;

if (! $id) $id = 5;

?>

<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="get">
month<BR>
<input type="text" name="month" value="<?php echo $month; ?>"><br>
day<BR>
<input type="text" name="day" value="<?php echo $day; ?>"><br>
year<BR><input type="text" name="year" value="<?php echo $year; ?>"><br>
step<br>
<input type="text" name="id" value="<?php echo $id; ?>">
<br>
<input type="submit" value = "OK" ><br>
</form><br>
Datos tikrinimas:

<?php

if ($month && $day && $year) {
if ([email protected]($month,$day,$year)) {
die ("Bloga data.");
}
$dayMod=$day - $id;
$idMod =$id;
$id =$id *2;
for ($i = 0; $i <= $id; $i++) {

$cur = mktime(0,0,0,$month,$dayMod+$i,$year);

//echo "<br>" . $cur . "<br>", strtotime ("$year-$month-$day");
if ($cur == strtotime ("$year-$month-$day")){

$b_b = "<B>";
$b_e = "</B>";

}else{

$b_b = "";
$b_e = "";

}

$row = "month=" . date("m", $cur) . "&year=" . date("Y", $cur). "&day=" . date("d", $cur) . "&id=$idMod" ;
echo "$b_b <a href = \"{$_SERVER['PHP_SELF']}?$row\">". date("d-m-Y", $cur) . "$b_e</a>\n";

}

}else {

echo "dar nepasirinkta data";

}

?>

 
Previous articlePage topNext article  ALL TOPICS



 Use username: Guest, Anonymous, Programmer






QUOTES:
Carlyle said, 'A lie cannot live'; it shows he did not know how to tell them.
Mark Twain
One must love a cat on its own terms.
Peter Gray
... focus on the journey, not the destination. Joy is found not in finishing an activity but in doing it.
Greg Anderson