|
Samay Live | |
|
EBooks » Web Tutorials
Before I begin I just want to say:
I always thought classes were hard, they are not hard at all.
They are actuatly VERY easy to use and to learn.
They can also add alot more security to your site, they can help
optimize code for faster loading times and so on.
How do they add security?
Instead of connecting to a database for example, and querying the
database with the default functions, you can pass them through a class,
have it evaluate the query, see if its valid, check to see if it is
unaltered and make sure no one is trying to inject sql. 1. What it does
IP banning someone from your site will effectivly stop all access they have
to your website. Make sure you ban wisely :-P
2. The Code
The code is fairly simple, we will set the $banned variable using an array.
It is here were we will enter IP address we wish to ban. Then, using the global
variable $REMOTE_ADDR to give us the user's IP address, we can check if it is
in the $banned array. If not, we let them carry on. If it is found in the $banned
array, using the die() fuction, we can remove all access to the site from that
IP. 1. Purpose?
In some sites, it is essential to show a user's IP address, for various reasons.
It is not that hard however, to do this. With some very simple PHP we can achieve
showing someone IP with relative ease.
2. How-To
It is not that hard at all, less then 3 lines total. Learn how to write a simple PHP script which randomly rotates banners
or links on your page. This technique allows you to use any number of
area with a random content. Everything is written in a few lines of
code, no database, no file system.
In this tutorial I'm going to learn you ow to create
a simple rotation script.
It can be used for rotating banners or for your links page.
You don't need to have database access, it is just one php file.
PHP (Personal Home Page) is a tool that lets you create
dynamic web pages. PHP-enabled web pages are treated just like regular
HTML pages and you can create and edit them the same way you normally
create regular HTML pages.
Virtual Training Company's tutorial is taught by Joshua Mostafa and shows you how to get the most out of using PHP.
He begins with the basics and takes you smoothly from an absolute
beginner who knows nothing at all about PHP through all you need to
know to use PHP in creating your very ownincredible web page.

|
| |
|