Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[Mega-Tutorials]

Status
Not open for further replies.
MentaL's Girlfriend
Legend
Joined
Feb 24, 2003
Messages
3,473
Reaction score
30
[BLAMINATORS TUTORIAL TO PHP]

Just whipped up an intro for some people to read :p, enjoy


This tutorial will take you through the basics of PHP, and by the end of it you will be able to create small and simple PHP scripts.

PHP is a powerful language, which its main aim is to create dynamic web pages, which is what Blam Forums is built on, you will notice that all threads within Blam Forums are all from showthread.php, but each one has different content, this is a dynamic web page.
But before you learn how to create dynamics within PHP you must first learn some of its basic rules, such as syntax, which is best translated into grammer. Like all languages, english, french, german etc, you have certain ways of writing sentances, using grammer. Syntax is the same, there are certain ways to write PHP, otherwise it is wrong and wont work.
Step one would be to know the PHP tags, tags like HTML tags, shown below:

PHP:
<?php

?>
Anything inbetween those tags is treated as PHP and is executed, anything outside them is treated as HTML. But don't forget that your php files need to have the extension ".php".

The next step is to learn about variables, also known as "vars", these are best described as temporary memory, they can contain huge amounts of data, and stored in a small name. Lets look at how we would declare a variable:

PHP:
$MyVar = "Hello World!";
Okay, several things to take note of here, firstly the variable name, which is "$MyVar", and yes, the doller sign needs to be infront of every declared variable. The variable can be alphanumeric, with underscores, but not with spaces.
Next we are putting an equals sign after the variable, so show that we are "declaring" it, or in simple terms, putting data into it, also known as a "string" (ie: "String Of Data"). After that we put down what we are storing within the variable, which is "Hello World", due to this been text we need to put quotes around it, so PHP knows its a string of data and doesn't treat it as PHP syntax.
After the quotes we have a ;, this is part of PHP syntax, about 95% of PHP needs this at the end of a line, its best to think of it as a full stop. If you don't put it in, you can get all kinds of errors ;)
So now you know how to declare a variable, but i told you that PHP could make pages dynamic, and you're probably wondering how do i output data on the page.
Outputting data onto a page requires to use of a command, known as echo, this will output anything to the webpage that you specify. An example of it is shown below:

PHP:
echo "Outputting Data";
As you can see the syntax applies here, but there is no equals sing because we arn't declaring a variable, we are using a command.
The above example ouputs data, but what if you wanted to output data from a variable? This can be done too, shown below:

PHP:
echo $MyVar;
Notice how there is no quotes this time, because it is a variable and not plain text, so the PHP will swap the variable with its contents. (The quotes are delcared when we set the variable)
Now you know how to ouput plain text and variables, the next step is to output them both together.

PHP:
$Name = "Blaminator";
echo "Good Morning " . $Name . ", There are 10000 new posts.";
Here we have quotes around the plain text, but when it comes to putting a variable in, we put in an ending quote, but then a fullstop, PHP treats the fullstop as a joiner as such, it will join the 2 things together, or in this case 3 things, as we have "PlainText Variable PlainText".

Now you will see how PHP can be dynamic, using an "If Conditional", which is designed to check if something is true or false, and depending on the result you can execute different code.
An example If Conditional is shown below:

PHP:
$Name = "Blaminator";
        
        if($Name == "Blaminator"){
        echo "Your Name Is Blaminator!";
        ** else {
        echo "Your Name Is Not Blaminator.";
        **

It may look like its crazy complicated, but it is really simple when looked at in a different perspective, i will re-write the above code in "pseudo-code", this is half-code, half english, used to give you guys a better understanding.

PHP:
$Name = "Blaminator";

        If $Name Equals Blaminator Then
        echo "Your Name Is Blaminator";
        Else
        echo "Your Name Is Not Blaminator.";
        End If


Read that code outloud(:lol:), and you will see it is very simple. But getting back to the propper If Conditional, a couple of syntax rules.
The if conditional uses { brackets, anything inbetween these are what is executed depending on which side of the statement is on (if its true or false).
These brackets dont have a ; after them, it isn't required. And lastly you will notice that the statement has 2 equal signs instead of 1, this must be applied.

Building onto the If Conditional, it can have several other conditions joint onto it, an "Else-If Statement", an example of one of those is shown below, but it doesn't need explaining:

[php]
$Name = "Blaminator";
        
        if($Name == "Blaminator"){
        echo "Your Name Is Blaminator!";
        ** else if($Name == "Bob"){
        echo "Your Name Is Bob!";
        ** else if($Name == "Bill"){
        echo "Your Name Is Bill!";
        ** else {
        echo "Who are you?";
        **

Next, functions, also known in other programming languages as routines. Lets look at how to construct a function:

PHP:
function FUNCTIONNAME(PASSED-VARS){

**

The function name, like variables has to be aplphanumeric, and can contain underscores, with no spaces, however a doller sign is not needed here.
The passed-vars is an area where variables can be sent into the function when its called, we will look at this after a little more on functions.

Here is a basic function, doesn't do much, but its a function:

PHP:
function pastedata()
{
echo "Hello guys";
**

Now, if you put that in a php file you would fine that Hello World would NOT appear, any code within functions is not executed unless the function is called, so lets see how to call this function:

PHP:
pastedata();

Jjust put the function name, the brackets, and ; at the end, the function will be executed. Now lets look into those passed-vars i was talking about earlier.

PHP:
function AddNumbers($Num1, $Num2){
$Answer = $Num1 + $Num2;

echo $Num1 . " + " . $Num2 . " = " . $Answer;
**

Note that the variables "$Num1" and "$Num2" do NOT need to be declared, these are just names given for when the function is called, calling this function is shown below:

PHP:
AddNumbers(4,5);

So when the function is called, it stores 4 in $Num1, and 5 in $Num2, just as names for the function to use within its code. The function has a minor maths equation, but nothnig that would trouble you.
Basic Mathmaticle operators are: + (Plus/Addition), - (Minus/Take-Away), * (Times/Multiply), / (Divide)

If that all makes sense to you then you will be able to tell the output on that page would be: "4 + 5 = 9" (Without the quotes)

So whats the point in functions, well if you wanted to execute a math equation, like in the function above, but several times, it would be a pain to just keep writing the same equation over and over, but with that function, i can just call the function several times over, less writing, less code, and more effecient.

Well that's the introduction to functions, variables and if conditional statements. More soon :)


Source:

In this tutorial I’m going to teach you how to make your own shoutbox! I assume you have simple knowledge of PHP and MySQL. I'll do it in plain text because this is a coding tutorial, not deisning! Well first we need to think of what the steps will be. Here’s a little scheme of the project.

- Creating a MySQL table where the data will be stored, it will have 5 columns. ID, IP, Name, Time, Message.
- Creating a HTML form where people can add a shout. It will contain: Name, Message.
- Creating a PHP script that inserts those values into the appropriate columns in the MySQL table.
- Creating a PHP script that echoes (displays) out the content of the MySQL table, with a limit of 5.

Step 1:

The MySQL table:

Code:
CREATE TABLE `shoutbox` ( `id` TINYINT( 10 ) NOT NULL AUTO_INCREMENT ,
`ip` VARCHAR( 30 ) NOT NULL ,
`name` VARCHAR( 30 ) NOT NULL ,
`time` VARCHAR( 30 ) NOT NULL ,
`message` VARCHAR( 250 ) NOT NULL ,
PRIMARY KEY ( `id` ) );

This sets up a MySQL table where the values will be added in later.

Step 2:

Creating the HTML form

This step shouldn’t cause any problems because it is just plain HTML. Create a new .PHP document and call it shoutbox.php. Type this code:
HTML:
<form method=“POST” action=“shoutbox.php”>
Name: <input type=“text” name=“name”><br> //field with the name ‘name’
Message <input type=“text” name=“message”><br><br> //field with the name ‘message’
<input type=“hidden” name=“posted” value=“true“> // hidden form field containing value “true”
<input type=“submit” value=“Shout!”>
Step 3:

Creating a PHP script that inserts those values into the appropriate columns in the MySQL table.

We need to create a database file. Type this code and save the file as 'connect.php'
PHP:
<?php
$connect = mysql_connect(“host”,”username”,”password”) or die(“Failed to connect to host”)
$db = mysql_select_db(“database”) or die(“Failed to connect to database“);
?>

This file just simply connects to the database. We did this so we can include it.

Now type this code in the .PHP document before the form.

PHP:
<?php
include(“connect.php”)
If(isset($_POST[‘posted’]))
{
$name = $_POST[‘name’];
$message = $_POST[‘message’];
$time = time();
$ip = $_SERVER[‘REMOTE_ADDR‘]
$check_name_length = strlen($name); // checks length
$check_message_length = strlen($message); // checks length
If($check_name_length => 30) || if($check_message_length => 250) // if statements for length
{
echo “Please fill in the textboxes properly.”;
** else {
mysql_query(“INSERT INTO shoutbox( id, ip, name, time, message) VALUES (“NULL”,”$ip”, “$name”, “$time”, “$message”)”) or die (“Failed to add shout”);
**
**


Well this was quite a long script but it checks if the values don’t exceed the max. lengths (30 and 250).

Step 4:

Creating a PHP script that echoes out the content of the MySQL table, with a limit of 5.

Now for the last step. The page that actually puts the text on the screen. It’s very simple. Make a new PHP document and name it show_shouts.php. Now for the code:

PHP:
<?php
include(“connect.php”);
$query = Mysql_query(“SELECT * FROM shoutbox DESC id LIMIT 5”);
while($r = Mysql_fetch_array($query)
{
$time = $r[‘time’];
$name = $r[‘name’];
$message = $r[‘message’];
**

echo “Shout by $name at $time:”;
echo $message;
?>

Ok, this basically gets the values out of the database table and puts them on the screen. I hope you all learned something from this tutorial.

Thanks for reading.
 
MentaL's Girlfriend
Legend
Joined
Feb 24, 2003
Messages
3,473
Reaction score
30
[RAGESOULS TUTORIALS]

Hello this is my first tutorial on this forum i really don`t now where this is going to be if its not the right section please move it !
Whit flash you can make animated design on your website to enhance it or make a game !
So lets begin...
First of all there are
- FLASH DRAWING TOOLS


-There are five of them and can be found in DRAWING TOOLBAR which is at the left side of your screen when you start flash [If you by miracle don`t have the toolbar click on window-toolbar and check DRAWING TOOLBAR and Ok

Line Tool

Sipher - [Mega-Tutorials] - RaGEZONE Forums
Oval Tool

Sipher - [Mega-Tutorials] - RaGEZONE Forums
Rectangular Tool

Sipher - [Mega-Tutorials] - RaGEZONE Forums
Pencil Tool

Sipher - [Mega-Tutorials] - RaGEZONE Forums
Text Tool


Your drawing can be saved in many formats
NOTE:The flash guide will contain CODE basics.

MOTION CAPABILITY

Open a new flash file by pressing Ctrl+N buttons.
Now the New Document window will appear
Select the General panel and then choose the Type: Flash Document and press OK button.
The time line is open by tiping (Ctrl+Alt+T).
It must be a layer called "Layer1" in your timeline window now.

Sipher - [Mega-Tutorials] - RaGEZONE Forums


Select whit the mouse the first frame and then import your image in to the stage which you want to implement the motion capability .
FOLLOW THIS STEPS select File then Import and then Import to Stage
You need an image to import you can simply draw it (cube , circle)
And now select your object on to the stage and press F8 to convert this image to a Symbol(very simple no?)and now the convert to symbol window will pop-up on the screen...
Name your symbol how every you like..and now select graphic behavior and press the OK button.

Your symbol is in frame1 of Layer1. Select frame 30 and press F6 to insert a new keyframe.
Now still keeping playhead on frame 30 move your Symbol to any position .
Now select any frame between, 2 to 29 and then select motion from the the pop-up menu in the Property inspector.

Press (Ctrl+Enter) to view your moving image !

THE CLOCK
Insert lets say like 3 layers in your timeline window whit the name, "background" and "text" and "actions". Like in the one shown below
Sipher - [Mega-Tutorials] - RaGEZONE Forums


Select frame1 of background layer, design the framework for the digital clock now select frame2 and the button press F5
Go to frame1 of your text layer and insert dynamic text field in your work area and select frame2 and press F5 .next to insert a Dynamic text field select text tool from your tool box.
Select the dynamic text from Text pop-up menu in the Property inspector now click on your work area to put the digital clock to appear.
Now name this dynamic text field as "firstclock_txt"
Next go to frame1 of your actions layer. Copy and paste the below mentioned script in the action panel
(STANDARD SCRIPT)

time=new Date(); // time object
var seconds = time.getSeconds()
var minutes = time.getMinutes()
var hours = time.getHours()
if (hours<12) {
ampm = "AM";
}
else{
ampm = "PM";
}
while(hours >12){
hours = hours - 12;
}
if(hours<10)
{
hours = "0" + hours;
}
if(minutes<10)
{
minutes = "0" + minutes;
}
if(seconds<10)
{
seconds = "0" + seconds;
}
firstclock_txt.text = hours + ":" + minutes + ":" + seconds +" "+ ampm;



Next go to frame2 of actions layer and press F6 keeping the play head on the frame2, go to action panel and copy paste the below mentioned script.

gotoAndPlay(1);

Press Ctrl+Enter to view your clock.
Taadaaa!

Code basics.

Variables can be thought of as named boxes in which we store information.
variable_name = some value;

Paths to objects.

An Object in Flash can be pretty much anything. Common Objects include MovieClips, Buttons and TextField.

Pop ups windows for flash
<script language="JavaScript">
<!--
function spawnWindow(URL,Name,features) {
window.open(URL,Name,features);
}
//-->
</script>
spawnWindow('www.forum.ragezone.com','RageZone','toolbar=no,location=yes,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=400')

on (release) {
getURL ("javascript:spawnWindow...");
}

Bookmark button

on (release) {
getURL ("javascript:window.external.AddFavorite(
'http://forum.ragezone.com/','ragezone.com.MMORPG Resources');");
}
 
MentaL's Girlfriend
Legend
Joined
Feb 24, 2003
Messages
3,473
Reaction score
30
[HYBRIDS TUTORIALS]

Heres a Tutorial on the Registry.

The Tutorial is Broken down into 3 sections.

1)Little Background on the Registry.

2)Adding values to the registry.

3)Deleting Keys and Values.

-------------------------------------------------------------------------------------------------------

1) ****Little Background on the Registry.****

The Registry is basically a database used to store Information,Settings and Options. It contains everything from settings of all the Hardware, Software and Users.

The registry is mainly made up of the similar directory structure made of on your hard disk. Each branch is called a Hive. Now inside the Hive there lies Key's. Now within the Key there are values of course. There are really three main types of values.

1)String
2)Binary
3)DWORD

I will go into more detail about them further on in the tutorial.

Now you might be saying to your self? What are Branches?

Branches are shown as a Folder Icon in the registry with the Branches name to the right of it.

There are 5 main branches in Windows XP and 2000 each with a portion of information which make up the registry.

1)HKEY_CLASSES_ROOT: This branch has all the file types on your computer.

2)HKEY_CURRENT_USER: This branch links to the section of HKEY_USERS appropriate for the user currently logged onto the Computer.

3)HKEY_LOCAL_MACHINE: This branch contains the Computer's specific information about the type of hardware, software, and other preferences on the Computer.

4)HKEY_USERS: This contains certain prefernces for each of the user at the Computer.

5)HKEY_CURRENT_CONFIG: This branches to the HKEY_LOCAL_MACHINE for current hardware configuration.

Now onto the Values of the Registry but more in depth this time.

1)REG_BINARY: This type stores the value as raw binary data.

2)REG_DWORD: This type represents the data by a four byte number and is commonly used for boolean values such as "0" to disable and "1" for enabling. Like a Light Switch, Up to put light on and down to put light off.

3)REG_SZ: This type is a standard string used to represent human readable text values.

