Showing posts with label HTTP. Show all posts
Showing posts with label HTTP. Show all posts

Thursday, September 6, 2018

Lecture 2 - Part 1 "PHP Continued" - Building Dynamic Websites CS75

Lecture 2 - Part 1 "PHP Continued" - Building Dynamic Websites  CS75
HarvardOpencourseWare. CS75 (Summer 2012)

Video: Lecture 2 "PHP Cont." - Building Dynamic Websites  (Youtube link to open in a new window 0m ~ 44m)





Video Run Time:

Course Web Site by CS75.tv

Course Sillabus (Opens in a PDF)

Lecture Slides for Lecture 2 (Opens in a PDF)

Lecture 2 Source Codes

Lecture 2 Source Codes in PDF

Course Assignment (Project)



Lecture 0: HTTP
Lecture 1: PHP
Lecture 3: MVC, XML
Lecture 4: SQL
Lecture 5: SQL, Continued
Lecture 6: JavaScript
Lecture 7: Ajax
Lecture 8: Security
Lecture 9: Scalability
Summary: This is the first lecture of the series. Building Dynamic Websites by Harvard OpenCourseWare with Great Instructor David J. Malan

Each assignment is expected to take 30 to 40 hours to complete.





<? 
    /*************************************************************
     * froshims0.php
     *
     * David J. Malan
     * malan@harvard.edu
     *
     * Implements a registration form for Frosh IMs.
     * Submits to register0.php.
     *****************************************************************/
?>

<!DOCTYPE html>

<html>
  <head>
    <title>Frosh IMs</title>
  </head>
  <body>
    <div style="text-align: center">
      <h1>Register for Frosh IMs</h1>
      <br><br>
      <form action="register0.php" method="post">
        <table style="border: 0; margin-left: auto; margin-right: auto; text-align: left">
          <tr>
            <td>Name:</td>
            <td><input name="name" type="text"></td>
          </tr>
          <tr>
            <td>Captain:</td>
            <td><input name="captain" type="checkbox"></td>
          </tr>
          <tr>
            <td>Gender:</td>
            <td>
              <input name="gender" type="radio" value="F"> F  
              <input name="gender" type="radio" value="M"> M
            </td>
          </tr>
          <tr>
            <td>Dorm:</td>
            <td>
              <select name="dorm">
                <option value=""></option>
                <option value="Apley Court">Apley Court</option>
                <option value="Canaday">Canaday</option>
                <option value="Grays">Grays</option>
                <option value="Greenough">Greenough</option>
                <option value="Hollis">Hollis</option>
                <option value="Holworthy">Holworthy</option>
                <option value="Hurlbut">Hurlbut</option>
              </select>
            </td>
          </tr>
        </table>
        <br><br>
        <input type="submit" value="Register!">
      </form>
    </div>
  </body>
</html>
===================================
<?
    /***************************************************************
     * register0.php
     *
     * Computer Science 50
     * David J. Malan
     *
     * Dumps contents of $_POST.
     ***************************************************************/

?>

<!DOCTYPE html>

<html>
  <head>
    <title>Frosh IMs</title>
  </head>
  <body>
    <pre>
      <? print_r($_POST); ?>
    </pre>
  </body>
</html>

============================================================

$_POST superglobal variable stores data in an array as follows;




Insert a test script to output the content of $_POST recursively.

<? print_r($_POST);?>

The following functions also output the content of the $_POST variable;

<? var_dump($_POST);?>

<? var_export($_POST);?>






Edit the configuration file, httpd.conf.




Tuesday, August 28, 2018

CS75 Section 1 - HTTP

Harvard OpenCourseWare. (Summer 2012)
CS75 Section 1 - HTTP for
Lecture 0 "HTTP" - Building Dynamic Websites






Video Run Time:

Course Web Site  by CS75.tv
Course Sillabus (Opens in a PDF)

Tuesday, June 26, 2018

Lecture 0 - Part1 "HTTP" - Building Dynamic Websites HarvardOpencourseWare. CS75

Harvard OpenCourseWare. (Summer 2012)

Lecture 0 "HTTP" - Building Dynamic Websites


Summary: This is the first lecture of the series. Building Dynamic Websites by Harvard OpenCourseWare with Great Instructor David J. Malan



Video Run Time:  1:46:19






Course Web Site by CS75.tv
Course Sillabus (Opens in a PDF)

Course Sections Lead By TA
Course Projects
The course's own website is at www.cs75.net.
Google Discussion Group



Lecture #0 Summary


Part-1
  1. http protocol
  2. Look at the http header
  3. How "internet" find the host, e.g. google.com, specified in a URL
  4. How query parameter in a URL is passed
  5. DHCP
  6. Connecting to a remote host via telnet with IP address

Part-2
  1. GET / HTTP/1.1 command in telnet
  2. HTTP/1.1 400 bad request
  3. HTTP/1.1 Error 301 - Moved permanently
  4. dhcp commad
  5. dhcp nslookup cnn.com and check the IP address
  6. /private/etc/hosts file for host database that lists 127.0.0.1 for localhost
  7. Use Chrome advanced feature for a developer to inspect the HTML element for style (button length)


0.1  http protocol

0.1.1 IP Address, DNS

When you type a search key word in www.google.com, what happens?

Explain what actually happens behind the scene.

1. Hit enter in the google search field.
2. Translate the URL (www.google.com) to IP address.
3. IP address: w.X.Y.Z 0 to 255  2EXP(32), 32 bits about 4 billion IP addresses.
4.That's version 4 IP address
5. Domain name lookup by DNS server that converts URL to the corresponding IP address.
6. Hieralchy of DNS system to find a known URL.
7. A root server knows who knows the URL in .com or .net, etc.
8. HTTP / GET / 1.0 (a header in a virtual envelope)
9. Default gate way (Router) routes a virtual envelope
10. Once a destination server receives the envelope, performs a service,
11. Repackage a virtual envelope and send it to the "from address".

0.1.2 Private IP Addresses

At home, we have private IP addresses. For example,

  192.168.x.x
  172.16.y.y
   10.z.z.z (Class A IP address)

Port forwarding

TCP/IP Stack
Port Number, 
Listening on port Number 80 (common)
port #25 (mail)
All traffic comes to a specific port
HTTP #443














MIT 6.00 コンピュータサイエンスとプログラミング秋期講座第2回

  MIT 6.00 コンピュータサイエンスとプログラミング秋期講座第2回 オープンコースウエア 大学名:MIT 講座名:6.00 Introduction to Computer Science and Programming Download course material ...