CGI Program To Display Current Date Time

Put Your Plan Into Action

CGI Program To Display Current Date Time

Digital Clock Display Program in CGI (Common getway interface)

HTML CODE

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>
<html>
	<head>
		<title>Digital Clock Display Program</title>
	</head>
	<body>
		<form action="http://localhost/bin/digitalclock.cgi" method="post">
			<p>Digital clock<input type="submit" value="click"/></p>
		</form>
	</body>
</html>

CGI Code Actually Code

#! C:\xampp\perl\bin\perl.exe
use CGI':standard';
print "refresh:1\n";($s,$m,$h)=localtime(time);
print "Content-type:text/html\n\n";
print "the system time is $h:$m:$s","<br>";
print "The words $h hours $m minutes $s seconds";

 

Leave a Reply

Your email address will not be published. Required fields are marked *