Also there are REG_EXPAND_SZ and REG_MULTI_SZ.

2) ****Adding values to the registry.****

Now enough of just explaining the registry lets do something with the registry.

Firstly you will need Notepad. Im sure everyones got that.

My First Example is going to input "Hello" on the top Bar of Internet Explorer.

Now to input the commands.

<--------------Starting Commands-------------->

REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]

"Window Title"="Hello"

<--------------End of Commands-------------->

Now I Will explain this to you.

The line "[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]" means that Your little reg file will look for that location in the registry.

The line "Window Title"="Hello"

Now all this does is make a new String Value "Window Title" and in that Key the Data is "Hello"

Pretty simple isnt it. Now just save this as a .reg file and run it. Now these commands have only been tested on Windows XP it might be a different location in other Versions of Windows.

Now go check if it has worked.

This is how you can add things to the registry or change things to the registry.

3) ****Deleting Keys and Values.****

Now to delete a whole Key from the registry do the same as I told you above but with different commands.

<--------------Starting Commands-------------->

REGEDIT4

[-HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]

<--------------End of Commands-------------->

Now I dont reccomend doing that if you use Internet Explorer. But as you can see all we done is place a "-" sign in front of the Branch.

Now to delete Individual Keys like the one we made for Internet Explorer is as followed.

<--------------Starting Commands-------------->

REGEDIT4

[HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main]
"Window Title"=-

<--------------End of Commands-------------->

Now as you can see we have specified the branch and location. Then we have placed the Value's name and put a "-" sign to it so it deletes whats inside that value.

This is the end to another tutorial. Hope this helps you understand abit about the registry.

By Hybr!d 14/12/05

If you got any suggestions email me at ali_hybrid@hotmail.com

This is a Tutorial my Programming Teacher gave to me at School and found it very very useful to learn the basics of Assembly. I Hope you like it. I couldnt find the name of the original author so sorry :(.

Assembler

Assembler is the start and the end of all programming languages. After all, all languages are translated to assembler. In most languages we deal with relatively clear syntaxes. However, it's a completely other story in assembler where we use abbreviations and numbers and where it all seems so weird …


I. Pieces, bits and bytes:


• BIT - The smallest possible piece of data. It can be either a 0 or a 1. If you put a bunch of bits together, you end up in the 'binary number system'

i.e. 00000001 = 1 00000010 = 2 00000011 = 3 etc.

• BYTE - A byte consists of 8 bits. It can have a maximal value of 255 (0-255). To make it easier to read binary numbers, we use the 'hexadecimal number system'. It's a 'base-16 system', while binary is a 'base-2 system'

• WORD - A word is just 2 bytes put together or 16 bits. A word can have a maximal value of 0FFFFh (or 65535d).

• DOUBLE WORD - A double word is 2 words together or 32 bits. Max value = 0FFFFFFFF (or 4294967295d).

• KILOBYTE - 1000 bytes? No, a kilobyte does NOT equal 1000 bytes! Actually, there are 1024 (32*32) bytes.

• MEGABYTE - Again, not just 1 million bytes, but 1024*1024 or 1,048,578 bytes.


---------------------------------------------------------------------------------------------


II. Registers:

Registers are “special places” in your computer's memory where we can store data. You can see a register as a little box, wherein we can store something: a name, a number, a sentence. You can see a register as a placeholder.

On today’s average WinTel CPU you have 9 32bit registers (w/o flag registers). Their names are:

EAX: Extended Accumulator Register
EBX: Extended Base Register
ECX: Extended Counter Register
EDX: Extended Data Register
ESI: Extended Source Index
EDI: Extended Destination Index
EBP: Extended Base Pointer
ESP: Extended Stack Pointer
EIP: Extended Instruction Pointer

Generally the size of the registers is 32bit (=4 bytes). They can hold data from 0-FFFFFFFF (unsigned). In the beginning most registers had certain main functions which the names imply, like ECX = Counter, but in these days you can - nearly - use whichever register you like for a counter or stuff (only the self defined ones, there are counter-functions which need to be used with ECX). The functions of EAX, EBX, ECX, EDX, ESI and EDI will be explained when I explain certain functions that use those registers. So, there are EBP, ESP, EIP left:

EBP: EBP has mostly to do with stack and stack frames. Nothing you really need to worry about, when you start. ;)

ESP: ESP points to the stack of a current process. The stack is the place where data can be stored for later use (for more information, see the explanation of the push/pop instructions)

EIP: EIP always points to the next instruction that is to be executed.


There's one more thing you have to know about registers: although they are all 32bits large, some parts of them (16bit or even 8bit) can not be addressed directly.

The possibilities are:

32bit Register 16bit Register 8bit Register
EAX AX AH/AL
EBX BX BH/BL
ECX CX CH/CL
EDX DX DH/DL
ESI SI -----
EDI DI -----
EBP BP -----
ESP SP -----
EIP IP -----

A register looks generally this way:

|--------------------------- EAX: 32bit (=1 DWORD =4BYTES) -------------------------|

|------- AX: 16bit (=1 WORD =2 BYTES) ----|

|- AH:8bit (=1 BYTE)-|- AL:8bit (=1 BYTE)-|

|-----------------------------------------|--------------------|--------------------|
|XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX|XXXXXXXXXXXXXXXXXXXX|XXXXXXXXXXXXXXXXXXXX|
|-----------------------------------------|--------------------|--------------------|

So, EAX is the name of the 32bit register, AX is the name of the "Low Word" (16bit) of EAX and AL/AH (8bit) are the “names” of the "Low Part" and “High Part” of AX. BTW, 4 bytes is 1 DWORD, 2 bytes is 1 WORD.

REMARK: make sure you at least read the following about registers. It’s quite practical to know it although not that important.

All this makes it possible for us to make a distinction regarding size:

• i. byte-size registers: As the name says, these registers all exactly 1 byte in size. This does not mean that the whole (32bit) register is fully loaded with data! Eventually empty spaces in a register are just filled with zeroes. These are the byte-sized registers, all 1 byte or 8 bits in size:

o AL and AH
o BL and BH
o CL and CH
o DL and DH

• ii. word-size registers: Are 1 word (= 2 bytes = 16 bits) in size. A word-sized register is constructed of 2 byte-sized registers. Again, we can divide these regarding their purpose:

o 1. general purpose registers:

AX (word-sized) = AH + AL -> the '+' does *not* mean: 'add them up'. AH and AL exist independently, but together they form AX. This means that if you change AH or AL (or both), AX will change too!

-> 'accumulator': used to mathematical operations, store strings,..

BX -> 'base': used in conjunction with the stack (see later)

CX -> 'counter'

DX -> 'data': mostly, here the remainder of mathematical operations is stored

DI -> 'destination index': i.e. a string will be copied to DI

SI -> 'source index': i.e. a string will be copied from SI

o 2. index registers:

BP -> 'base pointer': points to a specified position on the stack (see later)
SP -> 'stack pointer': points to a specified position on the stack (see later)

o 3. segment registers:

CS -> 'code segment': instructions an application has to execute (see later)
DS -> 'data segment': the data your application needs (see later)
ES -> 'extra segment': duh! (see later)
SS -> 'stack segment': here we'll find the stack (see later)

o 4. special:

IP -> 'instruction pointer': points to the next instruction. Just leave it alone ;)

• iii. Doubleword-size registers:

2 words = 4 bytes = 32 bits. EAX, EBX, ECX, EDX, EDI…

If you find an 'E' in front of a 16-bits register, it means that you are dealing with a 32-bits register. So, AX = 16-bits; EAX = the 32-bits version of EAX.


---------------------------------------------------------------------------------------------


III. The flags:

Flags are single bits which indicate the status of something. The flag register on modern 32bit CPUs is 32bit large. There are 32 different flags, but don't worry. You will mostly only need 3 of them in reversing. The Z-Flag, the O-Flag and the C-Flag. For reversing you need to know these flags to understand if a jump is executed or not. This register is in fact a collection of different 1-bit flags. A flag is a sign, just like a green light means: 'ok' and a red one 'not ok'. A flag can only be '0' or '1', meaning 'not set' or 'set'.

• The Z-Flag:
o The Z-Flag (zero flag) . It can be set (status: 1) or cleared (status: 0) by several opcodes when the last instruction that was performed has 0 as result. You might wonder why "CMP" (more on this later) could set the zero flag, because it compares something - how can the result of the comparison be 0? The answer on this comes later ;)

• The O-Flag:
o The O-Flag (overflow flag) It is set (status: 1) when the last operation changed the highest bit of the register that gets the result of an operation. For example: EAX holds the value 7FFFFFFF. If you use an operation now, which increases EAX by 1 the O-Flag would be set, because the operation changed the highest bit of EAX (which is not set in 7FFFFFFF, but set in 80000000 - use calc.exe to convert hexadecimal values to binary values). Another need for the O-Flag to be set, is that the value of the destination register is neither 0 before the instruction nor after it.

• The C-Flag:
o The C-Flag (Carry flag). It is set, if you add a value to a register, so that it gets bigger than FFFFFFFF or if you subtract a value, so that the register value gets smaller than 0.


---------------------------------------------------------------------------------------------


IV. Segments en offsets

A segment is a piece in memory where instructions (CS), data (DS), the stack (SS) or just an extra segment (ES) are stored. Every segment is divided in 'offsets'. In 32-bits applications (Windows 95/98/ME/2000), these offsets are numbered from 00000000 to FFFFFFFF. 65536 pieces of memory thus 65536 memory addresses per segment. The standard notation for segments and offsets is:

SEGMENT : OFFSET = Together, they point to a specific place (address) in memory.

See it like this:

A segment is a page in a book : An offset is a specific line at that page.


---------------------------------------------------------------------------------------------


V. The stack:

The Stack is a part in memory where you can store different things for later use. See t as a pile of books in a chest where the last put in is the first to grab out. Or imagine the stack as a paper basket where you put in sheets. The basket is the stack and a sheet is a memory address (indicated by the stack pointer) in that stack segment. Remember following rule: the last sheet of paper you put in the stack, is the first one you'll take out! The command 'push' saves the contents of a register onto the stack. The command 'pop' grabs the last saved contents of a register from the stack and puts it in a specific register.


---------------------------------------------------------------------------------------------


VI. INSTRUCTIONS (alphabetical)

Please note, that all values in ASM mnemonics (instructions) are *always* hexadecimal.


