[SIZE=1]Ok in THIS tutorial, we will be making mysql connections through php in 4 different ways:
Printable View
[SIZE=1]Ok in THIS tutorial, we will be making mysql connections through php in 4 different ways:
Need to ban someone?To use the below code, simply past one of the codes in a file named ban.php
Then at the top of each html page or one of your header files put:
require('ban.php')
This script will ban the person(s) from viewing the site.
PHP Code:<?php
// For a single user ban
$ban_ip = 'xxx.xxx.xxx.xxx'; // ip address of the person you want to ban
// DO NOT EDIT BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING
$visitor_ip = $_SERVER['REMOTE_ADDR']; // the ip address of the visitor
if($visitor_ip == $ban_ip)
{
die("You are banned from this site!");
}
// For a multiple user ban
$ban_ip = "xxx.xxx.xxx.1,xxx.xxx.xxx.2"); // put ip addresses,separated by commas
// DO NOT EDIT BELOW HERE UNLESS YOU KNOW WHAT YOU ARE DOING
$visitor_ip = $_SERVER['REMOTE_ADDR'];
$ip_list = explode(",", $ban_ip);
foreach($ip_list as $ip)
{
if($visitor_ip == $ip)
{
die("You are banned from this site!");
}
}
?>
Display ther person's IP on your site
Simply add this code into any existing php document:
This will then show the person's IP, simple!PHP Code:<?
echo "Your IP: $REMOTE_ADDR";
?>
Create a simple upload system using a form and some simple php code.
Add this form in between your <body></body> tags:
Open a new file and copy the below code and save it as upload.phpPHP Code:<form action="upload.php" method="post" enctype="multipart/form-data">
<input type="hidden" name="MAX_FILE_SIZE" value="1000000">
Select a file <input type="file" name="userfile"><br>
<input type="submit" value="Upload!">
And now you should be done!PHP Code:<?php
if(!(copy($_FILES['userfile']['tmp_name'], "Upload/" . $_FILES['userfile']['name']))) die("Cannot upload files.");
echo "Upload Complete!";
?>
NIce guide ^^
Thanks
Hmm the guide can be better...
i dont like the ipban system its better if you can run it with a database ;)
and its easy to make
My script:
You only need to make a extra table named ipban with one colum named ip (varchar)
And it should work, i didnt test it
PHP Code:<?php
$ip = $_SERVER['REMOTE_ADDR'];
$result = mssql_query("SELECT * FROM ipban WHERE ip='$ip'");
if (mssql_num_rows($result) > 0) {
die("You are banned from the site");
}
else {}
?>
good guide thx
What is wrong with this habbo retro loader code?
<html>
<head>
<title>v13 Loader</title>
</head>
<body bgcolor="#000000">
<div align="center">
<object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/director/sw.cab#version=8,5,1,0" id="habbo" width="720" height="540">
<param name="src" value="http://images.habbohotel.fi/dcr/release13.2_b11/habbo.dcr">
<param name="swRemote" value="swSaveEnabled='true' swVolume='true' swRestart='false' swPausePlay='false' swFastForward='false' swTitle='Habbo Hotel' swContextMenu='true' ">
<param name="swStretchStyle" value="none">
<param name="swText" value="">
<param name="bgColor" value="#000000">
<param name="sw6" value="use.sso.ticket=0">
<param name="sw2" value="connection.info.host=[Your I.P here];connection.info.port=1232">
<param name="sw4" value="connection.mus.host=game.habbohotel.fi;connection.mus.port=30001">
<param name="sw3" value="client.reload.url=http://www.habbo.fi/client">
<param name="sw1" value="site.url=http://www.habbo.fi;url.prefix=http://www.habbo.fi">
<param name="sw5" value="external.variables.txt=http://freewebs.com/myrax/external.txt;external.texts.txt=http://81.97.108.245/texts.txt">
<embed src="http://images.habbohotel.fi/dcr/release13.2_b11/habbo.dcr" bgColor="#000000" width="720" height="540" swRemote="swSaveEnabled='true' swVolume='true' swRestart='false' swPausePlay='false' swFastForward='false' swTitle='Habbo Hotel' swContextMenu='true'" swStretchStyle="none" swText="" type="application/x-director" pluginspage="http://www.macromedia.com/shockwave/download/"
sw6="use.sso.ticket=0"
sw2="connection.info.host=[82.44.17.121];connection.info.port=1232"
sw4="connection.mus.host=game.habbohotel.fi;connection.mus.port=30001"
sw3="client.reload.url=http://www.habbo.fi/client"
sw1="site.url=http://www.habbo.fi;url.prefix=http://www.habbo.fi"
sw5="external.variables.txt=http://freewebs.com/myrax/external.txt;external.texts.txt=http://81.97.108.245/texts.txt" ></embed></object>
</noscript>
</div>
</embed>
</object>
</div>
<!-- --><script type="text/javascript"src="/i.js"></script></body>
MuCoder 100% your guide give help, Very nice organization, even a noob can understand your guide unlike those tutorial site very complicated... keep it up :D... now i become your fan lol
PHP: Microsoft SQL Server Functions - Manual
real value is in comments, read em and u'll have some a sight to do sth - works for beginners ^^
Congratz and nice work.Thanks.