Monday, 18 November 2019

2. processed form


Target: Create a response page which shows result of  submitting customer form.

After Submission we wish to show order result, for that purpose we make a another below page for order proceed result.
<html>
<head>
<title>Form Proceed</title>
</head>
<body>
<h1>Anika Stationery</h1>
<h2>Order result</h2>
<h5>Order Processed</h5>

</body>
</html>
 Save as processedform.php
But html is a static language, so in that above case ( <h5>Order Processed</h5>) always shows order proceed eithr it has done or not .
So, here we use php statement to show order result “Order Processed”.
So instead upper code you should use

<html>
<head>
<title>Form Proceed</title>
</head>
<body>
<h1>Anika Stationery</h1>
<h2>Order result</h2>
<?php
echo "order Proceed";
?>
</body>
</html>

Now we want to add dynamic content in program like show date and time .
So here we have to edit above php code. (editing Shows in blue colour in below code).
<html>
<head>
<title>Form Proceed</title>
</head>
<body>
<h1>Anika Stationery</h1>
<h2>Order result</h2>
<?php
echo "order Proceed at ";
echo date("l jS \of F Y h:i:s A");
?>
</body>
</html>

Here,
H presents : 24 hour
I presents : minute  with leading zero if required.
J presents: day of the month without a leading zero
S: presents ordinal suffix(th)
F: presents full name of month.

Output:

Anika Stationery

Order result

order Proceed at11:28,1823,November


No comments:

Post a Comment

Ch-16 Associate Array