Question

1. In MySQL, build the necessary tables to store the information required during the blog posting...

1.

In MySQL, build the necessary tables to store the information required during the blog posting process.

2.

In PHP, write the functions that will enable the capturing of the new post and store in the database.

3.

In HTML, build the minimally functional form to capture the new post.

4.

In PHP, perform the necessary verification of compliance with constraints you decided upon. Before you code, decide and diagram every detail of the user experience such as: size of post, language filters, the inclusion of add-on HTML editors, etc.

5.

Based on the desired interaction and data captured, build the MySQL tables to store this information and enable the desired functionality.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

code for html file

<html>
<head>


</head>
<body bgcolor="blue">
<p style="color:white">Some text</br>
Some text</br>
Some text</br></p>
<h1 style="color:white">Add Comment</h1>
<hr style="color:white"></hr>
<form action="insert.php" method="post">
<p style="color:white">Name&nbsp;&nbsp;&nbsp;<input type="text" name="name1" size="30"/></p></br>
<p style="color:white">email&nbsp;&nbsp;&nbsp;<input type="text" name="email"size="30" /></p></br>
<p style="color:white">Comments <TEXTAREA NAME="comments" ROWS="3" COL="30" WRAP="ON"></TEXTAREA></p></br>
<INPUT TYPE="SUBMIT" value="sign" />
<input type="reset" value="Reset Form" />
<hr style="color:white"></hr></br>

<a href="select.php" style="color:white">View posting comments</a>
</form>

</body>
</html>

code for php file to insert

<?php
error_reporting(E_ALL ^ E_NOTICE);
$con=mysql_connect("localhost","root","");
mysql_select_db("db",$con);
$a=$_POST['name1'];
$b=$_POST['email'];
$c=$_POST['comments'];
//echo "$a";

$result=mysql_query("select * from table1 where name='$_POST[name1]'");
$count = mysql_num_rows($result);
if($count>0)
//while($row=mysql_fetch_array($result))
{
echo "<h1 style=color:white>"."Comment Not Added"."</h1>";

echo "<hr style=color:white>"."</hr>";
echo "<h2 style=color:white>"."One per person, you have left comment for this posting"."</h2>";
echo "<hr>"."</hr>";  
//mysql_close($con);
}
else
{
//$con=mysql_connect("localhost","root","");

mysql_query("insert into table1 values('$_POST[name1]','$_POST[email]','$_POST[comments]')");
//mysql_close($con);
echo "<h1 style=color:white>"."Comment Added"."</h1>";
echo "</br>";
echo "<h2 style=color:white>"."Name "."$_POST[name1]"."</h2>";
echo "</br>";
echo "<h2 style=color:white>"."Comment "."$_POST[comments]"."</h2>";

}


/*echo "Name " ."$a";
echo "Comment " ."$c";*/
mysql_close($con);

?>
<html>
<head>
</head>
<body bgcolor="blue">
<a href="ins.htm" style="color:white">Someone else want to comment?</a>
<a href="select.php" style="color:white">View posting comments</a>
</body>
</html>

php code to show all blogs

<?php
$con=mysql_connect("localhost","root","");


mysql_select_db("db",$con);


$result=mysql_query("select name,comment from table1");
echo "<table border=5>";
$x=0;
echo "Name "."&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"."Comments";
while($row=mysql_fetch_array($result))
{
   //echo $row['fname']." ".$row['lname'];
   //echo "<br/>";
   echo "<tr><td>" . $row['name'] . "</td><td>" . $row['comment'] . "</td></tr>";
   $x++;
}
echo "</table>";

echo $x;
//echo phpinfo();

mysql_close($con);
?>
<html>
<head>
</head>
<body bgcolor="blue">
<a href="ins.htm" style="color:white">Someone else want to comment?</a>

</body>
</html>

Add a comment
Know the answer?
Add Answer to:
1. In MySQL, build the necessary tables to store the information required during the blog posting...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Create a list of several elements you think should make up a login page. Make sure to obtain instructor approval for the...

    Create a list of several elements you think should make up a login page. Make sure to obtain instructor approval for the elements of your login page. Consider the execution flow to capture the user interaction. Execute this assignment according to the following guidelines: 1.In MySQL, build the necessary tables to store the information required during the log in process. 2.In PHP, write the functions that will enable the capturing of user input and store in the database. 3.In HTML,...

  • Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around...

    Risk management in Information Security today Everyday information security professionals are bombarded with marketing messages around risk and threat management, fostering an environment in which objectives seem clear: manage risk, manage threat, stop attacks, identify attackers. These objectives aren't wrong, but they are fundamentally misleading.In this session we'll examine the state of the information security industry in order to understand how the current climate fails to address the true needs of the business. We'll use those lessons as a foundation...

  • How can we assess whether a project is a success or a failure? This case presents...

    How can we assess whether a project is a success or a failure? This case presents two phases of a large business transformation project involving the implementation of an ERP system with the aim of creating an integrated company. The case illustrates some of the challenges associated with integration. It also presents the obstacles facing companies that undertake projects involving large information technology projects. Bombardier and Its Environment Joseph-Armand Bombardier was 15 years old when he built his first snowmobile...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT