Web 1 Final Exam

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

Write the code from controller3.php that will extract ALL the data inputed on the front end of program3, corresponding to the CHECKBOXES input fields

$Checkbox = $_POST['Checkbox'];

List three possible names for your website's required file name

1. index.php 2. index.css 3. index.html

I wanted to play with the text to speech here, so let's see how this sounds like

fffffffffffffffffffffkdjhdkjhdkjdhkdhhdttttttttttttttaaaaaaagghghghghghghghghghgmmmmmmmmmmmmmmbbbbbbbbbbopopopopopoptttttttlklklklkkkkkkkkkkksnsnsnsnsnss

In Linux, what is the name of the folder to place all your programs and folders for your website, used in this class.

public_html

What are the two main parts that make up an html program?

<head> </head> and <body> </body>

Write the code to connect to a database called WebDB

<?php $connection = mysqli_connect("WebDB"); if (mysqli_connect_errorno()) { echo "Failed to connect." } ?>

Write the code to MODIFY a record containing the following fields: - Email as the primary key bot accepting empty fields and of length 20 - 2 radio buttons called one and two - 2 checkbox buttons called three and four

<?php $query = "UPDATE customers SET Email = '$Email', One = '$One', Two = '$Two', Three = '$Three', Four = '$Four' WHERE Email = '$Email'"; ?>

Write the heading and closing of the form that calls the constructor2.php

<form method="post" action="../includes/constructor2.php"> </form>

Write the code to display "This is quiz 1", using the CSS3 method called FontSize94 that handles a font size, and a the html font tag to handle color red and arial font

<html> <FontSize94> <font-face="arial" color="red"> This is quiz 1 </font> </FontSize94> </html>

Write the code to create two radio buttons.

<input type="radio" name="radio1" value="1"> <input type="radio" name="radio2" value="2">

Write the code to create a clear button, as done in Program 2.

<input type="reset" value="Clear" name="button">

Create a menu using the CSS3 learned in class, to display two horizontal options/links page1 and page2

<nav> <ul> <li> <a href="../includes/page1.php"> Page 1</a> </li> <li> <a href="../includes/page2.php"> Page 2</a> </li> </ul> </nav>

Create an inline CSS3 program named FontSize94, to set the font size to 94px

<style> FontSize94 { font-size: 94px; } </style>

Create a centered horizontal menu using hyperlinks for page4 and Home. Remember all pages must be inside the includes folder.

<table border="0" align="center" valign="middle"> <tr> <td> <a href="../includes/page4.php"> Page 4</a> </td> &nbsp; <td> <a href="../includes/index.php"> Home </a> </td> </tr> </table>

Create a horizontal menu using hyperlinks for page1, page2, leaving 4 horizontal paces between them

<table> <tr> <td> <a href="../includes/page1.php"> Page 1 </a> (space)&nbsp;(space)&nbsp; </td> <td> <a href="../includes/page2.php"> Page 2 </a> (space)&nbsp;(space)&nbsp; </td> </tr> </table>

Create one table with one row and inside the row create two columns. Inside column one, using the font tag, display GREAT, using Arial font, color red. Inside column two, using the font tag, display CLASS, using Courier font, color blue.

<table> <tr> <td><font-face="arial" color="red"> GREAT </font> </td> <td><font-face="courier" color="blue"> CLASS </font> </td> </tr> </table>

Write the code to SAVE a record containing the following fields: - Email as the primary key bot accepting empty fields and of length 20 - 2 radio buttons called one and two - 2 checkbox buttons called three and four

if(strlen($Email)>0) { $sql="INSERT INTO customers ( Email, One, Two, Three, Four, ) VALUES ( '$Email', '$One', '$Two', '$Three', '$Four' )";

Write the code to create a submit button, as done in Program 2.

<input type="submit" value="Save" name="button">

Assume you are in the same folder where the index file is found, create a form to call page3, located in the includes folder, passing data, hiding.

<form method="post" action="../includes/page3.php"> </form>

Using HTML, display "welcome" using Ariel font, size 3, color blue

<html> <font-face="ariel" size="3" color="blue"> Welcome </font> </html>

Write the code to CREATE a table containing the following fields: - Email as the primary key bot accepting empty fields and of length 20 - 2 radio buttons called one and two - 2 checkbox buttons called three and four

<?php $sql = "CREATE TABLE " .$tableName."( Email VAR HAR(20) NOT NULL, PRIMARY KEY (Telephone), OneTwo VARCHAR(10), Three VARCHAR(10), Four VARCHAR(10), )"; ?>

Assume you are in the same folder where the index file is found, create a hyperlink that will call page1.php located in the includes folder

<a href="ocelot.aul.fiu.edu/~username/includes/page1.php"> title </a>

Write the code to create one input text field.

<input type="text" name="FirstName" value=" " width="100%"></input>

Name the sections used to create a CSS3 menu as done in program 2. Not the CSS3 code just the section names.

<nav> <ul> <li> link </li> </ul> </nav>

Create one text field named telephone

<tr> <input type="text" name="telephone" value=" " width="100%"> </tr>

Write the code from controller3.php that will DISPLAY the data extracted

include( "program3.php" );

Write the code from controller3.php that will EXTRACT the data inputed on the front end program3, corresponding to the first three input fields

$Telephone = $_POST['Telephone']; $FirstName = $_POST['FirstName']; $LastName = $_POST['LastName'];

Write the code to connect and have full access to your mySql

<?php $connection = mysqli_connect("ocelot.aul.fiu.edu" , "spr17_username" , "PantherID" , "spr17_username"); if (mysqli_connect_errorno()) { echo "Failed to connect." } ?>

Write the code that finds out which button was pressed

<?php if ($POST_['Find']) echo "This is the controller. You have pressed the Find submit button."; ?>

Write the code from program3 that will extract the current date, current hour, current minutes, and current seconds, INCLUDING calling the language used in program3 for this purpose

<script> function currentTime() { var today = new Date(); var hour = today.getHours(); var minutes = today.getMinutes(); var sec = today.getSeconds(); minutes = checkTime(minutes); sec = checkTime(sec); document.getElementById('txt').innerHTML = "Current Time: "+hour+":"+minutes+":"+sec; var t = setTimeout(function(){currentTime()},500); } function checkTime(i) { if (i<10) {i = "0" + i}; // add zero in front of numbers < 10 return i; } </script>

Write the code to create two blank rows

<tr> &nbsp; </tr> <tr> &nbsp; </tr>

As explained in class, what is the purpose of the code in controller3.php, that will totally affect all new programs after program3

Controller3 will access mysql on ocelot to access our own personal database, create table(s), and save the input from the webpage to said tables.


Ensembles d'études connexes

2.02 The Hebrews and Early Judaism

View Set

prepU ch 38 Agents to Control Blood Glucose Levels

View Set

Cell Bio Exam 2: Membrane Transport

View Set