Augen auf und Hirn an, was ist denn heute abend los hier
$input != $_input
$input != $_input
echo $input['partners'][$i].'<br>';
echo $input['kills'][$i].'<br>';
echo $input['deaths'][$i].'<br>';
OffTopic:
du weist doch:
<?php
$lines = file("Statistics1.log");
$data = array();
$i = 0;
foreach ($lines as $line)
{
$values = explode(":", $line);
if (trim($values[0]) == "Playername")
$data[$i]['Playername'] = trim($values[1]);
if (trim($values[0]) == "Kills")
$data[$i]['Kills'] = trim($values[1]);
if (trim($values[0]) == "Deaths")
$data[$i]['Deaths'] = trim($values[1]);
$i++;
}
foreach ($data as $values)
{
foreach ($values as $key => $value)
echo "$key = $value<br>";
}
?>
for ($i = 0; $i < sizeof ($input['partners']); $i++)
{
echo $input['partners'][$i].'<br>';
echo $input['kills'][$i].'<br>';
echo $input['deaths'][$i].'<br>';
}
$query = 'INSERT INTO tabellenname (spieler, kills, deaths) ';
$query .= 'VALUES ('."'".$input['partners'][$i]."','".$input['kills'][$i]."','".$input['deaths'][$i]."'".');
<?php
$datei = fopen('Statistics1.log','r');
while (!feof($datei))
{
$zeile = fgets($datei,1024);
$regex = "/^Playername *: /iU";
$regex1 = "/^Kills *: /iU";
$regex2 = "/^Deaths *: /iU";
if (preg_match_all($regex,$zeile,$matches,PREG_SET_ORDER))
{
foreach($matches as $match)
{
$input['playername'][] = $zeile;
}
}
if (preg_match_all($regex1,$zeile,$matches,PREG_SET_ORDER))
{
foreach($matches as $match)
{
$input['kills'][] = $zeile;
}
}
if (preg_match_all($regex2,$zeile,$matches,PREG_SET_ORDER))
{
foreach($matches as $match)
{
$input['deaths'][] = $zeile;
}
}
}
fclose($datei);
print_r ($input)
?>
<html>
<body>
<?php
$datei = fopen('Statistics1.log','r');
while (!feof($datei))
{
$zeile = fgets($datei,1024);
$regex = "/^Playername *: /iU";
$regex1 = "/^Kills *: /iU";
$regex2 = "/^Deaths *: /iU";
if (preg_match_all($regex,$zeile,$matches,PREG_SET_ORDER))
{
foreach($matches as $match)
{
$input['playername'][] = $zeile;
for ($i = 0; $i < sizeof ($input['playername']); $i++)
{
echo $input['playername'][$i].'<br>';
}
}
}
if (preg_match_all($regex1,$zeile,$matches,PREG_SET_ORDER))
{
foreach($matches as $match)
{
$input['kills'][] = $zeile;
for ($i = 0; $i < sizeof ($input['kills']); $i++)
{
echo $input['kills'][$i].'<br>';
}
}
}
if (preg_match_all($regex2,$zeile,$matches,PREG_SET_ORDER))
{
foreach($matches as $match)
{
$input['deaths'][] = $zeile;
for ($i = 0; $i < sizeof ($input['deaths']); $i++)
{
echo $input['deaths'][$i].'<br>';
}
}
}
}
fclose($datei);
print_r ($input)
?>
</body>
</html>
<?php
$rank = mysql_connect('host', 'name', 'password');
if (!$rank) {
die('keine Verbindung möglich: ' . mysql_error());
}
echo 'Verbindung erfolgreich';
$db_selected = mysql_select_db('ranking', $rank);
if (!$db_selected) {
die ('Kann ranking nicht benutzen : ' . mysql_error());
}
$datei = fopen('Statistics1.log','r');
while (!feof($datei))
{
$zeile = fgets($datei,1024);
$regex = "/^Playername *: /iU";
$regex1 = "/^Kills *: /iU";
$regex2 = "/^Deaths *: /iU";
if (preg_match_all($regex,$zeile,$matches,PREG_SET_ORDER))
{
foreach($matches as $match)
{
$input['playername'][] = $zeile;
for ($i = 0; $i < sizeof ($input['playername']); $i++)
{
$query = 'INSERT INTO $rank (playername, kills, deaths)';
$query .= 'VALUES ('."'".$input['playername'][$i]."','".$input['kills'][$i]."','".$input['deaths'][$i]."'".')';
}
}
}
if (preg_match_all($regex1,$zeile,$matches,PREG_SET_ORDER))
{
foreach($matches as $match)
{
$input['kills'][] = $zeile;
for ($i = 0; $i < sizeof ($input['kills']); $i++)
{
$query = 'INSERT INTO $rank (playername, kills, deaths)';
$query .= 'VALUES ('."'".$input['playername'][$i]."','".$input['kills'][$i]."','".$input['deaths'][$i]."'".')';
}
}
}
if (preg_match_all($regex2,$zeile,$matches,PREG_SET_ORDER))
{
foreach($matches as $match)
{
$input['deaths'][] = $zeile;
for ($i = 0; $i < sizeof ($input['deaths']); $i++)
{
$query = 'INSERT INTO $rank (playername, kills, deaths)';
$query .= 'VALUES ('."'".$input['playername'][$i]."','".$input['kills'][$i]."','".$input['deaths'][$i]."'".')';
}
}
}
}
fclose($datei);
print_r ($input)
?>
Kommentar