Most instructions have two operators (like "add EAX, EBX"), but some have one ("not EAX") or even three ("IMUL EAX, EDX, 64"). When you have an instruction that says something with "DWORD PTR [XXX]" then the DWORD (4 byte) value at memory offset [XXX] is meant. Note that the bytes are saved in reverse order in the memory (WinTel CPUs use the so called “Little Endian” format. The same is for "WORD PTR [XXX]" (2 byte) and "BYTE PTR [XXX]" (1 byte).

Most instructions with 2 operators can be used in the following ways (example: add):

add eax,ebx ;; Register, Register
add eax,123 ;; Register, Value
add eax,dword ptr [404000] ;; Register, Dword Pointer [value]
add eax,dword ptr [eax] ;; Register, Dword Pointer [register]
add eax,dword ptr [eax+00404000] ;; Register, Dword Pointer [register+value]
add dword ptr [404000],eax ;; Dword Pointer [value], Register
add dword ptr [404000],123 ;; Dword Pointer [value], Value
add dword ptr [eax],eax ;; Dword Pointer [register], Register
add dword ptr [eax],123 ;; Dword Pointer [register], Value
add dword ptr [eax+404000],eax ;; Dword Pointer [register+value], Register
add dword ptr [eax+404000],123 ;; Dword Pointer [register+value], value


---------------------------------------------------------------------------------------------

ADD (Addition)
Syntax: ADD destination, source

The ADD instruction adds a value to a register or a memory address. It can be used in
these ways:

These instruction can set the Z-Flag, the O-Flag and the C-Flag (and some others, which
are not needed for cracking).

---------------------------------------------------------------------------------------------

AND (Logical And)
Syntax: AND destination, source

The AND instruction uses a logical AND on two values.
This instruction *will* clear the O-Flag and the C-Flag and can set the Z-Flag.
To understand AND better, consider those two binary values:

1001010110
0101001101

If you AND them, the result is 0001000100
When two 1 stand below each other, the result is of this bit is 1, if not: The result
is 0. You can use calc.exe to calculate AND easily.

---------------------------------------------------------------------------------------------

---------------------------------------------------------------------------------------------

CALL (Call)
Syntax: CALL something

The instruction CALL pushes the RVA (Relative Virtual Address) of the instruction that
follows the CALL to the stack and calls a sub program/procedure.

CALL can be used in the following ways:

CALL 404000 ;; MOST COMMON: CALL ADDRESS
CALL EAX ;; CALL REGISTER - IF EAX WOULD BE 404000 IT WOULD BE SAME AS THE ONE ABOVE
CALL DWORD PTR [EAX] ;; CALLS THE ADDRESS THAT IS STORED AT [EAX]
CALL DWORD PTR [EAX+5] ;; CALLS THE ADDRESS THAT IS STORED AT [EAX+5]

---------------------------------------------------------------------------------------------

CDQ (Convert DWord (4Byte) to QWord (8 Byte))
Syntax: CQD

CDQ is an instruction that always confuses newbies when it appears first time. It is
mostly used in front of divisions and does nothing else then setting all bytes of EDX
to the value of the highest bit of EAX. (That is: if EAX <80000000, then EDX will be
00000000; if EAX >= 80000000, EDX will be FFFFFFFF).

---------------------------------------------------------------------------------------------

CMP (Compare)
Syntax: CMP dest, source

The CMP instruction compares two things and can set the C/O/Z flags if the result fits.

CMP EAX, EBX ;; compares eax and ebx and sets z-flag if they are equal
CMP EAX,[404000] ;; compares eax with the dword at 404000
CMP [404000],EAX ;; compares eax with the dword at 404000

---------------------------------------------------------------------------------------------

DEC (Decrement)
Syntax: DEC something

dec is used to decrease a value (that is: value=value-1)

dec can be used in the following ways:
dec eax ;; decrease eax
dec [eax] ;; decrease the dword that is stored at [eax]
dec [401000] ;; decrease the dword that is stored at [401000]
dec [eax+401000] ;; decrease the dword that is stored at [eax+401000]

The dec instruction can set the Z/O flags if the result fits.

---------------------------------------------------------------------------------------------

DIV (Division)
Syntax: DIV divisor

DIV is used to divide EAX through divisor (unsigned division). The dividend is always
EAX, the result is stored in EAX, the modulo-value in EDX.

An example:
mov eax,64 ;; EAX = 64h = 100
mov ecx,9 ;; ECX = 9
div ecx ;; DIVIDE EAX THROUGH ECX

After the division EAX = 100/9 = 0B and ECX = 100 MOD 9 = 1

The div instruction can set the C/O/Z flags if the result fits.

---------------------------------------------------------------------------------------------

IDIV (Integer Division)
Syntax: IDIV divisor

The IDIV works in the same way as DIV, but IDIV is a signed division.
The idiv instruction can set the C/O/Z flags if the result fits.

---------------------------------------------------------------------------------------------

IMUL (Integer Multiplication)
Syntax: IMUL value
IMUL dest,value,value
IMUL dest,value

IMUL multiplies either EAX with value (IMUL value) or it multiplies two values and puts
them into a destination register (IMUL dest, value, value) or it multiplies a register
with a value (IMUL dest, value).

If the multiplication result is too big to fit into the destination register, the
O/C flags are set. The Z flag can be set, too.

---------------------------------------------------------------------------------------------

INC (Increment)
Syntax: INC register

INC is the opposite of the DEC instruction; it increases values by 1.
INC can set the Z/O flags.


---------------------------------------------------------------------------------------------

INT
Syntax: int dest

Generates a call to an interrupt handler. The dest value must be an integer (e.g., Int 21h).
INT3 and INTO are interrupt calls that take no parameters but call the handlers for
interrupts 3 and 4, respectively.

---------------------------------------------------------------------------------------------

JUMPS
These are the most important jumps and the condition that needs to be met, so that
they'll be executed (Important jumps are marked with * and very important with **):

JA* - Jump if (unsigned) above - CF=0 and ZF=0
JAE - Jump if (unsigned) above or equal - CF=0
JB* - Jump if (unsigned) below - CF=1
JBE - Jump if (unsigned) below or equal - CF=1 or ZF=1
JC - Jump if carry flag set - CF=1
JCXZ - Jump if CX is 0 - CX=0
JE** - Jump if equal - ZF=1
JECXZ - Jump if ECX is 0 - ECX=0
JG* - Jump if (signed) greater - ZF=0 and SF=OF (SF = Sign Flag)
JGE* - Jump if (signed) greater or equal - SF=OF
JL* - Jump if (signed) less - SF != OF (!= is not)
JLE* - Jump if (signed) less or equal - ZF=1 and OF != OF
JMP** - Jump - Jumps always
JNA - Jump if (unsigned) not above - CF=1 or ZF=1
JNAE - Jump if (unsigned) not above or equal - CF=1
JNB - Jump if (unsigned) not below - CF=0
JNBE - Jump if (unsigned) not below or equal - CF=0 and ZF=0
JNC - Jump if carry flag not set - CF=0
JNE** - Jump if not equal - ZF=0
JNG - Jump if (signed) not greater - ZF=1 or SF!=OF
JNGE - Jump if (signed) not greater or equal - SF!=OF
JNL - Jump if (signed) not less - SF=OF
JNLE - Jump if (signed) not less or equal - ZF=0 and SF=OF
JNO - Jump if overflow flag not set - OF=0
JNP - Jump if parity flag not set - PF=0
JNS - Jump if sign flag not set - SF=0
JNZ - Jump if not zero - ZF=0
JO - Jump if overflow flag is set - OF=1
JP - Jump if parity flag set - PF=1
JPE - Jump if parity is equal - PF=1
JPO - Jump if parity is odd - PF=0
JS - Jump if sign flag is set - SF=1
JZ - Jump if zero - ZF=1

---------------------------------------------------------------------------------------------

LEA (Load Effective Address)
Syntax: LEA dest,src

LEA can be treated the same way as the MOV instruction. It isn't used too much for its
original function, but more for quick multiplications like this:

lea eax, dword ptr [4*ecx+ebx]
which gives eax the value of 4*ecx+ebx

---------------------------------------------------------------------------------------------

MOV (Move)
Syntax: MOV dest,src

This is an easy to understand instruction. MOV copies the value from src to dest and src
stays what it was before.

There are some variants of MOV:

MOVS/MOVSB/MOVSW/MOVSD EDI, ESI: Those variants copy the byte/word/dword ESI points to,
to the space EDI points to.

MOVSX: MOVSX expands Byte or Word operands to Word or Dword size and keeps the sign of the
value.

MOVZX: MOVZX expands Byte or Word operands to Word or Dword size and fills the rest of the
space with 0.

---------------------------------------------------------------------------------------------

MUL (Multiplication)
Syntax: MUL value

This instruction is the same as IMUL, except that it multiplies unsigned. It can set the
O/Z/F flags.

---------------------------------------------------------------------------------------------

NOP (No Operation)
Syntax: NOP

This instruction does absolutely nothing
That's the reason why it is used so often in reversing ;)

---------------------------------------------------------------------------------------------

OR (Logical Inclusive Or)
Syntax: OR dest,src

The OR instruction connects two values using the logical inclusive or.
This instruction clears the O-Flag and the C-Flag and can set the Z-Flag.

To understand OR better, consider those two binary values:

1001010110
0101001101

If you OR them, the result is 1101011111

Only when there are two 0 on top of each other, the resulting bit is 0. Else the resulting
bit is 1. You can use calc.exe to calculate OR. I hope you understand why, else
write down a value on paper and try ;)

