User Tools

Site Tools

tools:php

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
tools:php [2024/06/03 03:23] – [Hello World, Again (with HTML)] Humphrey Boa-Garttools:php [2025/10/12 10:53] (current) Humphrey Boa-Gart
Line 1: Line 1:
-{{wst>iw-import}} +#redirect tools:languages:php
- +
-====== PHP ====== +
- +
-PHP is a server side language, meaning you can't see the source code in your browser, because all of the stuff is done on the server. To start, get some web hosting (easy) or start your own server (not as easy), and create a .php file. Having a decent knowledge of [[tools:html|HTML]] is highly recommended. If you've programmed in another web language such as ASP, or have knowledge of application languages like [[tools:cplusplus|C++]] or Java, learning PHP will be considerably easier. +
- +
-===== HELLO WORLD ===== +
- +
-Yeah... This is the ancient tradition of beginners starting out in any language. Here you go. +
- +
-  <?php +
-    echo "LOL HAI THER AMIDOINITRITE?"; +
-    print("DICKS"); +
-  ?> +
- +
-Let's go over some rulez. (The word rules does not have a 'z' in it you miserable faggot). +
- +
-All PHP code starts with <?php and ends with ?>. These are called delimiters. echo is a statement that basically prints out whatever is in the double quotes. It isn't a function. (printf() is though.) Since echo is a statement, much like require/include/exit/etc, using parenthesis around the value(s) to be echoed is optional. All statements in PHP that aren't if/else statements, while, for, do-while, for-each loops, functions, or classes end in semicolons. +
-==== Hello World, Again (with HTML) ==== +
- +
-We saw how echo can output text. But it can also output HTML code and JavaScript. Example here. +
- +
-  <?php +
-    echo "<b>LOL HAI THER</b> <i>AMIDOINITRITE?</i>"; +
-  ?> +
- +
-This'll output **LOL HAI THER** //AMIDOINITRITE?//, and if you look at the source of the PHP page, you'll see the HTML code in there. +
-===== Variables ===== +
- +
-==== Constants ==== +
- +
-===== Predefined variables ===== +
- +
-==== Types of variables ==== +
- +
-===== Operators ===== +
- +
-==== Arithmetic ==== +
- +
-==== Assignment ==== +
- +
-==== Logical ==== +
- +
-==== Comparison ==== +
- +
-==== Conditional statements and loops ==== +
- +
-==== Conditional statements ==== +
- +
-==== If ==== +
- +
-==== Switch ==== +
- +
-===== Loops ===== +
- +
-==== For loops ==== +
- +
-==== Foreach loops ==== +
- +
-==== While loops ==== +
- +
-==== Do-while loops ==== +
- +
-==== Simple Backdoor in PHP ==== +
- +
-==== Email flooder in PHP ==== +
- +
-===== Image bugs ===== +
- +
-{{tag>Tools Programming Stubs}}+
tools/php.1717384983.txt.gz · Last modified: (external edit)

Find this page online at: https://bestpoint.institute/tools/php