Archive for the 'PHP Tutorials' Category

PHP Classes

Written by admin on Sunday, September 14th, 2008 in PHP Tutorials, Tutorials.

In PHP there are many methods of programming a script or website. Advanced programmers use something called classes. These help programmers to organize their code and also make the script more versatile. PHP classes were mainly used when PHP5 was introduced as PHP5 concentrated on advanced programmers with using classes and other methods of programming. By using classes functions can be manipulated and security can be increased from standard php methods. PHP classes or often refered to as OOP which stands for Object Orientated Programming because we are using objects to organise our code. PHP classes have many features to them and it would take to long to explain every feature of a class so were just going to look at the few basics of using and creating a PHP class.
(more…)

Getting User information in PHP

Written by admin on Tuesday, August 5th, 2008 in PHP Tutorials, Tutorials.

In the previous tutorial we showed you how to get a user’s IP using PHP. However there is a way that you can get vasts amount of information about the user in PHP. We will now teach you how to get all of this information.

Getting information about the website or visitor mainly depends on the $_SERVER variable. This is a pre-defined global variable in PHP that is always set and can be used anywhere. Below are the different types of information you can get from $_SERVER.

(more…)

Getting User’s IP in PHP

Written by admin on Saturday, May 17th, 2008 in PHP Tutorials, Tutorials.

Sometimes you may need to get a users IP that is browsing your website and store it for protection or display it to the user.

In PHP this is simply done by using the $_SERVER variable.

The code below will store a users IP into a variable:

<?php

$UsersIP = компютри$_SERVER[’REMOTE_ADDR];

?>

REMOTE_ADDR simply grabs the remote IP Adress being used.

Lots more info can be obtained this way. But that is how to grab a Users IP.

Output Data from Text File with PHP

Written by admin on Wednesday, May 7th, 2008 in PHP Tutorials, General.

In this tutorial I am going to teach you how to generate data from a text file with the use of PHP.

To start you must first make a document called data.txt

Open up your data.txt for editing (I highly recommend using Notepad++).

Now put the following code into your text file.

Plain Text   view plain   expand/collapse
  1. | News 1 | News 2 | News 3

The above is what we can output. Each phrase is separated by a |. We need this so that we can tell our php script when to stop outputting a piece of data.

Now you need to make a PHP file called quotes.php.

This is the file that will generate our data.
Insert the following code into your php file.

(more…)

PHP Global Variables

Written by admin on Monday, December 31st, 2007 in PHP Tutorials, Tutorials.

PHP ( Hypertext Pre-Processor) uses variables to store information in a page. Standard variables can be called anything for example: $myvariable but PHP also has some global variables. These are variables that are declared on every PHP page and are used differently. Tthe 3 main global variables are: $_GET, $_POST and $_SESSION. All of these 3 global variables are arrays. Global variables can be used from page to page without havign to declare them again. The ones we are going to look at closely are $_GET and $_POST.

(more…)



Site Navigation SEO Services