Web Final
What does the face command do?
FACE is the command that names the font name
What does the putty program do?
In windows, it allows you to connect and interact with a server.
What language is used to create servlet?
Java
Where to servlets usually execute?
The Server
What is the quotes.php purpose?
To accept data from users, to be used by the Leads.php program
Display "Welcome" using ariel font, size 3, blue text
<font face="Ariel" size="3" color="blue">Welcome</font>
Write the code to create 2 checkboxes input box as done in pgm2
<input type="checkbox" name="Robotics" value="">Robotics <input type="checkbox" name="Engineering" value="">Engineering
Write the code for a text area that will display back data.
<textarea name="area" rows="2" cols="22"><?php echo $area ?></textarea>
As discussed/explained in class, what are the purposes of: a) Back-end section b) Front-end section c) Controller
Back-end-section to receive input, validate it, and pass it to the front end front-end session is the visual page in front of you the controller passes data to the back-end
As explained in class The purpose(s) of CSS in web programming is/are __________
Create functions/groups of code that can be called from anywhere
What will this code do: chmod ../../folder/* 755
Give an error, improperly formatted. It should be: chmod 755 ../../../*
What is the command that shows information on the text input section of the front-end.
place holder
Create a new table called contacts with fields: Telephone as a primary key First name Last name Email
$sql = "CREATE TABLE contacts ( Telephone VARCHAR(20) NOTNULL, PrimaryKey (Telephone), FirstName VARCHAR(20), LastName VARCHAR(20), Email VARCHAR(20) )"; mysqli_query($connection, $sql);
Write the code for first.php using 2 data fields
$sql="SELECT * FROM emails order by Telephone ASC limit 1"; if($result=mysqli_query($connection,$sql)) { $row = mysqli_fetch_array($result); $Telephone = $row['Telephone']; $Comments = $row['Comments']; }
Write the opening and closing of a form that calls controller5.php, passing all data "hidden"
<form method="POST" action="controller5.php"> </form>
Which are the main commands to delete a record from a table named customers, from inside a webpage, where the primary key is Telephone
$sql="DELETE WHERE Telephone='$Telephone' FROM customers";
Which are the main commands to find a record in a table named customers, from inside a webpage
$sql="SELECT * FROM customers order by Telephone ASC";
Write the code to extract and display data from a field named FirstName, keeping it hidden
$FirstName = $_POST['FirstName']; echo "First Name: ".$FirstName;
Assuming you are in your index file, create a hyperlink that goes to page1.html
<a href="includes/page1.html">Link</a>
Write the code for tooltip in the body
<div class="tooltip"> Telephone <span class="tooltip">Enter telephone number</span> </div>
Write the code from find.php
<html> <body> <?php $sql="SELECT * FROM ".$tableName." where PKey= '$PKey'"; if ($result=mysqli_query($connection,$sql)) { $rowCount=mysqli_num_rows($result); while( $row = mysqli_fetch_array( $result ) ) { $PKey = $row['PKey']; $LastName = $row['LastName']; $FirstName = $row['FirstName']; $Email = $row['Email']; $Comments = $row['Comments']; $DropDown = $row['DropDown']; } $PrimaryKey=trim($PrimaryKey); if ($rowCount) { $found = $PrimaryKey; } } ?> </body> </html>
Write the contact_me_controller.php code
<html> <body> <?php if (isset($_POST['Submit']) { $to = "[email protected]"; $subject = "Final test"; $myEmail = $_POST['myEmail']; $myLastName = $_POST['myLastName']; $myFirstName = $_POST['myFirstName']; $myComments = $_POST['myComments']; $body = " Your Email $myEmail\n" ." Last Name $myLastName\n" ." First Name $myFirstName\n\n" ." Comments $myComments"; mail($to,$subject,$body); } ?> </body> </html>
Write an html program with the two main parts of html
<html> <head></head> <body></body> </html>
What does this jsp code do?
<html> //open html <head> //open head <meta charset='utf-8'> //set character encoding to utf-8 <title>Initialized JSP</title> //set the title </head> //close head <body> //open body <form> //open simple form <p> //start paragraph This is a simple HTML page that has a form in it. <p> //start paragraph The hobby was received as: <strong>${param.hobby}</strong> //grab input from input named 'hobby' and bold it <p> //start paragraph Hobby: <input type='text' name='hobby' value='${param.hobby}'> //make a text field named 'hobby' that accepts and displays the string entered <input type='submit' name='confirmButton' value='Confirm'> //make a button named 'confirmButton' that will submit the value in 'hobby' </form> //close form </body> //close body </html> //close html
Write the code to create a clear button to clear the screen
<input type="reset" name ="ClearScreen" value="ClearScreen">
Write the code to create a submit button
<input type="submit" name="Find" value="Find">
Create a menu using css3 to display two vertical options
<nav> <ul> <li><a href="page1.html">page1</a></li> <li><a href="page2.html">page2</a></li> </ul> </nav>
Create a menu with css3 to display two horizontal options
<nav> <ul><a href="page1.html">page1</a></ul> <ul><a href="page2.html">page2</a></ul> </nav>
Write the code to create a dropdown input as done in pgm2 containing 3 choices.
<select name="age" style="width: 100%;"> <option value="Under 20"> Under 20 </option> <option value="20-30"> 20-30 . </option> <option value="31-40"> 31-40 . </option> </select>
What does this xml code do?
<servlet> //starting a servlet <servlet-name> //open servlet name FirstController //name of program </servlet-name> //close servelt name <servlet-class> //starts servlet class ch2.servletController.Controller //class location on second storage </servlet-class> //closes servlet class </servlet> //ending of servlet <servlet-mapping> //start servlet mapping <servlet-name> //open servlet name FirstController //program name </servlet-name> //closes servlet name <url-pattern> //start url-pattern /ch2/servletController/Controller //what is the url-pattern </url-pattern> //closes url-mapping </servlet-mapping> //close servlet mapping
Create a table with one row, two columns, and in the center of the screen with a green frame/border size 1
<table align="center" borderColor="green" borderSize="1"> <tr> <td></td> <td></td> </tr> </table>
Write the code for about.php
<ul> <li> <a class="anyClassName">anyTopicName<br></a> any message can go here <li> <a class="anyClassName">anyTopicName<br></a> any message can go here </ul>
what does WINSCP do?
Allows upload and download files from/to source to destination
In which OS can we use winSCP to connect to a server
Windows
In which operating systems does putty work?
Windows
Using a Unix/Linux server to place your website, a) What is the name of the folder where you must place your website's home page b) After placing all pages what do we need to do if we get error 404 or Access Denied or Forbidden c) Do you need to have your images in the same folder as you home page
a)public_html b) you have to give the right permissions to the files through chmod 755 C) no
Write the code that will obtain hours, minutes, and seconds in currentTime
function currentTime() { var today = new Date(); var hour = today.getHours(); var min = today.getMinutes(); var sec = today.getSeconds(); }
Write the code for loginTime
function loginTime() { var today = new Date(); var temp = "logged in at: " + today; document.write(temp); }
write an html program that will have the 2 main parts in html as learned in class
head and body
Create a horizontal menu using hyperlinks for page1, page2 leaving 4 (four) HORIZONTAL spaces between them
<ahref="page1.html">page1 </a> <ahref="page2.html">page2 </a> <ahref="page3.html">page3 </a>
a) Write the code that will display a graph called theGraph.png that when pressed it will load the web page called fiu.edu b) Write the code to display your last name, first name, and exam1 at the title section of a website
<ahref="www.fiu.edu"><imgsrc="theGraph.png"> </a> <head> <title>Firstname, Lastname, exam1 </title> </head>
Write the code from save.php
<html> <body> <?php $PrimaryKey=trim($PrimaryKey); if(strlen($PrimaryKey)>0) { $sql = "INSERT INTO ".$tableName." VALUES ( '$PrimaryKey', '$FirstName', '$LastName', '$Email', '$Comments' )"; $found = $PrimaryKey; } ?> </body> </html>
Write the code from delete.php
<html> <body> <?php $record = "RECORD ".$PrimaryKey." DELETED"; $found = $_POST['found']; $sql="DELETE FROM ".$tableName." WHERE Username='$PrimaryKey'"; $PrimaryKey=trim($PrimaryKey); if((strlen(trim($found)) > 0) && ($found == $PrimaryKey)) { if (mysqli_query($connection, $sql)) { $found = ""; } } ?> </body> </html>
write the code to create 2 radio buttons that display back data
<input type="radio" <?php if($Bottle=="Water") echo "checked";?> name="Bottle" value="Water"> <input type="radio" <?php if($Bottle=="Soda") echo "checked";?> name="Bottle" value="Soda">
Write the code for last.php using 2 data fields.
if($_POST['Last']) { $sql="SELECT * FROM emails order by Telephone ASC"; if($results=mysqli_query($connection,$sql)) { $rowcount=mysqli_num_rows($results); $location=$rowcount-1; mysqli_data_seek($results, $location); $row=mysqli_fetch_assoc($results); $Telephone = $row['Telephone']; $Comments = $row['Comments'];} }
write the terminal command to connect to your database
mysql -h ocelot.aul.fiu.edu -u username -p password
What if the name of the process/function/method that displays information about a field name when you hoover over it
tooltip
Write the code to connect to mysql from php
$connection = mysqli_connect("host" ,"username", "password", "dbName");
Write the code to connect to a database called WebDB as done in all Controllers.php
$db_selected = mysqli_select_db( $connection, "WebDB" );
Write the code for two input fields that will display back data.
<input type="text" name="FirstName" value="<?php echo $FirstName >"> <input type="text" name="LastName" value="<?php echo $LastName ?>">
Using jsp write the code using in the front end to display the value for the telephone field
<input type="text" name="Telephone" value=${param.Telephone}>
Write the code for a placeholder
<input type="text" placeholder="First Name" name="FirstName" value="">
Using html and php write the code used in pgm3s front end to display the value for the telephone field
<input type="text" value="telephone" name="telephone"> Telephone </input>
What is the difference between paragraphs and breaks
<p> are used to display text, and <br> and used to display a new line
Write the code for a dropdown menu that will display back data, using at least two choices
<select name="DropDown" size="1"> <option <?php if ($DropDown=="Choice1") echo selected?>>Choice1</option> <option <?php if ($DropDown=="Choice2") echo selected?>>Choice2</option>
Write program 1's modified menu code that calls program2.php
<table> <tr> <td> <a href="includes/pgm1.html"> Program 1 </a> </td> <td> <a href="includes/program2.php"> Program 2</a> </td> <td> <a href="index.html"> Home</a> . </td> </tr> </table>
Write the code from clear.php
<html> <body> <?php $PKey = ""; $LastName = ""; $FirstName = ""; $Email = ""; $Comments = ""; $DropDown = ""; ?> </body> </html>
What does cellspacing do in HTML
Cellspacing allows us to create spaces between the Adjacent cells
What language is similar to JSP?
HTML
Name the main sections of html that we have learned in this class.
Head, title, and body
What language was used to display the login time and running time in program 4?
Javascript
Where does jsp usually execute?
Local Machine
What is the MVC in web design?
MVC is the Model View Controller, used to develop user interfaces
Write the code for help.php with one topic and description
var myWindow = window.open("", "Help", "width=400, height=600, scrollbars=yes, resizeable=yes, left=200, top=35"); myWindow.document.write("<font size=8><b>Save<br></b></font>"); myWindow.document.write("<font size=5> <p>Press this to save all the data entered in the fields, you must have at least a username entered.<br> </p> </font>");
What does cellpadding do in HTML
Cellpading allows us to create padding around the cell content
What will this code do: chmod 755 ../../*.?ab *.dat
Look back two directories and give all ._ab and .dat files 755 permissions.
What is the purpose of the form tag?
To send all data in the current page, HIDDEN, to the page assigned to the action command
What is the xml purpose?
To transfer/pass data from a data source to a data destination
What is the leads.php purpose?
To view data accepted by the Quotes.php, using the programs First.php, Next.php, Previous.php, and Last.php.
Write the code to determine what button is pressed.
if($_POST['Button1']) { echo "You pressed button 1."; } else if($_POST['Button2']) { echo "You pressed button 2."; }
Create a css section of code named redWhite to set background as color red and letters as color white, as shown in the html head section in this class
redWhite { background: red; color: white; }