PhP

Following is a brief summary of some of the concepts on PhP that we have covered in class:

Here are some notes about writing and running PhP on i5.nyu.edu:

  1. This is how to call your script: http://i5.nyu.edu/cgi-bin/cgiwrap/netid/your_php_script
  2. Your_php_script must be located in public_html/cgi-bin
  3. For further information on setting up your cgi-bin subdirectory, see http://i5.nyu.edu/#cgi
  4. The first line of your PHP script has the directive: #!/usr/local/bin/php

General rules to remember:

  1. each line ends with a semi-colon
  2. be sure the HTML that you use is correct so that the PhP can generate it correctly for the browser
  3. use comments to explain your code
  4. concatenation symbol: use a period

Using PHP with HTML forms and passing the variables to PHP: (Please note that I have posted the files with code in Word documents so the browser does not interpret them; be sure to copy and paste the code into a text editor to create your files.)


Return