Hello, I was wondering if someone could help me with this PHP and HTML problem. Basically, there is code for a multiplication table and i need to change it to support the following.
This is a 3 part PHP and HTML problem. The code to start off with is below. This code needs to be edited to meet the 3 requirements above.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8"
http-equiv="Content-Type" />
<title>Multiplication Table</title>
<style>
table, th, td {
border: 1px solid
black;
}
th, td {
padding: 5px;
}
td {
text-align: right;
}
</style>
</head>
<body>
<?php
// You need to have two indecies, $i and
$j
// The output should look like
// 1x1=1 1x2=2 ...
// 2x1=2 2x2=4 ...
// ...
$size = rand(8,12);
$bgcolor =
array("DeepSkyBlue","LightSalmon");
$color = $bgcolor[rand(0,1)];
echo "$color";
echo "<table bgcolor = $color>";
for ($i=1; $i<= $size; $i++)
{
echo "<tr>";
for ($j=1; $j<=
$size; $j++)
{
echo "<td>";
echo $i . "x" . $j . "=" . $i*$j;
echo "</td>";
}
//echo
"<br>";
echo
"</tr>";
}
echo "</table>";
?>
</body>
</html>
Step 1: Create a new PHP file named index.php and Paste the following code.
<=================(this line is not in the code)=================>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<title>Multiplication Table</title>
<style>
table, th, td {
border: 1px solid black;
}
th, td {
padding: 5px;
}
td {
text-align: right;
}
</style>
</head>
<?php
$bgcolor = array("DeepSkyBlue","LightSalmon","LightYellow");
$color = $bgcolor[rand(0,2)];
echo "$color";
?>
<body bgcolor=<?php echo $color ?>>
<?php
if(isset($_GET["create"])){
// You need to have two indecies, $i and $j
// The output should look like
// 1x1=1 1x2=2 ...
// 2x1=2 2x2=4 ...
// ...
echo "<table>";
$size = $_GET["size"];
for ($i=0; $i<= $size; $i++)
{
echo "<tr>";
for ($j=0; $j<= $size; $j++)
{
if($j == 0){
echo "<td>";
if($i == 0){
}else{
echo "<i>".($i)."</i>";
}
echo "</td>";
}else if($i == 0) {
echo "<td>";
if($j != 0){
echo "<i>".($j)."</i>";
}
echo "</td>";
}else{
echo "<td>";
echo $i . "x" . $j . "=" . $i*$j;
echo "</td>";
}
}
//echo "<br>";
echo "</tr>";
}
echo "</table>";
}
else{
//// if you want to always show that drop down take this code out from this else block a
/// or just uncomment below code. and comment this code.
?>
<form action="index.php" method="GET">
<select id="size" name="size">
<option value="8">8</option>
<option value="10">10</option>
<option value="12">12</option>
<option value="14">14</option>
</select>
<input type="submit" name="create" value="Create" id="create">
</form>
<?php
}
?>
<!---
<form action="index.php" method="GET">
<select id="size" name="size">
<option value="8">8</option>
<option value="10">10</option>
<option value="12">12</option>
<option value="14">14</option>
</select>
<input type="submit" name="create" value="Create" id="create">
</form>
-->
</body>
</html>
<==================================>
Note: if you always want to show that dropdown just change uncomment the commented HTML code, and comment the code inside the else block.
Step 2: fire up your server and run this code.
Here is the sample output of the code.
Any problem ask me in the comment section
Thumbs up is appreciated.
Hello, I was wondering if someone could help me with this PHP and HTML problem. Basically,...
1. Predict the Result.Draw and write a brief description of the Web page that will becreated with the following XHTML code:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"><head><title>CircleSoft Designs</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><style type="text/css">body { background-color: #FFFFCC;color: #330000;font-family Arial,Helvetica,sans-serif; }.content { width: 750px; }</style></head>Apply Your Knowledge<body><div class="content"><h1>CircleSoft Design</h1><div><strong>CircleSoft Designs will </strong><ul><li>work with you to create a Web presence that fits yourcompany</li><li>listen to you and answer your questions</li><li>utilize the most appropriate technology for your sites:JavaScript, Java, PHP, databases,...
I am having an issue. When i press submit to test the code, it goes to a blank screen. Please, will some one assist me? Thanks! <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Sign Guest Book</title> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1" /> </head> <body> <?php if (empty($_POST['?rst_name']) || empty($_POST['last_name'])) echo "<p>You must enter your ?rst and last name! Click your browser's Back button to return to the Guest Book form.</p>"; else { $DBConnect = @mysql_connect("localhost", "root", ""); ...
Create an HTML form that takes these inputs: Number of rows, and number of columns. This form will submit to a PHP page. Create that page that will accept input from the HTML form and generates the table from the user's input. I already have the portion that generates the table based on user input by using Javascript in an HTML page, I just need to know how to generate the table using a PHP page instead. Here's the code...
PHP
Can't get my code to work, what am I doing wrong?
<!DOCTYPE html>
<html>
<head>
<script>
</script>
</head>
<body>
<h2>Temperature Conversion Table</h2>
<h4>Enter a starting value in degrees Fahrenheit and an
increment value.</h4>
<form name="myTemp"
onsubmit="convertCelcius()" method="post">
<input type="text" name="temperature"> Enter an value in
degrees Fahrenheit<br><br>
<input type="radio" name="degIncrement" id="degIncrement5">
Convert in increment in 5 degrees<br>
<input type="radio" name="degIncrement" id="degIncrement10">
Convert in increment in 10 degrees
<br/><br/><input type="submit"
value="Submit">
</form>
<?php
if( $_POST["temperature"] || $_POST["degincrement"] ) {
//get he...
<!DOCTYPE html> <html> <head> <title>Products</title> <style> .heading { text-align: center; font-size: 40px; } #menu { text-align: center; } #menu li { display: inline; font-size: 26px; margin-left: 20px; } .container{ overflow: hidden; margin: 30px; } img { float: left; width: 40vh; height: 40vh; margin-left: 10%; } table { float: right; margin-right: 10%; } table, th, td { border: 1px solid black; border-collapse: collapse; } th, td { font-size: 26px; padding: 10px; text-align: left; } a { color: black; } a:visted {...
Develop a file loading app as shown below:
User enters URL in an EditText. On the on click listener of the
load button, url’s data should be read into a html file in a
separate thread as an asynchronous task. Display a
progress bar too. On the post execute method, display done text in
a text view.
On the click of Display button, data that’s stored in html file
gets retrieved and displayed in text view.
USING ANDRIOD STUDIO /...
Hello please, don't use your handwriting in the solution Thank you In Page Layout Strategies, we talked about fluid and fixed layouts. If I was given the below code. Does that fluid or fixed layouts, and how did you indicate that? Explain your answer <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Mount Olympus News</title> <style type="text/css"> #wrapper { width: 960px; outline: #ff7900 2px dashed; } #main { float: left; width: 650px; margin: 0 20px; ...
Hello please, don't use your handwriting in the solution Thank you In Page Layout Strategies, we talked about fluid and fixed layouts. If I was given the below code. Does that fluid or fixed layouts, and how did you indicate that? Explain your answer <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <head> <title>Mount Olympus News</title> <style type="text/css"> #wrapper { width: 960px; outline: #ff7900 2px dashed; } #main { float: left; ...
Hello Ive been tryting to add the CDN of jquery to my html code and I keep getting an error Need help with this : Navigate to www.code.jquery.com in your Chrome browser. On this page, you'll find different stable versions of jQuery. Select uncompressed for jQuery Core 3.3.1. Copy the <script> tag that is given to you. In store_hours.html, paste that tag directly above your body's closing tag. This is the jQuery CDN. After you paste this code into...
Question are based on THML code below. Read the code and then answer questions after it <html> <head><title>First Web Page</title></head> <body bgcolor="#310AFC" > <table border="1" width="700" height="600" bgcolor="#1A88BC" align="right"> <tr> <td ><font size="4" color="blue">This is Cell 1</font> </td> <td bgcolor="#FCBB8C"><h2 align="left">This is a heading</h2></td> <td><font size="4" color="red">There is a list below</font> <ul><li>Item 1</li><li>item 2</li></ul> </td> <td><img src="2.jpg" width="100" height="100" border="1" /></td> </tr> <tr> <td>This is <a href="http://www.yahoo.ca">a link to Yahoo</a></td> <td><table border = "1" width="190" height="110" bgcolor="#FD8B08"> <tr><td>inside 1</td><td>inside 2</td></tr>...