CMPS 002 - Computer Literacy

Prof. Paulo Franca

CyberSlug Rules!

Classes

Class Syllabus

Grading Policy

Labs

Interact

Login

  • enter system
  • get attendance
  • submit work
  • take lab quiz
  • check scores

Help

Help me!

Links

Staff only

 

 

 

Datacare   Ahshay

 

PHP4

What is ...?

  • a programming language based on the syntax of C++
  • developed for use as a scripting language for Web Servers
  • PHP4 programs are interpreted, not compiled
  • programs run in a web server
  • all data entered in a form become variables for the php4 program

Where do I get it?

  • php4 is available for free download at www.php.net
  • you need a web server to run programs in php4
  • a web server can be dowloaded free from www.apache.org

How do I run a php program?

  • store your program with extension .php4
  • either you directly address your program (www.myserver.com/myfolder/myprogram.php4) or
  • a web page links to your program (submit button -> form action= "myprogram.php4")

How do I write the program?

  • your php program must be included between the markers <? and ?>
  • all variables must start with $
  • a variable may contain integers, floating points or strings of characters

How do I display my results?

  • you can use echo to output
  • you can include html statements in the program

How do I input values?

  • you can only input values using a web page with forms.
  • the values in the forms will become variables in your php program
  • name of the form field is the name of the variable in the program

Can I test a program in php4?

YES!

prepare a php4 program using any text editor

in your login page, select upload programs