Hola,
En esta ocasión les enseñare como crear tu pagina web de GunZ.
Eh aqui varios link's de descarga de la web con varios bugs arreglados.
Originalmente podran encontrar este tema en [Tut] Make your GunZWeb+Panel - RaGEZONE donde lo cree principalmente, decidi hacer este tutorial en español, para los hispanos hablantes que deseen aprender.
Requisitos nesesarios:
-Tener instalado Microsoft SQL Server Management Studio Express
-Tener la base de datos (GunzDB) ya creada.
-Tener o instalar AppServer 2.6.0
Comenzamos.
Instalacion.
Descomprimimos el archivo ".rar" llamado "tables". Como veran hay varios archivos ".sql" llamados account.sql,
indexcontent.sql, Login.sql y SessionHash.sql...
Luego darle doble clic a los archivos empezando por account.sql.
Como veran se abrira el SQL, inician sesión, y cambian de "master" a "GunzDB" y presionan 

Y asi sucesivamente con el resto de los archivos.
Luego descomprimimos el archivo ".rar" llamado "IndexContent" y lo ejecutamos.
NOTA: Si por alguna razon, el SQL te dice que el archivo sera reemplazado, le daras "si a todo"
Terminado todo, borramos todos los archivos ya usados.
Ahora procedemos a instalar el "AppServer" Presionamos next, hasta que aparesca asi

veras que dice "Server Name" "Email"
En "Server Name" Pondras lo que tu quieras sin espacios y en "Administrator's Email Address" Pondras tu email
En "Apache HTTP Port, puedes dejar por default "80", o cambiarlo a "8080"
En la opcion "MySQL Server Configuration" te pedira una contraseña... Puedes poner la que tu quieras,
Ahora procedemos a instalar el AppServer.
Al finalizar NO PRESIONES "Finish", vamos a Inicio - Ejecutar - y escriben "php.ini"

Buscamos la palabra "mssql", y borramos ";" de "mssql.dll" y "ming.dll"

