WordPad, W3Schools and php. Make it simple.

with Ulysses sub forum
Post Reply
Site Admin
Posts: 184
Joined: Tue Sep 29, 2009 6:25 pm
Location: Moss Norway

WordPad, W3Schools and php. Make it simple.

Post by KBleivik »

http://www.w3schools.com/ is a well known site for web tutorials. It is easy to test and modify the HTML and JavaScript code examples with the inbuilt editor. You don't have the same option with PHP code. PHP is tightly integrated with HTML and you can write plain html code in a php file and it will function as if it were an htm(l) file, if you have the php preprocessor on your web server.

Now, if you have installed XAMPP or another package including php on your local computer as explained in this

http://www.oopschool.com/phpBB3/viewtop ... f=11&t=174

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


if ($d=="Fri")
  echo "<h1>Have a nice weekend!</h1>";
elseif ($d=="Sun")
  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)/

Example: C:\xampp\htdocs\tests\example1.php

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.

Using WordPad when you start developing HTML, CSS, JavaScript, PHP is also recommended by many professional web masters.

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest