Section 1

Preview this deck

Write the code from find.php

Front

Star 0%
Star 0%
Star 0%
Star 0%
Star 0%

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Active users

0

All-time users

0

Favorites

0

Last updated

6 years ago

Date created

Mar 1, 2020

Cards (73)

Section 1

(50 cards)

Write the code from find.php

Front

<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']; } ?> </body> </html>

Back

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

Front

Javascript

Back

What does this jsp code do?

Front

<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

Back

What is the purpose of the form tag?

Front

To send all data in the current page, HIDDEN, to the page assigned to the action command

Back

Write the code for two input fields that will display back data.

Front

<input type="text" name="FirstName" value="<?php echo $FirstName >"> <input type="text" name="LastName" value="<?php echo $LastName ?>">

Back

Write the code for loginTime

Front

function loginTime() { var today = new Date(); var temp = "logged in at: " + today; document.write(temp); }

Back

What does this xml code do?

Front

<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

Back

Write the code for a text area that will display back data.

Front

<textarea name="area" rows="2" cols="22"><?php echo $area ?></textarea>

Back

Write the code that will obtain hours, minutes, and seconds in currentTime

Front

function currentTime() { var today = new Date(); var hour = today.getHours(); var min = today.getMinutes(); var sec = today.getSeconds(); }

Back

Write the code for a placeholder

Front

<input type="text" placeholder="First Name" name="FirstName" value="">

Back

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

Front

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

Back

Write the code for tooltip in the body

Front

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

Back

Write the code for about.php

Front

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

Back

Write the code for help.php with one topic and description

Front

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

Back

What does cellspacing do in HTML

Front

Cellspacing allows us to create spaces between the Adjacent cells

Back

Create a table with one row, two columns, and in the center of the screen with a green frame/border size 1

Front

<table align="center" borderColor="green" borderSize="1"> <tr> <td></td> <td></td> </tr> </table>

Back

What language is used to create servlet?

Front

Java

Back

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

Front

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

Back

Create a menu with css3 to display two horizontal options

Front

<nav> <ul><a href="page1.html">page1</a></ul> <ul><a href="page2.html">page2</a></ul> </nav>

Back

Write the code from clear.php

Front

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

Back

write the code to create 2 radio buttons that display back data

Front

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

Back

Write the code to create a submit button

Front

<input type="submit" name="Find" value="Find">

Back

Write the code from delete.php

Front

$sql="DELETE FROM customers WHERE Telephone='$Telephone'"; if ( ( strlen(trim($found)) > 0 ) && ($found == $Telephone) ) { if (mysqli_query($connection, $sql)) { //echo "Record deleted successfully found = {".$found."}"; $found=""; //this clear the flag for record found to be able to modify } else { $message = "Error deleting record: " mysqli_error($connection); } }

Back

Write the code to connect to mysql from php

Front

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

Back

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

Front

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

Back

Write the code to create a clear button to clear the screen

Front

<input type="reset" name ="ClearScreen" value="ClearScreen">

Back

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

Front

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

Back

Create a menu using css3 to display two vertical options

Front

<nav> <ul> <li><a href="page1.html">page1</a></li> <li><a href="page2.html">page2</a></li> </ul> </nav>

Back

Create a new table called contacts with fields: Telephone as a primary key First name Last name Email

Front

$sql = "CREATE TABLE contacts ( Telephone VARCHAR(20) NOTNULL, PrimaryKey (Telephone), FirstName VARCHAR(20), LastName VARCHAR(20), Email VARCHAR(20) )"; mysqli_query($connection, $sql);

Back

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

Front

Give an error, improperly formatted. It should be: chmod 755 ../../../*

Back

Where to servlets usually execute?

Front

The Server

Back

Write the code from save.php

Front

<html> <body> <?php $PrimaryKey=trim($PrimaryKey); if(strlen($PrimaryKey)>0) { $sql = "INSERT INTO ".$tableName." VALUES ( '$PrimaryKey', '$FirstName', '$LastName', '$Email', '$Comments' )"; $found = $PrimaryKey; } ?> </body> </html>

Back

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

Front

place holder

Back

What is the MVC in web design?

Front

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

Back

Write the code to determine what button is pressed.

Front

if($_POST['Button1']) { echo "You pressed button 1."; } else if($_POST['Button2']) { echo "You pressed button 2."; }

Back

Write the code for a dropdown menu that will display back data, using at least two choices

Front

<select name="DropDown" size="1"> <option <?php if ($DropDown=="Choice1") echo selected?>>Choice1</option> <option <?php if ($DropDown=="Choice2") echo selected?>>Choice2</option>

Back

write the terminal command to connect to your database

Front

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

Back

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

Front

a)public_html b) you have to give the right permissions to the files through chmod 755 C) no

Back

Where does jsp usually execute?

Front

Local Machine

Back

What will this code do: chmod 755 ../../*.?ab *.dat

Front

Look back two directories and give all ._ab and .dat files 755 permissions.

Back

What does cellpadding do in HTML

Front

Cellpading allows us to create padding around the cell content

Back

what does WINSCP do?

Front

Allows upload and download files from/to source to destination

Back

Which are the main commands to find a record in a table named customers, from inside a webpage

Front

$sql="SELECT * FROM customers order by Telephone ASC";

Back

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

Front

Windows

Back

Write an html program with the two main parts of html

Front

<html> <head></head> <body></body> </html>

Back

What language is similar to JSP?

Front

HTML

Back

Write the contact_me_controller.php code

Front

<?php if(isset($_POST['submit'])) { $to = "email"; $subject = "From.."; $name_field = $_POST['UserName']; $email_field = $_POST['UserEmail']; $body = " From: $name_field
eMail:$email_field
Tel: $UserTel
Fax: $UserFax
Option:
"; mail($to, $subject, $body); ?>

Back

What is the difference between paragraphs and breaks

Front

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

Back

What if the name of the process/function/method that displays information about a field name when you hoover over it

Front

tooltip

Back

Write the code to connect to a database called WebDB as done in all Controllers.php

Front

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

Back

Section 2

(23 cards)

Write the code for last.php using 2 data fields.

Front

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'];} }

Back

What is the leads.php purpose?

Front

To view data accepted by the Quotes.php, using the programs First.php, Next.php, Previous.php, and Last.php.

Back

What does the putty program do?

Front

In windows, it allows you to connect and interact with a server.

Back

Using jsp write the code using in the front end to display the value for the telephone field

Front

<input type="text" name="Telephone" value=${param.Telephone}>

Back

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

Front

<a href="fiu.edu"> <imgsrc="/images/theGraph.png" width= height=> </a> <head> <title>Firstname, Lastname, exam1 </title> </head>

Back

What is the xml purpose?

Front

To transfer/pass data from a data source to a data destination

Back

What does the face command do?

Front

FACE is the command that names the font name

Back

Using html and php write the code used in pgm3s front end to display the value for the telephone field

Front

<input type="text" value="telephone" name="telephone"> Telephone </input>

Back

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

Front

<ahref="page1.html">page1 &nbsp;</a> <ahref="page2.html">page2 &nbsp;</a> <ahref="page3.html">page3 &nbsp;</a>

Back

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

Front

redWhite { background: red; color: white; }

Back

Write the code to create a dropdown input as done in pgm2 containing 3 choices.

Front

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

Back

Which are the main commands to delete a record from a table named customers, from inside a webpage, where the primary key is Telephone

Front

$sql="DELETE WHERE Telephone='$Telephone' FROM customers";

Back

As explained in class The purpose(s) of CSS in web programming is/are __________

Front

Create functions/groups of code that can be called from anywhere

Back

Write the code from modify.php program.

Front

$found = $_POST['found']; if ( ( strlen(trim($found)) > 0 ) && ($found == $Telephone) ) { $query = "UPDATE customers SET FirstName = '$FirstName', LastName = '$LastName', Email = '$Email', WHERE Telephone = '$Telephone'"; }

Back

Write program 1's modified menu code that calls program2.php

Front

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

Back

write an html program that will have the 2 main parts in html as learned in class

Front

head and body

Back

Write the code for first.php using 2 data fields

Front

$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']; }

Back

As discussed/explained in class, what are the purposes of: a) Back-end section b) Front-end section c) Controller

Front

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

Back

In which operating systems does putty work?

Front

Windows

Back

What is the quotes.php purpose?

Front

To accept data from users, to be used by the Leads.php program

Back

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

Front

Head, title, and body

Back

Write the code to create one dropdown input box as done in pgm3 using four field names.

Front

<font> Dropdowns </font> <td> <select name="Additions" value="Additions" style="width: 50%;"> <option value="ExtraSugar" >Extra Sugar </option> <option value="ExtraSyrup" > Extra Syrup </option> <option value="NoSugar" > No Sugar </option> <option value="NoSyrup" > No Syrup </option> </select> </td>

Back

Write the code to create 2 checkboxes input box as done in pgm2

Front

<input type="checkbox" name="Robotics" value="">Robotics <input type="checkbox" name="Engineering" value="">Engineering

Back