---------------------------------------------------------------------------------------------

POP
Syntax: POP dest

POP loads the value of byte/word/dword ptr [esp] and puts it into dest. Additionally it
increases the stack by the size of the value that was popped of the stack, so that the next
POP would get the next value.

---------------------------------------------------------------------------------------------

PUSH
Syntax: PUSH operand

PUSH is the opposite of POP. It stores a value on the stack and decreases it by the size
of the operand that was pushed, so that ESP points to the value that was PUSHed.

---------------------------------------------------------------------------------------------

REP/REPE/REPZ/REPNE/REPNZ
Syntax: REP/REPE/REPZ/REPNE/REPNZ ins

Repeat Following String Instruction: Repeats ins until CX=0 or until indicated condition
(ZF=1, ZF=1, ZF=0, ZF=0) is met. The ins value must be a string operation such as CMPS, INS,
LODS, MOVS, OUTS, SCAS, or STOS.

---------------------------------------------------------------------------------------------

RET (Return)
Syntax: RET
RET digit

RET does nothing but return from a part of code that was reached using a CALL instruction.
RET digit cleans the stack before it returns.

---------------------------------------------------------------------------------------------

SUB (Subtraction)
Syntax: SUB dest,src

SUB is the opposite of the ADD command. It subtracts the value of src from the value of
dest and stores the result in dest.

SUB can set the Z/O/C flags.

---------------------------------------------------------------------------------------------

TEST
Syntax: TEST operand1, operand2

This instruction is in 99% of all cases used for "TEST EAX, EAX". It performs a Logical
AND(AND instruction) but does not save the values. It only sets the Z-Flag, when EAX is 0
or clears it, when EAX is not 0. The O/C flags are always cleared.

---------------------------------------------------------------------------------------------

XOR
Syntax: XOR dest,src

The XOR instruction connects two values using logical exclusive OR (remember OR uses
inclusive OR).

This instruction clears the O-Flag and the C-Flag and can set the Z-Flag.
To understand XOR better, consider those two binary values:

1001010110
0101001101

If you OR them, the result is 1100011011

When two bits on top of each other are equal, the resulting bit is 0. Else the resulting
bit is 1. You can use calc.exe to calculate XOR.
The most often seen use of XOR is “XOR, EAX, EAX”. This will set EAX to 0, because when
you XOR a value with itself, the result is always 0. I hope you understand why, else
write down a value on paper and try ;)

---------------------------------------------------------------------------------------------

VII. Logical Operations


Here follow the most used in a reference table.


Reference Table

operation src dest result
AND 1 1 1
1 0 0
0 1 0
0 0 0
OR 1 1 1
1 0 1
0 1 1
0 0 0
XOR 1 1 0
1 0 1
0 1 1
0 0 0
NOT 0 N/A 1
1 N/A 0

---------------------------------------------------------------------------------------------

Well Guys heres a tutorial on as said in the Title of the thread. If you set up a server you can test your php scripts on your pc before you webhost them.

Firstly download the following packages.







Now we got that over we can start setting up your Webserver.

Apache:

Well its pretty simple just use the executable you downloaded and install it in the location of C:\Apache\Apache.When you reach Server information input this

Network Domain: localhost
Server Name: 127.0.0.1
Admin Email: you@yourdomain.com

Now run apache from the location you just installed it in. Now to check if it is working go to your Browser and input the apache frontpage should come up and that means its working.

--------------------------------------------------------------------------
PHP:

This part is abit more tricky. Firstly extract PHP 5.0 to C:\PHP.
Then go to your Apache folder in Program Files and open the folder conf.
Inside open the file httpd in Notepad. Then go to edit-->find and input AddType application/x-tar .tgz then you should find it highlighted. Right under that add these two lines.

LoadModule php5_module c:/php/php5apache.dll
AddType application/x-httpd-php .php

We arent finished yet with that file. Now go to edit-->find and input
To use server-parsed HTML files
right under that there should be

#AddType text/html .shtml
#AddHandler server-parsed .shtml

Now at the end of #AddType text/html .shtml add .php
So it would look like this.

#AddType text/html .shtml .php
#AddHandler server-parsed .shtml

Ok thats enough of that file. Go File--> Save and that should be enough of that file.

We arent quite finished yet....

Now go Back to C:\PHP and find the file php.ini-dist. Now right click it and rename it and delete -dist from it. Now it should be a readable file called php.ini. Open it up in Notepad and go edit-->find and input doc_root =

Now you should land here:

doc_root =

Now input this C:\Apache\Apache\htdocs so it should look like this.

doc_root ="C:\Apache\Apache\htdocs"

We arent finished yet now go to edit-->find and search for ;extension=php_mysql.dll

Now just remove ";" that and it should be fine so it should look like this

extension=php_mysql.dll

One more thing we have to specify where the extensions for PHP are now go to edit-->find and look for extension_dir =

Now you should land here

extension_dir =

Now input the following in C:\PHP\ext so it should look like this.

extension_dir = "C:\PHP\ext"

We finished with this file now just go to file-->save

Now we have to move the file into C:\WINDOWS. Just copy it in there and everything should be fine.

Also copy the following files into C:\WINDOWS\system32

php5apache.dll
php5ts.dll
php_mysql.dll which is located in C:\PHP\ext

Ohh I almost forgot also copy the following files into C:\Apache\Apache

libmysql.dll
php_mysql.dll which is located in C:\PHP\ext

Thats all for PHP..

Now go check out if PHP is working go to C:\Apache\Apache and double click the application and if it says PHP 5.0.4 is running congrats its working. To double check make a file called hey.php and enter the following in to it.

<?
phpinfo();
?>

Now run the file by starting apache and inputting in the browser

If all the info comes up it working also lol.
--------------------------------------------------------------------------
Now onto MySQL

Well it is Pretty straight forward unzip the file to a folder and install it and then configure it to your settings. Ver Very simple.

--------------------------------------------------------------------------
Well thats all hope everything works out.

Easy Conversions..

