Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a 5 page site that represents the home page of any business, museum, or n

ID: 3682980 • Letter: C

Question

Create a 5 page site that represents the home page of any business, museum, or non-profit of your choice.

the website must cover (HTML, CSS, JS and PHP)

The number of dynamic Web pages must be at least 4 The Web Site must connect to a database

Navigation (Links are clear and located in the same area on each page. All links are functional)

Client side dynamic behavior using JavaScript (forms and event handler,)

Design (using CSS)

Dynamic Web pages (PHP)

Communication with Data Base (select and Update)

Explanation / Answer


<html>
<head>
<style>
#header
{
background-color: 0099FF;
color:white;
text-align:center;
padding:2px;
height: 100px;
}
body{
background-repeat:no-repeat;
background-size:cover;
}
</style>
<script>
   var d = new Date(<?php echo time() * 1000 ?>);
function updateClock() {
  // Increment the date
  //alert("entered");
  
  d.setTime(d.getTime() + 1000);
  // Translate time to pieces
  var currentHours = d.getHours();
  var currentMinutes = d.getMinutes();
  var currentSeconds = d.getSeconds();
  // Add the beginning zero to minutes and seconds if needed
  currentMinutes = (currentMinutes < 10 ? "0" : "") + currentMinutes;
  currentSeconds = (currentSeconds < 10 ? "0" : "") + currentSeconds;
  // Determine the meridian
  var meridian = (currentHours < 12) ? "am" : "pm";
  // Convert the hours out of 24-hour time
  currentHours = (currentHours > 12) ? currentHours - 12 : currentHours;
  currentHours = (currentHours == 0) ? 12 : currentHours;
  // Generate the display string
  var currentTimeString = currentHours + ":" + currentMinutes + ":" + currentSeconds + " " + meridian;
// alert(currentTimeString);
  // Update the time
  document.getElementById("clock").firstChild.nodeValue = currentTimeString;
  
}
window.onload = function() {
  updateClock();
  setInterval('updateClock()', 1000);
}
<div id="clock">&nbsp;</div>
</script>
</head>
<body background="background.jpg">
<div id="header">
<h1>welcome </h1></br>
</div>
<?php
$server='localhost';
$user='root';
$pwd='';
$con=mysql_connect($server,$user,$pwd);
$name=$_POST['t1'];
$pwd=$_POST['t2'];
$x=mysql_select_db("mydb",$con);
$sql1="select * from login where uname='$name' and pswd='$pwd'";
$res1=mysql_query($sql1);
if(mysql_num_rows($res1)==1)
{
echo "successfully logged in,click here ";
?>
</br></br></br></br>
<a href="home.html"><button>hello</button></a>
<?php
}
else
{
echo "register first";
?>
<a href="register.html"><button>register</button></a></br>
<a>existing user ? recheck username and password</a></br>
<a href="home1.html"><button>login</button></a>
<?php
}
mysql_close($con);
?>
</body>
</html>