PHP: Difference between revisions

From Redbrick Wiki
Jump to navigation Jump to search
m (category)
No edit summary
Line 1: Line 1:
This is a quick presentation to introduce PHP.
This is a quick introduction to PHP, which will be expanded on (eventually).


[http://www.redbrick.dcu.ie/~drag0n/workshop/workshop.odp Download the Open Document Presentation]
==What is PHP?==
 
'''P'''HP '''H'''yper-text '''P'''re-Processor.
Allows web developers to write dynamically generated pages quickly. With synergy!
 
==Basic PHP==
 
* cd to your ~/public_html folder on Redbrick.
 
cd ~/public_html
 
* Create a file called “hello.php” using a text editor.
 
nano hello.php
 
* Paste (or manually type, if you're a newb) this PHP code into the fine
 
#!/usr/local/bin/php
<?php
    echo “Hello World!”;
?>
 
* Save and exit (CTRL + O, CTRL + X)
 
* Set correct permissions for the php file (this must be done for every .php file you want to use).
 
chmod 700 hello.php
 
* Visit www.redbrick.dcu.ie/~username/hello.php to view your script's output.
 
* It should display “Hello World!” in plain text within your browser.


[[Category:Helpdesk]]
[[Category:Helpdesk]]

Revision as of 22:10, 8 January 2008

This is a quick introduction to PHP, which will be expanded on (eventually).

What is PHP?

PHP Hyper-text Pre-Processor. Allows web developers to write dynamically generated pages quickly. With synergy!

Basic PHP

  • cd to your ~/public_html folder on Redbrick.
cd ~/public_html
  • Create a file called “hello.php” using a text editor.
nano hello.php
  • Paste (or manually type, if you're a newb) this PHP code into the fine
#!/usr/local/bin/php
<?php
   echo “Hello World!”;
?>
  • Save and exit (CTRL + O, CTRL + X)
  • Set correct permissions for the php file (this must be done for every .php file you want to use).
chmod 700 hello.php
  • Visit www.redbrick.dcu.ie/~username/hello.php to view your script's output.
  • It should display “Hello World!” in plain text within your browser.