Penguin
Annotated edit history of PhpHowto version 10, including all changes. View license author blame.
Rev Author # Line
9 IanMcDonald 1 by Jeremy Arnold
1 AristotlePagaltzis 2
3 !!! Introduction
5 CraigBox 4 [PHP] was created for serverside scripting of [WebPage]s. From humble beginnings, it has become one of the most powerful languages for web application development.
1 AristotlePagaltzis 5
5 CraigBox 6 !Advantages of PHP (over other languages):
7
8 * Rapid Development: PHP is simple, fast and effective.
1 AristotlePagaltzis 9 * PHP can be as simple or as complex as you like.
10 * One of the best Manuals of ANY language I've used (or even tried to learn) http://www.php.net/manual/en/
11 * C/++ based, if you can program in C/++ or even PERL or JAVA, you should be able to take to it like a fish to water.
12 * Built in mySQL API (built in SQL DB in PHP5beta)
13 * so many many more ....
14
5 CraigBox 15 !Cons of PHP:
16
17 Yes, there are some downsides to PHP
18
6 AristotlePagaltzis 19 * Not as modular (OOP) as [JSP] (JavaServerPages) / Servlets.
1 AristotlePagaltzis 20 * Easy to code without thinking.
21
22 !!Getting Help!
5 CraigBox 23
24 Always check the [online manual|http://www.php.net/manual/en/]. It has a wealth of user submited notes and is categorised by [Function].
25
26 You can generally find the author in either [#wlug] or #phphelp on the UnderNet [IRC] network. There is also #php on the same network but #phphelp is so much better! (shameless plug) ;)
1 AristotlePagaltzis 27
28 If there is enough interest I will continue to expand this section as I have time / people bug me.
29
30 !!Installation
5 CraigBox 31
1 AristotlePagaltzis 32 See the docs below (outdated) or the Manual ... This is one program where it pays to read the manual when things down work.
33 Else come and me ask nicely.
34
35 !!Tips
36
37 __DONT__ put $_POST, $_GET or $_REQUEST varible straght into an SQL statment! Rather put the varible through the [mysql_escape_string()|http://www.php.net/manual/en/function.mysql-escape-string.php] function.
2 AristotlePagaltzis 38 Ignoring this leaves you database exposed to attacks from [ScriptKiddie]s. %%% ie.
4 PhilMurray 39 $myVarFromForm = mysql_escape_string($_REQUEST[['myVarFromForm']);
1 AristotlePagaltzis 40 $SQL = "SELECT * FROM mytable WHERE mycol = '$myVarFromForm'";
41
42 "" != '' - you can insert varibles directly into double quoted strings! Arrays (and objects) can also be inserted this way by puting the varible in a set of {} squiglyBrakets ! %%% ie.
43 $var = 'Hello ' . $name . ', ' . $myArray[[3] . ' is the 3rd array element';
44 can be writen as
45 $var = "Hello $name, {$myArray[[3]} is the 3rd array element";
46
47 I would tend to use {$name} for clarity.
10 AristotlePagaltzis 48
49 ----
50 CategoryHowto

PHP Warning

lib/blame.php:177: Warning: Invalid argument supplied for foreach()