Jump to content

PHP: Difference between revisions

189 bytes removed ,  20 April
no edit summary
No edit summary
 
(2 intermediate revisions by 2 users not shown)
Line 14: Line 14:
  cd ~/public_html
  cd ~/public_html


* Create a file called “hello.php” using a text editor.
* Create a file called ''hello.php'' using a text editor.


  nano hello.php
  nano hello.php
Line 20: Line 20:
* Type this PHP code into the file
* Type this PHP code into the file


#!/usr/local/bin/php
  <?php
  <?php
     echo "Hello World!";
     echo "Hello World!";
  ?>
  ?>
Notice the use of the hashbang (or shebang - yes, make all the jokes you want), which must be present at the top of every PHP file.
#!/usr/local/bin/php


* Save and exit (CTRL + O, CTRL + X)
* Save and exit (CTRL + O, CTRL + X)
Line 74: Line 68:
$example1 now contains "altered example" and the previous contents are gone.
$example1 now contains "altered example" and the previous contents are gone.


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