| Welcome to Testing. We hope you enjoy your visit. You're currently viewing our forum as a guest. This means you are limited to certain areas of the board and there are some features you can't use. If you join our community, you'll be able to access member-only sections, and use many member-only features such as customizing your profile, sending personal messages, and voting in polls. Registration is simple, fast, and completely free. Join our community! If you're already a member please log in to your account to access all of our features: |
| the ultimate pie discussion thread. | |
|---|---|
| Tweet Topic Started: Aug 25 2007, 01:09 PM (78 Views) | |
| Nuke | Aug 25 2007, 11:18 AM Post #1 |
![]()
|
PHP Basics: #1 Contents • PHP Introduction • PHP Syntax • PHP Variables PHP Introduction Before reading this Tutorial, you should have a basic Understanding of HTML and XHTML and some JavaScript knowledge would make it easier. PHP stands for PHP: Hypertext Preprocessor. PHP is a server side scripting language that is used on many occassions. Although it can't be used on InvisionFree (since IF disallows it), it comes in handy when making websites, uploading sites, etc. Some examples of PHP in action, is InvisionFree. The source coding is mainly PHP with a bit of Javascript and HTML here and there. I am currently learning PHP because I think it is more interesting than JavaScript. PHP Syntax Instead of using the <script> and </script> tags, PHP uses to <?php and ?> tags. A normal PHP file should look like this:
You can also add things like a Title for the Webpage or Document and a Comment block:
PHP Variables So now that we know the layout of a PHP File, we can start to add things to make it a Code. Below I will show you how to use Variables:
The above Code will turn out like this:
When adding a Variable you need to add the money symbol $ and then your variable name after that. Then you can use echo (Just like document.write("") in JavaScript) to write out the variable. At the end of every line in a PHP Code, a semi-colon ( ; ) must be added just like in the example above. Now to combine 2 variables together on one line, you would do the following:
The output of the above Code would look like this:
Variable Rules: When writing a Variable, make sure it starts with a LETTER or UNDERSCORE. © Nuke 2007. Not to be re-posted or edited without permission. |
![]() |
|
| Persephone | Aug 25 2007, 01:03 PM Post #2 |
|
badass turtle
|
Mind if i make some observations? (by which i mean be a complete bastard and make you rewrite most of it)
Sorry, but that's pretty much awful. You really need to give some examples of where it would be used over other forms of coding, and some really good reasons. eg, rewrite what i'm sure what someone on w3schools has already written ;D Also, please please please remove that last line. It makes you seem so disassociated from the subject. Why would anyone want to learn off anyone who seems so dispassionate about it? They want to know it's the coolest form of coding there is. Then they'll want to learn it. I'd also advise you put in more about this being recognizing the setup of a PHP file and explanation of what the simple commands do more, or even likenesses - for example, i'm pretty sure that echo is a php equivalent of javascript's document.write, and i'm interested in what the differences are. (yes, i'm aware you pointed out the likeness, but what are the exact differences? why should i be using PHP here instead of javascript? |
![]() |
|
| Persephone | Aug 25 2007, 01:09 PM Post #3 |
|
badass turtle
|
PIE IST KREIG. KREIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIG. on the food chain: vegitation > insects > birds > cats > dogs > badass turtles > humans > horses > humans who aren't under 5 foot > gaseous entities > gods > matter > energy > pie |
![]() |
|
| Wolt | Aug 25 2007, 01:53 PM Post #4 |
|
Pie is legion. |
![]() |
|
| Persephone | Aug 25 2007, 01:55 PM Post #5 |
|
badass turtle
|
i am rather fond of the badass turtles though, it has to be said. |
![]() |
|
| carnivalxx | Aug 25 2007, 08:19 PM Post #6 |
|
apple pie fucking rapes. |
![]() |
|
| Nuke | Sep 20 2007, 11:05 PM Post #7 |
![]()
|
Dude, it's a basic tutorial I wrote last year about PHP, not WHY it is better than other forms of coding or compare it to other coding languages. I'm allowed to add my own copyright, it doesn't make the tutorial less cool at all. If you don't like it, trash it. Edit: I have compared it to Javascript several times in my tutorial:
I have also edited the introduction bit to save both of us a lot of time, not because I think your right. ;) |
![]() |
|
| 1 user reading this topic (1 Guest and 0 Anonymous) | |
| « Previous Topic · Just Let Loose · Next Topic » |








2:35 PM Jul 11