This guide includes the following conversions.

1) Binary -----> Decimal
2) Binary -----> Hexadecimal
3) Decimal -----> Binary
4) Decimal -----> Hexadecimal
5) Hexadecimal -----> Binary
6) Hexadecimal -----> Decimal

To get started remember these things.

1) Binary is Base 2. It consists of 0's and 1's

Example -----> 1010

2) Decimal is Base 10. It consists of 0,1,2,3,4,5,6,7,8,9

Example -----> 312

3) Hexadecimal is Base 16. It consists of 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F

Example -----> 1A7


Also you should remember this table

Table 1

Bin: Hex: Dec:

0000 | 0 | 0
0001 | 1 | 1
0010 | 2 | 2
0011 | 3 | 3
0100 | 4 | 4
0101 | 5 | 5
0110 | 6 | 6
0111 | 7 | 7
1000 | 8 | 8
1001 | 9 | 9
1010 | A | 10
1011 | B | 11
1100 | C | 12
1101 | D | 13
1110 | E | 14
1111 | F | 15

These are the basics you need to know of by heart.

Now onto the conversion part.

1) ***Binary -----> Decimal***

As we know Binary is base 2.

Example -----> 1010

Last Digit = 0

0*(2^0)

This simply means 0 multiplied by 2 to the power 0.

Third Digit = 1

1*(2^1)

Second Digit = 0

0*(2^2)

First Digit = 1

1*(2^3)


So the Whole Equation Should look like this

1*(2^3) + 0*(2^2) + 1*(2^1) + 0*(2^0)

Simplify that and it would look like this

8 + 0 + 2 + 0 = 10

Therefore 1010 in Binary = 10 in Decimal

That is how you would go around any Binary -----> Decimal Conversion

2) ***Binary -----> Hexadecimal***

Ok Over here we have to refer to Table 1.

Example -----> 0001

Now we look up at table and see that 0001 refers to 1 in Hex.

Therefore 0001 in Binary = 1 in Hex

Example 2 -----> 100001101101

Over here we split the binary digits into groups of 4. So it would look like this.

Example 2 split up -----> 1000|0110|1101

Now we Can Easily use Table 1 to convert this String.

First Group = 1000

Hex = 8

Second Group = 0110

Hex = 6

Third Group = 1101

Hex = D

Therefore 100001101101 in Binary = 86D in Hexadecimal.

3) ***Decimal -----> Binary***

Ok this is a bit different then the other conversions so pay attention!!

Example -----> 468

We try to get Common Multiples that get closest to the original number without going above it.

Therefore it would look like this.

256 128 64 32 16 8 4 2 1

Now we say does 468 divide into 256.. As you use your calculator you see it does go into it Once and the remainder of 468 - 256 = 212

Now we say does 212 divide into 128.. As you use your calculator you see it does only Once again and the remainder is 212 - 128 = 84

Now we say Does 84 divide into 64.. As you your calculator you see it does only once again and the remainder is 84 - 64 = 20

Now we say does 20 divide into 32.. As you use your calculator or common sense you see it doesnt so and the remainder is still 20.

Now we say does 20 divide into 16.. As you use your calculator you see it does go into it once and the remainder is 20 - 16 = 4

Now we say does 4 divide into 8.. As you use your calculator you see it doesnt so the remainder is still 4.

Now we say does 4 divide into 4.. As you use your calculator you see it does and the remainder is 4 - 4 = 0

Therefore the last 2 digits are going to be 0 because there are no remainders.

Now to put it all together.

Does divide = 1
Doesnt divide = 0

So its going to look like this

468 in Decimal = 111010100 in Binary.

As you can see all I do is see if the number divides into the Common Multiple and then get the Remainder. We keep doing the same thing until we reach to the remainder of 0.

4) ***Decimal -----> Hexadecimal***

This Conversion uses 3 steps. It goes like this.

Decimal -----> Binary -----> Hexadecimal

Thats how we get the Conversion Decimal -----> Hexadecimal.

Example -----> 468 Decimal

We know this in Binary = 111010100

As you can see there are 9 digits so we cant split them up into groups of 4. So we have to add 3 "0's" to the front the string to make it possible for us to split them up into groups of 4.

The Binary String should look like this now.

Binary = 000111010100

Now If we split them up into groups of 4 it should look like this.

Binary Split up = 0001|1101|0100

Now we Refer to Table 1

First Group = 0001

Hex = 1

Second Group = 1101

Hex = D

Third Group = 0100

Hex = 4

Therefore 468 Decimal = 1D4 Hexadecimal.

5) ***Hexadecimal -----> Binary***

This Conversion all has to do with Table 1.

Example -----> A2FC Hexadecimal

Now just Allocate each Character with its Binary Number.

First Character = A

Binary = 1010

Second Character = 2

Binary = 0010

Third Character = F

Binary = 1111

Fourth Character = C

Binary = 1100

Now just simply put it all together.

Therefore A2FC Hexadecimal = 1010 0010 1111 1100 Binary

6) ***Hexadecimal -----> Decimal***

Now we know Hexadecimal is Base 16 like stated Above.

Remember before starting the conversion convert all Alphabets into Decimal using the Table it will make it easier to convert.

Example = 32A Hexadecimal

Last Digit = A

A in Decimal is 10

10*(16^0)

Second Digit = 2

2*(16^1)

First Digit = 3

3*(16^2)

So the Whole Equation Should look like this

3*(16^2) + 2*(16^1) + 10*(16^0)

Simplify that and it should equal

768 + 32 + 10 = 810

Therefore 32A Hexadecimal = 810 Decimal

By Hybr!d

This guide is mainly for Beginers to the Language to just get grasp of it.

This guide is broken up into 6 Sections:

1) Introduction

2) Basic HTML Tags

3) HTML Links

4) HTML Tables

5) HTML Images

6) HTML Background

Firstly HTML stands for Hypertext Markup Language. It is used to create web pages that you see everyday on the Internet. It is a really easy language to understand because of its relationship to english.

1) ****Introduction****

Now all you need to start coding in HTML is "Notepad" or any Third party Tool such as "Macromedia Dreamweaver".

Now open up Notepad and input this.

<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
Hey my name is Ali
</body>
</html>


<--------------- End of Code --------------->

Now to explain all this new stuff to you.

Well the first tag in the document is <html>. This tells the browser you are using that this is a start of a HTML document.

The last tag is </html>. This tells the browser that this is the end of the HTML document. These tags always have to be used in able for the document to be executed.

Now the text between the <head> tag and the </head> tag is header information.

The text between <title> tag and the </title> tag is the title of your document. This is displayed in your browsers title bar at the top.

The text between the <body> tags is the text which is going to be displayed in your browser.

Pretty simple isnt it.

Now all you got to do is save the file as a .html or .htm and open it. It should work and the text you inserted should be displayed.

What about if you want to make your text bold how would you go around it?

Well its pretty straight forward... We will use the bold tags which are <b> and </b>

So the code will look like this.

<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
<b>Hey my name is Ali</b>
</body>
</html>


<--------------- End of Code --------------->