Default:
Código:
;extension=php_ming.dll
;extension=php_mssql.dll
Change:
Código:
extension=php_ming.dll
extension=php_mssql.dll
Cerramos y guardamos los cambios efectuados.
Luego vamos a MI PC - Disco Local C:\ AppServ - Y borramos la carpeta "www" que se encuentra alli.
Descomprimimos el ".rar" llamado "www" en ese lugar.
Al descomprimir veran un archivo ".dll" llamado "ntwdblib.dll", copiamos este archivo y lo pegamos en las siguientes carpetas.
php6, Apache 2.2, bin (se encuentra en la carpeta "Apache 2.2")
Regresamos a la Instalacion del AppServer, y lo finalizamos.
Configuracion.
Vamos a la carpeta "www" por default esta en "C:\AppServ\www" y comenzamos a configurar la web!
Nos dirijimos al archivo "config.php"
Código PHP:
<?php
mssql_connect(Your user\SQLEXPRESS","sa","password");
mssql_select_db("GunzDB");
$opened = 1;
if($opened == 0){
$pagetitle = "Server in maintenance";
**
?>
Al cerrar, guardan los cambios efectuados.
Nos dirijimos al archivo "hash.php"
Código PHP:
<?php
//This file has been edited by Wizkid. All rights reserved.
mssql_connect("Your user\SQLEXPRESS","sa","password");
mssql_select_db("GunzDB");
//Anti SQL injection by Wizkid. Updated a bit to prevent all sorts of injections.
function antisql($sql)
{
// Remove words that contain SQL syntax
$sql = preg_replace(sql_regcase("/(from|update|set|select|insert|delete|where|drop table|show tables|#|\*|--|\\\\)/"),"",$sql); //Replaces some parts of a SQL query with absolutely nothing.
$sql = trim($sql); //antisqls up spaces
$sql = strip_tags($sql);//Php and html tags strip
$sql = addslashes($sql);//Adds backslashes to one string
return $sql;
**
//==========================================================
$hashid = antisql($_GET['hashid']);
$res = mssql_query("SELECT * FROM SessionHash WHERE HashString = '$hashid' AND Used = '0'");
if(mssql_num_rows($res) >= 1){
$data = mssql_fetch_assoc($res);
mssql_query("UPDATE Login SET Allowed = '1' WHERE UserID = '".$data['User']."'");
mssql_query("UPDATE SessionHash SET Used = '1' WHERE HashString = '$hashid'");
echo "YES";
**else{
echo "NO";
**
?>
Al cerrar, guardamos los cambios efectuados.
Nos dirijimos al archivo "registrer.php"
Código PHP:
<body bgcolor="#999999">
<div align="center">
<p><strong><font color="#FFFFFF">Returns "Your GunZ"<a href="/index.php">Aqui</a>«</font></strong></p>
<p>
<?php
/*
This script was written by Wizkid.
All rights reserved. Any support can be requested via RageZone.
You're allowed to edit this script and modify the template.
However, you are NOT allowed to remove and/or edit my copyright.
Removing this copyright will be your death.
*/
//Edit to fit YOUR requirements.
$servername = "You own GunZ";
$accounttable = "Account";
$logintable = "Login";
//Edit these variables. If not, no regpage for you. (Or you're fuxpro with the same logins as me.)
$host = "Your user\SQLEXPRESS";
$user = "sa";
$pass = "password";
$dbname = "GunzDB";
$connect = odbc_connect("Driver={SQL Server**;Server={$host**; Database={$dbname**", $user, $pass) or die("Can't connect the MSSQL server.");
//The well-known antisql injection. Bad enough, it's needed.
function antisql($sql) {
$sql = preg_replace(sql_regcase("/(from|select|insert|delete|where|drop table|show tables|#|--|\\\\)/"),"",$sql);
$sql = trim($sql);
$sql = strip_tags($sql);
$sql = addslashes($sql);
return $sql;
**
//My favorite function. Get The Fuck Off. (Nothing personally :].)
function gtfo($wut) {
echo "<center><table width='500' cellpadding='5' cellspacing='0' border='0' style='border: 1px ;'>
<tr>
<td align=center width='100%' style='border-bottom: 1px solid black;'><b>Error</b></td>
</tr>
<tr>
<td width='100%'><center>$wut</center></td>
</tr>
</table>";
die();
**
//Check email function. This to prevent fake emails. (Remember the time YOU doing that?)
function checkemail($address) {
list($local, $host) = explode("@", $address);
$pattern_local = "^([0-9a-z]*([-|_]?[0-9a-z]+)*)(([-|_]?)\.([-|_]?)[0-9a-z]*([-|_]?[0-9a-z]+)+)*([-|_]?)$";
$pattern_host = "^([0-9a-z]+([-]?[0-9a-z]+)*)(([-]?)\.([-]?)[0-9a-z]*([-]?[0-9a-z]+)+)*\.[a-z]{2,4**$";
$match_local = eregi($pattern_local, $local);
$match_host = eregi($pattern_host, $host);
if($match_local && $match_host) {
return 1;
**
else {
return 0;
**
**
//The num_rows() function for ODBC since the default one always returns -1.
function num_rows(&$rid) {
//We can try it at least, right?
$num= odbc_num_rows($rid);
if ($num >= 0) {
return $num;
**
if (!odbc_fetch_row($rid, 1)) {
odbc_fetch_row($rid, 0);
return 0;
**
if (!odbc_fetch_row($rid, 2)) {
odbc_fetch_row($rid, 0);
return 1;
**
$lo= 2;
$hi= 8192000;
while ($lo < ($hi - 1)) {
$mid= (int)(($hi + $lo) / 2);
if (odbc_fetch_row($rid, $mid)) {
$lo= $mid;
** else {
$hi= $mid;
**
**
$num= $lo;
odbc_fetch_row($rid, 0);
return $num;
**
?>
<html>
<head>
</p>
</div>
<title><?=$servername?> Registration</title>
</head>
<body>
<center>
<?php
//Oh well. Let's create the variable $ip to start with.
$ip = antisql($_SERVER['REMOTE_ADDR']);
/*
An extra feature. This is NOT enabled before you remove this + the comment thingy's.
To ban 1 IP it will be:
if ($ip == "xxxxxx")
{
gtfo("Your IP is blacklisted.");
**
For multiple IP's, use this way:
if ($ip == "xxxxxx" OR $ip == "xxxxxx")
{
gtfo("Your IP is blacklisted.");
**
*/
//Get the AID out of the Login table (defined at the top of this file) where LastIP is the visitors IP.
$query1 = odbc_exec($connect,"SELECT AID FROM $logintable WHERE LastIP = '$ip'");
//Understable for the real people. Editing this without knowledge will be the death of your regpage.
$i=1;
while (odbc_fetch_row($query1, $i)){
$aid = odbc_result($query1, 'AID');
$query2 = odbc_exec($connect,"SELECT UGradeID FROM $accounttable WHERE AID = '$aid'");
odbc_fetch_row($query2);
$ugradeid = odbc_result($query2, 1);
if ($ugradeid == "253")
{
//Get the fuck off.
gtfo("You have one or more accounts banned here. You're not welcome anymore.");
**
$i++;
**
//The doreg part.
if (isset($_GET['act']) AND $_GET['act'] == "doreg")
{
//Check for any shit.
if (!is_numeric($_POST['age']) OR !checkemail($_POST['email']) OR empty($_POST['username']) OR empty($_POST['password']) OR empty($_POST['email']) OR empty($_POST['name']) OR empty($_POST['age']))
{
gtfo("You're not funny.");
Link de Descarga
**
//Check if the username exists already.
$query1 = odbc_exec($connect, "SELECT AID FROM $accounttable WHERE UserID = '" . antisql($_POST['username']) . "'");
$count1 = num_rows($query1);
if ($count1 >= 1)
{
gtfo("Username in use.");
**
//Check if the Email is in use.
$query2 = odbc_exec($connect, "SELECT AID FROM $accounttable WHERE Email = '" . antisql($_POST['email']) . "'");
$count2 = num_rows($query2);
if ($count2 >= 1)
{
gtfo("Email address in use.");
**
//Regdate
//Time for the real work. Editing this will be the end of your regpage.
$query3 = odbc_exec($connect, "INSERT INTO $accounttable (UserID, UGradeID, PGradeID, RegDate, Email, Age, Name) VALUES ('".antisql($_POST['username'])."', '0', '0', '11.03.2207 0:00:00', '".antisql($_POST['email'])."', '".antisql($_POST['age'])."', '".antisql($_POST['name'])."')");
$query4 = odbc_exec($connect, "SELECT AID FROM $accounttable WHERE UserID = '" . antisql($_POST['username']) . "'");
odbc_fetch_row($query4);
$aid = odbc_result($query4, 1);
//If no results comes back. (Registration failed.)
if (!$aid)
{
gtfo("Shit happened. Please report this bug at our forums.");
**
odbc_exec($connect, "INSERT INTO $logintable (UserID, AID, Password, euCoins) VALUES ('".antisql($_POST['username'])."', '$aid', '".antisql($_POST['password'])."', '0')");
//When everything is done, show the username/password to the visitor.
gtfo("Your account has been created.
Username: $_POST[username]
Password: $_POST[password]
Have fun at $servername!");
**
//Here the party begins. Feel free to edit this.
echo "<table width='350'>
<form action='" . $_SERVER['PHP_SELF'] . "?act=doreg' method='POST'>
<b>Register an account at $servername.</b>
<tr>
<td width='50%'><b>Username:</b></td>
<td width='50%'><input type='text' name='username'></td>
</tr>
<tr>
<td width='50%'><b>Password:</b></td>
<td width='50%'><input type='password' name='password'></td>
</tr>
<tr>
<td width='50%'><b>E-mail:</b></td>
<td width='50%'><input type='text' name='email'></td>
</tr>
<tr>
<td width='50%'><b>Name:</b></td>
<td width='50%'><input type='text' name='name'></td>
</tr>
<tr>
<td width='50%'><b>Age:</b></td>
<td width='50%'><input type='text' name='age'></td>
</tr>
<tr>
<td width='50%'><b></b></td>
<td width='50%'><input type='submit' value='Register'></td>
</tr>
</table>";
?>
<!-- No you don't remove it. -->
<font size="1">Copyright 2008 Wizkid - <?=$servername?>.</font>
<!-- See? -->
</center>
</body>
</html>
Al cerrar guardan los cambios efectuados.
Ahora nos dirijimos a la carpeta "Panel" y editamos los siguientes archivos: "config.php", "config1.php"
Al terminar de configurar los archivos, guardan los cambios efectuados.
Ahora nos dirijimos a la carpeta "clan" y editamos el "config.php"
Código PHP:
<?php
//Data Base Stuff!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
$DBHost = 'Your user\SQLEXPRESS'; //The host of your DB (I.E: MACHINE\SQL2005)
$DBUser = 'sa'; //Your DB User
$DBPass = 'password'; //Your DB Password
$DB = 'GunzDB'; //Your GunZ DB
?>
Guardan los cambios efectuados.
La configuracion esta lista, ahora para ver todo el trabajo que hemos hecho, nos dirijimos a tu explorador (Es recomendable usar FireFox)
Escriben su ip o por default quien no tenga internet 127.0.0.1/index.php
NOTA: Si usastes el "port" (8080) deves escribir tu ip + :8080.
Código:
Tu ip, ó 127.0.0.1:8080/index.php
Listo!, tu web de GunZ esta finalizada! Espero que les haya gustado mi tutorial, dar las gracias no cuesta nada.
Edito: El "registrer.php" es de otra configuracion, debes descargar el "registrer.php" el link que puse... Lo remplazan y listo.
Att: Jizeth|Faraday...
Descargas.
- AppServ - Download
- Megaupload - Download folder "www"
- Free large file hosting. Send big files the easy way! [Registrer.php]
Free large file hosting the easy way! Download Tables and IndexContent
Marcadores