Printing a greeting or printing a form : strftime « Date « PHP






Printing a greeting or printing a form

 
<?php
if ($_POST['user']) {
    print "Hello, ";
    print $_POST['user'];
    print "!";
} else {
    print <<<_HTML_
<form method="post" action="$_SERVER[PHP_SELF]">
Your Name: <input type="text" name="user">
<br/>
<input type="submit" value="Say Hello">
</form>
_HTML_;
}
?>
  
  








Related examples in the same category

1.Checking for the day of the week
2.Format Characters Used by the strftime() Function for Day
3.Format Characters Used by the strftime() Function for Formatting Characters
4.Format Characters Used by the strftime() Function for Full Date and/or Time
5.Format Characters Used by the strftime() Function for Hour
6.Format Characters Used by the strftime() Function for Minute
7.Format Characters Used by the strftime() Function for Month
8.Format Characters Used by the strftime() Function for Second
9.Format Characters Used by the strftime() Function for Week
10.Format Characters Used by the strftime() Function for Year
11.strftime.php
12.Generating the days in a month
13.Generating the days in a week
14.Finding days of the week, month, and year
15.Finding the current date and time
16.Printing a formatted date string with strftime()
17.Printing a formatted time string with other text
18.Skip ahead one day to the Tuesday after the first Monday