Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Fiesta Online
You last visited: Today at 11:24

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



Hilfe zu PHP

Discussion on Hilfe zu PHP within the Fiesta Online forum part of the MMORPGs category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Sep 2013
Posts: 25
Received Thanks: 0
Hilfe zu PHP

Hallo zusammen,
leider finde ich nichts hier und bei google daher hoffe ich das mir hier einer Helfen kann.
Ich habe eine PHP Datei aber weiß nicht wie und wo ich die Bearbeiten muss.
Habe die PHP so gut wie alleine geschrieben aber leider klappt es nicht mit der standard PHP klappt es allerdings. Ich denke das ich irgendwo einen kleinen Fehler habe aber vielleicht kann mir einer da weiter helfen wo der Fehler liegt.

<?php
require_once ('./config.php');


if (!isset($_GET['Username']))
$user = sql_clean("");
else
$user = sql_clean($_GET['Username']);

if (!isset($_GET['Password']))
$passhash = sql_clean("");
else
$passhash = sql_clean($_GET['Password']);


$con = odbc_connect($conf['db_name'], $conf['db_user'], $conf['db_pass']) or die('ODBC Connection connect Fail.');

$exec = odbc_exec($con, "SELECT nEMID, sUserPass, nAuthID, nStatus FROM tAccounts where sUsername = '$user'");

if($exec)
{
if(odbc_num_rows($exec) != 1)
{
die('Account Not Found.');
}
$AccountData = odbc_fetch_object($exec);
$PlaintxtPass = $AccountData->sUserPass;
$PlaintxtnEMID = $AccountData->nEMID;
$Auth = $AccountData->nAuthID;
$Status = $AccountData->nStatus;

if ($conf['Wartung'] == '1' and ($Status == '0')){

die('Maintenance');


}
if ($Auth == 3)
{
if (MD5($PlaintxtPass) == $passhash)
{
$Token = RandomToken(50);

$setToken = null;

if (odbc_num_rows(odbc_exec($con, "SELECT * FROM tTokens WHERE nEMID = '".$PlaintxtnEMID."'")) >= 1)
{
odbc_exec($con, "DELETE FROM tTokens WHERE nEMID = '".$PlaintxtnEMID."'");
$setToken = odbc_exec($con, "INSERT INTO tTokens (nEMID, sToken) VALUES('".$PlaintxtnEMID."', '".$Token."')");
}
else
$setToken = odbc_exec($con, "INSERT INTO tTokens (nEMID, sToken) VALUES('".$PlaintxtnEMID."', '".$Token."')");

if ($setToken)
die('OK#'.$Token);
else
die('SetToken Error');
}
else
{
die('Wrong Password.');
}

}
elseif ($Auth == 1)
{
die('Account nicht Aktiviert');
}
elseif ($Auth == -1)
{
die('Account wurde gebannt');
}



}
else
{
die('Query Failed');
}






odbc_close();

function sql_clean($str)
{
$search = array("\\", "\0", "\n", "\r", "\x1a", "'", '"');
$replace = array("", "", "", "", "", "", "");
return str_replace($search, $replace, $str);
}

function RandomToken( $length )
{
$chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVW XYZ0123456789";
$str = "";
$size = strlen( $chars );
for( $i = 0; $i < $length; $i++ ) {
$str .= $chars[ rand( 0, $size - 1 ) ];
}

return $str;
}
?>
Sunny1988 is offline  
Old 09/26/2013, 12:16   #2
 
BennySama's Avatar
 
elite*gold: 143
Join Date: Nov 2009
Posts: 153
Received Thanks: 66
Es ist nicht böse gemeint.. Aber bitte.. Kopiere die Fehlermeldung dazu. Dann ist es viel einfacher zu verstehen, was angeblich falsch ist. ^^
BennySama is offline  
Old 09/26/2013, 14:48   #3
 
elite*gold: 0
Join Date: Aug 2013
Posts: 78
Received Thanks: 22
WHAT THE FUU
Wer hat sich denn das einfallen lassen der sollte lieber nochmal ins buch gucken so
wird das MIT SICHERHEIT NICHT in einem buch oder Tutorial erklärt.

PHP Code:
if (!isset($_GET['Username']))
$user sql_clean("");
else
$user sql_clean($_GET['Username']);

if (!isset(
$_GET['Password']))
$passhash sql_clean("");
else
$passhash sql_clean($_GET['Password']); 
ωօղძεɾlმղძ is offline  
Thanks
3 Users
Old 09/27/2013, 20:56   #4
 
5anku's Avatar
 
elite*gold: 170
Join Date: Jan 2011
Posts: 74
Received Thanks: 74
PHP Code:
require_once ('../config.php'); 
5anku is offline  
Old 09/28/2013, 02:07   #5
 
elite*gold: 0
Join Date: Sep 2013
Posts: 562
Received Thanks: 361
@sunny
also hm du hast die php alleine geschrieben xD
Naja ich schau da mal drüber hinweg xDD

Das ist exact das login skript aus meinem Launcher Projekt

und wie dir 5anku schon mitgeteilt hat

require_once ('../config.php');

in der config.php musst du noch deinen benutzernamen und dein kennwort für den Datenbankzugriff angeben.

@wonderland
danke für die offenen Worte
D0n! is offline  
Reply




All times are GMT +1. The time now is 11:26.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.