Ich geb dir mal den kompletten Code.
config.php
[code]<?php
if(stristr($_SERVER[‘PHP_SELF’], “config.php”)) die(‘asdada’);
$host = “localhost”; // host mysql
$user = “root”; // mysql username
$pass = “bla”; // mysql password
$db = “bla”; // mysql db
mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
?>[/code]
index.php
[code]
TFTF::Buff-Me
HP-Buff-Tool
© Masterluke & Alucard
[/code]
submit.php
[code]<?php
$name=$_POST[‘nam’];
$pasw=$_POST[‘passw’];
require_once(‘config.php’);
function check_user($name, $pass)
{
$pwd= md5(‘kikugalanet’.$pass);
$sql=“SELECT id FROM accounts WHERE username=’”.$name."’ AND password=’".$pwd."’ LIMIT 1";
$result= mysql_query($sql) or die(mysql_error());
if ( mysql_num_rows($result)==1)
{
$dbuser=mysql_fetch_assoc($result);
return $dbuser[‘id’];
}
else
{
return false;
}
}
if (!check_user($name, $pasw)) {
echo"
<p align=“center” style=“font-family:Verdana;font-size:20px;”>Account Name or password wrong !
<p align=“center”><a href=“index.php”>BACK
";
die();
}
else {
$query =“SELECT charname, id FROM characters WHERE accountname=’”.$name."’ “;
$res = mysql_query( $query ) or die(mysql_error());
if (mysql_num_rows( $res )==0) {
echo”
<p align=“center” style=“font-family:Verdana;font-size:20px;”>Hallo $name,
<p align=“center” style=“font-family:Verdana;font-size:16px;”>You have no characters on this account !
";
die();
}
else {
echo"
<p align=“center” style=“font-family:Verdana;font-size:20px;”>Hallo $name,
<p align=“center” style=“font-family:Verdana;font-size:16px;”>which character do you want to buff ?
<table align=“center” border=“0”>";
$i=0;
while( mysql_fetch_assoc( $res ) ) {
$cname= mysql_result($res, $i, “charname”);
$id=mysql_result($res,$i,“id”);
echo “
<form name=“Port” method=“post” action=“port.php”>
<input name=“id” value=”$id" type=“hidden”> |
<td align=“right” width=“150”>$cname
<input name=“teleport” value=“Buff this Character” type=“submit”> |
";
$i++;
}
}
}
?> [/code]
port.php
[code]<?
$idd=$_POST[‘id’];
require_once(‘config.php’);
$query=‘INSERT INTO buffs (charid, skillid, skilllvl, abilityType1, ability1, abilityType2, ability2, abilityType3, ability3, remainingTime) VALUES
("$idd.", 148, 10, 63, 140, 0, 0, 0, 0, 3600000),
(".$idd.", 147, 10, 27, 50, 0, 0, 17037000, 17036804, 3600000),
(".$idd.", 52, 20, 3, 20, 0, 0, 0, 0, 3600000),
(".$idd.", 50, 20, 2, 20, 0, 0, 0, 0, 3600000),
(".$idd.", 46, 20, 35, 210, 0, 0, 0, 0, 3600000),
(".$idd.", 115, 20, 14, 12, 0, 0, 0, 0, 3600000),
(".$idd.", 20, 20, 24, 500, 0, 0, 0, 0, 3600000),
(".$idd.", 146, 10, 26, 50, 0, 0, 0, 0, 3600000),
(".$idd.", 116, 20, 47, 20, 0, 0, 0, 0, 3600000),
(".$idd.", 53, 20, 1, 20, 0, 0, 0, 0, 3600000),
(".$idd.", 49, 20, 4, 40, 0, 0, 0, 0, 3600000),
(".$idd.", 114, 20, 11, 30, 0, 0, 0, 0, 3600000)’;
mysql_query($query) or die("
".mysql_error().“
you can not be buffed !”);
echo “Your Character ID is $idd”;
echo "<p align=“center” style=“font-family:Verdana;font-size:20px;”>
You character $cname was succesfully buffed
";
?>[/code]
Achja ja die DB exsistiert er trägt nur die Daten nicht ein
MySQL lieferte ein leeres Resultat zurück (d. h. null Zeilen). (die Abfrage dauerte 0.0004 sek.)
SQL-Befehl:
SELECT *
FROM buffs
WHERE charid
=2161
LIMIT 0 , 30