AH PHP/HTML Flashcards

1
Q

When asked about an HTML form input, what two things methods are there?

A

POST

GET

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When using the form tag, what 3 pieces of info do you need?

A

method (post/get)
action (php file)
name (filename)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

When using the input tag with input boxes, what 2 pieces of info do you need?

A

Type (text/password/date)

Name (what the box is called)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

When using the input tag with a submit button what 3 pieces of info do you need?

A

Type (submit)
Value (Submit Form)
Name (what it’s called (submit))

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

To connect to a database server what 3 connection parameter do you need?

A
$dbserver = ...
$dbuser = ...
$dbpass = ...
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

To connect and select a database what 2 lines do you need?

A

$connection = mysql_connect($dbserver, $dbuser, $dbpass);

mysql_select_db($database, $connection);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What 2 lines of code do you need when assigning HTML user and pass to server side-variables?

A
$user = $_POST['username'];
$userpassword = $_POST['userpassword'];
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What 2 lines of code would you need to add data to a table?

A

$sql = “INSERT INTO … VALUES(‘…’)”;

mysql_query($sql);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What 1 line of code would you need to close a database connection?

A

mysql_close($connection)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What line of code would you need to update a piece of data in a database? Use pseudocode

A

SET query TO “UPDATE tablename SET field1 = … where field2 = …

How well did you know this?
1
Not at all
2
3
4
5
Perfectly