5. Don\'t do anything with “add.php” – this will happen in an exercise! code for
ID: 3808564 • Letter: 5
Question
5. Don't do anything with “add.php” – this will happen in an exercise!
code for project 1 :
<!DOCTYPE html>
<html>
<head>
<title>Argo Address - Keep your addresses safe</title>
<meta charset="UTF-8">
<style type="text/css">
body { background:teal; color:black }
h1 { font-family:Lucida,Arial,sans-serif;
font-weight:bold }
p{ color:black; text-align:left }
.important { color:black; font-weight:bold }
body { text-align; center; margin: 0px; padding: 0px }
#wrapper { width: 1000px; height: 1000px; margin-left: auto; margin-right: auto }
</style>
</head>
<body>
<div id="wrapper">
<h1>Argo Address</h1>
<img src="http://uwf.edu/media/university-of-west-florida/style-assets/newhomepage/images/UWF-Athletics_Logo.svg" width="220" height="277" alt="Argo Logo">
<p> Argo Address is an application that allows you to simply keep all your contacts and valuable information into one safe location. This state of the art application will enable you to add addresses, logout, edit, install or remove features and quickly look up anyones address information with a simple quick search. ENJOY!</p>
<p> To begin create an account or log in.</p>
<p class="important" >Create an account if you do not already have one:</p>
<form>
<p> User Name: <input type="" Name="" value=""> </p>
<p> Password: <input type="" Name="" value=""> </p>
<p> Repeat Password: <input type="" Name="" value=""> </p>
<input type="submit" value="Submit">
<form>
<p class="important" > Please log into your account: </P>
<form>
<p> User Name: <input type="" Name="" value=""> </p>
<p> Password: <input type="" Name="" value=""></p>
<input type="submit" value="Submit">
<br>
</form>
</body>
</html>
Explanation / Answer
index.html
<!DOCTYPE html>
<html>
<head>
<title>Argo Address - Keep your addresses safe</title>
<meta charset="UTF-8">
<style type="text/css">
body { background:teal; color:black }
h1 { font-family:Lucida,Arial,sans-serif;
font-weight:bold }
p{ color:black; text-align:left }
.important { color:black; font-weight:bold }
body { text-align; center; margin: 0px; padding: 0px }
#wrapper { width: 1000px; height: 1000px; margin-left: auto; margin-right: auto }
</style>
</head>
<body>
<div id="wrapper">
<h1>Argo Address</h1>
<img src="http://uwf.edu/media/university-of-west-florida/style-assets/newhomepage/images/UWF-Athletics_Logo.svg" width="220" height="277" alt="Argo Logo">
<p> Argo Address is an application that allows you to simply keep all your contacts and valuable information into one safe location. This state of the art application will enable you to add addresses, logout, edit, install or remove features and quickly look up anyones address information with a simple quick search. ENJOY!</p>
<p class="important" > Please log into your account: </P>
<form action="" method="POST" >
<p> User Name: <input type="text" Name="username" value=""> </p>
<p> Password: <input type="password" Name="password" value=""></p>
<input type="submit" value="Submit">
<br>
</form>
</body>
</html>
validate.php
<?php
if(isset($_POST["username"])&&($_POST["password"])){
$username=$_POST['username'];
$password=$_POST['password'];
$con=mysql_connect('localhost','root','')or die(mysql_error());
mysql_select_db('database_name') or die("cannot select db");
//get data from db
//$db_password is password of the entered username from the database
if($password==$db_password )
{
echo "Hello, $username";
echo "<a href="menu.php">Go to menu</a>"
}
else
{
header("Location:index.html");
}
?>
menu.php
<?php
echo "Please Select:";
echo "<a href="show.php">Show Contacts</a>";
echo "<a href="add.php">Add Contacts</a>";
echo "<a href="index.html">Logout</a>";
?>
show.php
<?php
$con=mysql_connect('localhost','root','')or die(mysql_error());
mysql_select_db('database_name') or die("cannot select db");
//get the data from the db
echo "<table border="1">";
echo"<tr><th>Name</th><th>Email></th><th>Phone</th></tr>";
echo"<tr><td>"Get the data from the db"</td><td>"Get the data from the db"</td><td>"Get the data from the db"</td></tr>";
echo"<tr><td>"Get the data from the db"</td><td>"Get the data from the db"</td><td>"Get the data from the db"</td></tr>";
echo"<tr><td>"Get the data from the db"</td><td>"Get the data from the db"</td><td>"Get the data from the db"</td></tr>";
echo "<td>";
echo"< d>"
echo"</tr>";
echo "</table>";
?>
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.