Now, if you have installed XAMPP or another package including php on your local computer as explained in this
thread, it is actually very easy to test the php code examples on your local machine. All you need is to have Apache and php running, and copy and paste the code like in this slightly modified code
Code: Select all
echo "<h1>Have a nice weekend!</h1>";
echo "<h1>Have a nice Sunday!</h1>";
echo "<h1>Have a nice day!</h1>";
example into WordPad and save the file as a text file (don't forget the .php extension) in
<your xampp installation>/htdocs/(subfolder)/
Then point your browsere at http://localhost/tests/example1.php
That is all.
You can of course test the code on an online PHP interpreter or shell like http://ideone.com/
See http://stackoverflow.com/questions/4719 ... -languages for additional information.
A note on security: If you wan't to write "relatively secure PHP MySQL / PostgreSQL code", on the web, make sure your hoster has installed the latest stable version of php and learn to use the http://php.net/manual/en/book.pdo.php database object and prepared statements. Also store the database access file above your web directory.