w-b pt2 v2 Flashcards

1
Q

What do CGI-enabled web servers allow you to do?

A

Execute programs identified in GET/POST request

  • As well as still return static HTML files
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How does the webs erver know whether to return the identified resource or execute it?

A

This can be done by looking at the suffix specificied in the URI

GET f.html HTTP/1.0 vs GET/cgi-bin/f.pl HTTP/1.0

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

Draw a diagram of how a normal GET request is processed and how a CGI GET request is processed

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

What are two techniques we can use to create dynamic HTML via server-side scripts?

A

We can simple use script langiuage ‘print’ type statements

Or we can instead chose to embed script calls directly within the static HTML

  • where the calls are replaced by the dynamic HTML the corresponding scrips generate during server processing
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are SSIs?

A

Server-Side Include (SSI)

An early adopter of the idea of including directive in the static HTML files.

  • these directive execute other pgorams or include data from environment variables.

This technique can be useful for including “boilerplate” text/html in many HTTP repsonses:

  • company logos, etc

Example

  • <!--#include file="trailer.html"-->
  • ## Welcome to server: <!--#echo var="SERVER_NAME"-->

or to invoke external commands on the server directly

  • <!--#exec cmd="/bin/who"-->
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Regardless of the server-side scripting tech we use, a basic web application is usually structuure in what way

A

There is a landing page, where users initially access/find the application

  • This will commonly do some sort of authentication and then provide a number of options for different sorts of processing
  • Each processing option will have it’s own pages

—using other form sto get required data

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

What are the details of PHP?

A
  • PHP is weakly typed
  • variables begin with $
  • Supports normal & associative arrays and RegExps
  • Procedural and OO
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

In PHP how do you access the following form data:

  1. POST/GET
  2. Server information
  3. environment information
  4. Sesession data
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly