Create web page to be used for storing software development

Assignment Help Computer Engineering
Reference no: EM131270133

In this project, you will create a Web page that allows visitors to your site to sign a guest book that is saved to a database.

1. Create a new document in your text editor and type the

<!DOCTYPE>
declaration,
<html>
element, document head, and
<body>
element. Use the strict DTD and "Guest Book" as the
content of the
<title>
element.

2. Add the following text and elements to the document body:

<h2>Enter your name to sign our guest book</h2>
<form method="POST" action="SignGuestBook.php">
<p>First Name <input type="text" name="fi
rst_name"
/></p>
<p>Last Name <input type="text" name="last_name"
/></p>
<p><input type="submit" value="Submit" /></p>
</form>

3. Save the document as

GuestBook.html
in the Projects
directory for Chapter 8.

4. Create a new document in your text editor and type the

<!DOCTYPE>
declaration,
<html>
element, document head, and
<body>
element. Use the strict DTD and "Sign Guest Book" as the content of the
<title>
element.

5. Add the following script section to the document body:

<?php
?>

6. Add the following statements to the script section to ensure that visitors enter their first and last names:

if (empty($_POST['fi
rst_name']) || empty($_
POST['last_name']))
echo "<p>You must enter your fi
rst and last
name! Click your browser's Back button to
return to the Guest Book form.</p>";

7. Add the following statement to the script section to connect to the database. Replace Host with the host name of your MySQL server, and
User and password with the MySQL user name and password you created in Chapter 7.

else {
$DBConnect = @mysql_connect("
host
", "
user
",
"
password
");
if ($DBConnect === FALSE)
echo "<p>Unable to connect to the database
server.</p>"
. "<p>Error code " . mysql_errno()
. ": " . mysql_error() . "</p>";

8. Add the following statements to the end of the script section to create a database named Guestbook if it does not already exist:

else {
$DBName = "guestbook";
if (!@mysql_select_db($DBName, $DBConnect)) {
$SQLstring = "CREATE DATABASE $DBName";
$QueryResult = @mysql_query($SQLstring,
$DBConnect);
if ($QueryResult === FALSE)
echo "<p>Unable to execute the
query.</p>"
. "<p>Error code " . mysql_
errno($DBConnect)
. ": " . mysql_error($DBConnect)
. "</p>";
else
echo "<p>You are the first visitor!</p>";
}
mysql_select_db($DBName, $DBConnect);

9. Add the following statements to the end of the script section to create a table named Count if it does not already exist. The table consists of a single auto-incrementing primary key field named countID
$TableName = "visitors";
$SQLstring = "SHOW TABLES LIKE '$TableName'";
$QueryResult = @mysql_query($SQLstring, $DBConnect);
if (mysql_num_rows($QueryResult) == 0) {
$SQLstring = "CREATE TABLE $TableName
(countID SMALLINT
NOT NULL AUTO_INCREMENT PRIMARY KEY,
last_name VARCHAR(40), fi
rst_name VARCHAR(40))";
$QueryResult = @mysql_query($SQLstring,
$DBConnect);
if ($QueryResult
===
FALSE)
echo "<p>Unable to create the table.</p>"
. "<p>Error code " . mysql_
errno($DBConnect)
. ": " . mysql_error($DBConnect) .
"</p>";
else
echo "<p>You are the first visitor!</p>";
}
mysql_select_db($DBName, $DBConnect);

10. Add the following statements to the end of the script section to create a table named Count if it does not already exist. The table consists of a single auto-incrementing primary key field named counted .

$TableName = "visitors";
$SQLstring = "SHOW TABLES LIKE '$TableName'";
$QueryResult = @mysql_query($SQLstring, $DBConnect);
if (mysql_num_rows($QueryResult) == 0) {
$SQLstring = "CREATE TABLE $TableName
(countID SMALLINT
NOT NULL AUTO_INCREMENT PRIMARY KEY,
last_name VARCHAR(40), fi
rst_name VARCHAR(40))";
$QueryResult = @mysql_query($SQLstring,
$DBConnect);
if ($QueryResult
===
FALSE)
echo "<p>Unable to create the table.</p>"
. "<p>Error code " . mysql_
errno($DBConnect)
. ": " . mysql_error($DBConnect) .
"</p>";

11. Finally, add the following statements to the end of the script section. These mysql_query() statements add the visitor to the database. The last statement closes the database connection.

$LastName = stripslashes($_
POST['last_name']);
$FirstName = stripslashes($_
POST['fi
rst_name']);
$SQLstring = "INSERT INTO $TableName
VALUES(NULL, '$LastName',
'$FirstName')";
$QueryResult = @mysql_
query($SQLstring, $DBConnect);
if ($QueryResult === FALSE)
echo "<p>Unable to execute the query.</p>"
. "<p>Error code " . mysql_
errno($DBConnect)
. ": " . mysql_
error($DBConnect) . "</p>";
else
echo "<h1>Thank you for signing our guest book!</h1>";
}
mysql_close($DBConnect);
}
}

12. Save the document as SignGuestBook.php in the Projects directory for Chapter 8. Upload both SignGuestBook.php and GuestBook.html to the server.

13. Open GuestBook.html in your Web browser by entering the following URL:
https://<yourserver>/PHP_Projects/
Chapter.08/Projects/GuestBook.html
Test the form to see if you can add your name to the database.

14. Close your Web browser window.

Create a Web page to be used for storing software development bug reports in a MySQL database. Include fields such as product name and version, type of hardware, operating system, frequency of occurrence, and proposed solutions. Include links on the main page that allow you to create a new bug report and update an existing bug
report.

Reference no: EM131270133

Questions Cloud

Plan calls for an aggressive growth plan : The organization's strategic plan calls for an aggressive growth plan, requiring investment in facilities and equipment, growth in productivity, and labor over the next five years. It is your team's task to determine where, outside the United Stat..
Probability that doctor will spend less than 1 hour : For a particular doctor, the length of time (in hours) spent with a patient per office visit has the probability density function- What is the probability that this doctor will spend less than 1 hour with a randomly selected patient?
Evaluate the profit for this range of unit rentals : The weekly price at an extended-stay hotel (renting by the week for business travelers) is $950. Operating costs average $20,000 per week, regardless of the number of rooms rented. Construct a spreadsheet model to determine the profit if 40 rooms are..
Create web page to be used for storing software development : Create a Web page to be used for storing software development bug reports in a MySQL database. Include fields such as product name and version, type of hardware, operating system, frequency of occurrence, and proposed solutions.
Eliminating a ton of pollution for municipal energy : Suppose the cost of eliminating one ton of pollution for People's Electric is $500 and the cost of eliminating a ton of pollution for Municipal Energy is $450. What is the total cost of each utility eliminating 50 tons of pollution?
What is the delay for the following types of 64-bit adders : Assume that each two-input gate delay is 150 ps and that a full adder delay is 450 ps.
What is the probability that this doctor will spend : Illustrate Problem geometrically. Describe the geometric interpretation.- What is the probability that this doctor will spend less than 1 hour with a randomly selected patient?
How can the current distribution plan be improved : How can the current distribution plan be improved? Would the savings in costs justify changing the established relations between the Ankara-Bursa and IstanbulAntalya brewery-distributor pairs? What should be the annual cost of shipping 1 million lite..

Reviews

Write a Review

Computer Engineering Questions & Answers

  How thorough valid and valuable were the product and

bizratenbsp instantly provides information about hundreds of online stores. supported product lines include books

  Establish separation of duties via role assignment

Setting security for each employee based on the specific role provides the tightest and most personalized security. The trade-off is increased amount of administration effort when setting up the specific roles to use and the access permitted for ea..

  What cryptographic technology is used to verify an identity

What cryptographic technology is used to verify an identity and provide asurance that encryption keys provided in a message belongs to the verified individual?

  Question1 write down an sql statement to show tables owned

question1. write down an sql statement to show tables owned by user newyear. 2. write down an sql statement to show the

  What is joptionpane class or the scanner class

What is JOptionPane class or the Scanner class

  Read the case study titled a patient information system

read the case study titled a patient information system for mental health care located in chapter 1 of your textbook.

  Create a set of use cases for an online registration system

Create a set of use cases for an online university registration system. The system should enable the staff of each academic department to examine the courses offered by their department.

  Analyze the functionality of broadband

Analyze the functionality of broadband and related transmission methodologies. To accomplish the outcome, research standards and broadband vendors.

  Performance clause in the license agreement

Explain why is it significant to have the performance clause within the license agreement?

  Use an appropriate parameter passing mechanism

Use an appropriate parameter passing mechanism. Your function will not do any cin or cout. Do not write a main function. Make sure to properly format all your code.

  Bit binary counter utilizing ltl.

State the three bit counter utilizing the LTL. The following are the properties we may wish to try and prove are valid given the specification of the three bit counter. Eventually the counter reaches 111.

  Explore a computer technology

ITD102: Computer Technology Fundamentals Module: Mini-Project. The objective of the project is to explore a computer technology beyond that covered in the practical's and lecture. It is not expected that you will build and program a new computer sy..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd