Web Final

Ace your homework & exams now with Quizwiz!

What will this code do: chmod ../../folder/* 755

Give an error, improperly formatted

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 MVC in web design?

MVC is the Model View Controller, used to develop user interfaces

What is the purpose of <form>?

To pass data to a php file via POST or GET

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 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>

What language was used to display the login time and running time in program 4?

Javascript

What is the command that shows information on the text input section of the front-end.

place holder

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 from clear.php

<html> <body> <?php $PKey = ""; $LastName = ""; $FirstName = ""; $Email = ""; $Comments = ""; $DropDown = ""; ?> </body> </html>

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>

What is the difference between paragraphs and breaks

<p> are used to display text, and <br> and used to display a new line

What language is similar to JSP?

HTML

Name the main sections of html that we have learned in this class.

Head, title, and body

Write the code to extract and display data from a field named FirstName, keeping it hidden

$FirstName = $_POST['FirstName']; echo "First Name: ".$FirstName;

Write the code to connect to mysql from php

$connection = mysqli_connect("host" ,"username", "password", "dbName");

Write the code to connect to a database from php

$dbname = "WebDB"; $db_selected = mysqli_select_db( $connection, $dbname );

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);

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";

Assuming you are in your index file, create a hyperlink that goes to page1.html

<a href="includes/page1.html">Link</a>

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>

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 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 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 valign="center" borderColor="green" borderSize="1"> <tr> <td></td> <td></td> </tr> </table>

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 for about.php

<ul> <li> <customFont>Topic 1</customFont> </li> </ul>

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

What language is used to create servlet?

Java

Where does jsp usually execute?

Local Machine

Where to servlets usually execute?

The Server

In which OS can we use winSCP to connect to a server

Windows

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

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."; }

write the terminal command to connect to your database

mysql -h ocelot.aul.fiu.edu -u username -p

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>");

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 ?>">

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>

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>

Create a horizontal menu using hyperlinks for page1, page2 leaving 4 (four) HORIZONTAL spaces between them

<ahref="page1.html">page1 &nbsp;</a> <ahref="page2.html">page2 &nbsp;</a> <ahref="page3.html">page3 &nbsp;</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>

Display "Welcome" using ariel font, size 3, blue text

<font face="Ariel" size="3" color="blue">Welcome</font>

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 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">

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

what is cell padding

cell padding is the space between the cell border and the information inside

What is cellspacing

cell spacing is the space between cells

Write the code for tooltip in the body

<div class="tooltip"> Telephone <span class="tooltip">Enter telephone number</span> </div>

Write the opening and closing of a form that calls controller5.php, passing all data "hidden"

<form method="POST" action="controller5.php"> </form>

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

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


Related study sets

Piaget's cognitive-Development Theory

View Set

Medical-Surgical Nursing - Urinary/Reproductive Systems

View Set

TEST Two Maternal newborn CH 13-17 ATI 11-15

View Set

MSII Prep U Ch. 64: Assessment and Management of Patients With Hearing and Balance Disorders

View Set

IB HL Biology: Cellular Respiration: Oxidative Phosphorylation and Chemiosmosis

View Set