Sythe.Org Forums     Register     FAQ     Members List     Calendar     Mark Forums Read    
 
Sythe.Org Forums  
   Runescape Gold

Sythe.org — A Virtual Goods Trading Hub

Make real cash! buying and selling in-game items.

We have a no-scam policy.

You can make thousands playing your favourite games here at Sythe.org.

Just sign up an account and follow the rules!


Take me to

Runescape Markets

Other Game Markets

Support Center

Register an Account

Close
Simple Php Tutorial.
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 02-25-2007, 09:21 PM
Annex's Avatar
Ballin'
Veteran (Ex-Admin)
PHP Programmers Ex-Administrator
 
Join Date: Aug 2005
Location: Some station near a pulsar
Posts: 2,334
UWotM8?
Default Simple Php Tutorial.

To start off the tutorial you must have a web host or your own server with php enabled. This will host all your php files so you can see if they are working correctly.

STARTING THE PHP CODE

We will start off from the beginning. Php stands for "Hypertext Preprocessor". This means it processes the text before HTML makes it look nice. The Php code can be embedded in an HTML page. To do that you must save the page(s) in a .php extension. Using the code
Code:
<?php
at the opening of the php code and
Code:
?>
at the end of the php code it tells the server that to parse that part of the code using php.

ECHO FUNCTION

There are many functions that you can use in php. I'm going to introduce you to a basic one called "echo". Echo displays the text you tell it to. If you were to put
Code:
echo "hello world!";
in your php code then it would say "hello world!" on the page. If you want your page to only say that then you would put this as your code
Code:
<?php
echo "hello world!";
?>
You must remember to put the semicolon after each echo because it tells the php parser to end the line. If you don't end the line after a function it will draw an error that will say something like "; expected on line <linenumber>". To echo a variable you would put
Code:
echo $variable;
. This would display the value of the variable. If you wanted to put both text and variable(s) you would need to have this code
Code:
echo "text and " + $variable;
. This would display the value text and whatever the value of $variable is.

VARIABLES

To define a varible you simply put "$" then the name you want to call the variable such as "a". That varible would be called "$a". When using it you must refer to it as "$a". "$A" is a completely different variable and would draw errors if you were referring to "$a" or it would screw your end result up. To give a variable a value you would use this code
Code:
$a = "1";
. This would make the variable "$a" have the value of 1. If the value is another variable you would put this
Code:
$a = $A
. This would mean that the value of "$a" is equal to "$A". Again you must have the semicolon after for the same reason as the echo function.

I will make more tutorials about php when I have the time to write them. For now this is what you can start with.
__________________
Reply With Quote
Reply



Cheap RS Gold Store  Runescape Gold

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

All times are GMT +1. The time now is 06:13 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.6.1