All we did is add the bold tags. Everything else is explained above.

Now see if it works.

2) ****Basic HTML Tags****

In this section we will go into some basic Html tags that are commonly used.

Headings:

Headings are shown with tag's <h1> to <h6>. Tag <h1> is the largest heading. The tag <h6> is the smallest heading.

So lets see a real example of it. Use the basic HTML structure code from above and add the heading tags so it would look like this.

<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
<h1>Hey my name is Ali</h1>
<h2>Hey my name is Ali</h2>
<h3>Hey my name is Ali</h3>
<h4>Hey my name is Ali</h4>
<h5>Hey my name is Ali</h5>
<h6>Hey my name is Ali</h6>
</body>
</html>


<--------------- End of Code --------------->

Now check it out. It should have "Hey my name is Ali" from largest to smallest.

Line Breaks:

Line Breaks are used to end a line but you do not want to start a new paragraph. It's tag is <br>. It can be placed anywhere in a HTML document.

Now using the Basic HTML structure in the First lesson lets add the <br> tag to it.


<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
Hey<br>my<br>name<br>is<br>Ali.
</body>
</html>


<--------------- End of Code --------------->

That is how it can be used. Also you may have noticed "How come there is no closing tag?".. It is because the tag <br> is an empty tag.

Now check it out. It should have each word an a seperate line.

Paragraphs:

Paragraphs are defined with the <p> tag and the </p> tag.

Now using the Basic HTML structure in the First lesson lets add the <p> tag to it.

<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
<p>Hey my name is Ali</p>
<p>What is your name?</p>
</body>
</html>


<--------------- End of Code --------------->

That is how it can be used. Now check it out. It should have each sentance in its own paragraph.

Comments in HTML:

The comment tag is used to insert a comment in the HTML document without it being displayed. A comment is used to explain your code, which can help you edit the code in the future.

Now using the Basic HTML structure in the First lesson lets add the Comment tag to it.


<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
Hey my name is Ali
<!-- Remember this displays Hey my name is Ali.. -->
</body>
</html>


<--------------- End of Code --------------->

Simple isnt it. Now onto the next lesson.

3) ****HTML Links****

Now the tag <a> defines a anchor. An anchor is used with the href attribute to create an anchor which can point to any image,webpage or resource on the Internet.

The Syntax of creating an anchor is as follows.

<a href="url">Text to be displayed</a>

To explain this to you. The <a> tag is used to create an anchor. The href attribute is used to address the document to link to the target, and the words between the open and close of the anchor tag will be displayed as a Hyperlink.

Now using the Basic HTML structure in the First lesson lets add the <a> tag to it.


<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
<a href="http://www.google.com">Google's Homepage</a>
</body>
</html>


<--------------- End of Code --------------->

That is how it can be used. Now check it out. It should have the text Google's Hopepage as a Hyperlink and as you click it, it will redirect you to Googles Hopepage.

Now what about if you want the Hyperlink to open in a new page? Simple you would use the same syntax but input "target="_blank". So it would look like this.

<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
<a href="http://www.google.com" target="_blank">Google's Homepage</a>
</body>
</html>


<--------------- End of Code --------------->

Now test them both out and change the links to your liking.

4) ****Tables****

Tables are shown with the <table> and </table> tag. A table is divided into rows with the <tr> and </tr> tag, and of course each row is divided into data cells with the <td> and </td> tags. The letters td stand for of course Table data which can be supported as images,text lists paragraphs etc.

Now using the Basic HTML structure in the First lesson lets add the table tags to form a table.

<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
<table border="1">
<tr>
<td>Hey</td>
<td>my</td>
</tr>
<tr>
<td>name</td>
<td>is Ali.</td>
</tr>
</table>
</body>
</html>


<--------------- End of Code --------------->

Now this table has 2 rows and 4 cells. Each with a word or word's within them. You can edit them to what you like.

Well maybe you want a heading in your table. Its quite simple!! All you got to use is the Heading tag which in a table is defined as <th> and </th> tag. So this is how it should look.

<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
<table border="1">
<tr>
<th>First Name</th>
<th>Last Name</th>
</tr>
<tr>
<td>Ali</td>
<td>Bob</td>
</tr>
<tr>
<td>Ali</td>
<td>Bob</td>
</tr>
</table>
</body>
</html>

<--------------- End of Code --------------->

Straight forward isnt it. Now this should have 2 rows and the heading of the First row should be " First Name" and the heading of the second row should be " Last Name "

Now modify and try your own.

5) ****HTML Images****

Now what would be a web page with images??

In HTML images are defined with the <img> Tag. The <img> tag is empty therefore there is no closing
tag. To put an image onthe page you have to use the src attribute. Src Stands for Source.

The Syntax to insert an image is as follows:

<img src="url">

Now using the Basic HTML structure in the First lesson lets add an image to the HTML Document.

<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
Hey my name is Ali

This is an image of my self.

<img src="http://www.ali.com/ali.gif" alt="Picture of my Self" align="middle">
</body>
</html>


<--------------- End of Code --------------->

Now I added some extra code which I will explain now. Simply I have aligned the image to the middle. Now the alt part means alternate text for the image. So say if I cant load the picture I could then see what I am missing which is " Picture of my Self "

Now you give it a try and see if it works.

6) ****HTML Lists****

There are a couple of HTML lists including Unordered Lists, Ordered Lists, Definition Lists.

I will go through the Unordered and Ordered Lists.

Unordered lists is a list of terms. The list of terms are marked with bullets or small black circles.

An Unordered list is defined as the <ul> and </ul> tags. Also <li> and </li> means List item. Thats the tag for placing anything you want in any List.

Heres an example.

<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
<ul>
<li>My name is</li>
<li>Ali</li>
</ul>
</body>
</html>


<--------------- End of Code --------------->

An ordered list is also a list of items. The list items are marked with numbers.

Now for a Ordered List we just change the tags <ul> and </ul> to <ol> and </ol>.

So it should look like this.

<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body>
<ol>
<li>My name is</li>
<li>Ali</li>
</ol>
</body>
</html>


<--------------- End of Code --------------->

7) ****HTML Background****

For the Background of a web page you can either use an Image or a Selected Colour.

Now to make the Background your selected colour we will use the <body> tag. Now the browser has 3 ways to interpret your selected colour.

1) Hexadecimal value of Colour
2) A RGB Value
3) A Color Name

I like using the HexaDecimal feature. So we will use that now.

Here is an Example:


<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body bgcolor="#000000">

</body>
</html>


<--------------- End of Code --------------->

That Hex Value sets the background to the Colour Black.

Now to add a background image it would look like this.


<--------------- Start of Code --------------->

<html>
<head>
<title>My First page!!!</title>
</head>

<body background="ali.gif">

</body>
</html>


<--------------- End of Code --------------->

Now you try and play around with the colours till you like one.

This is the end of my guide. I hope you have liked it and learned something from it.

By Hybr!d 13/12/05

If you got any suggestions email me at ali_hybrid@hotmail.com
 
Status
Not open for further replies.
Back
Top