voici le fichierWarning: simplexml_load_file() [function.simplexml-load-file]: file:///C%3A/tibiaserver/data/accounts/1428616.xml:1: parser error : Extra content at the end of the document in C:\wamp\www\connection.php on line 14
Warning: simplexml_load_file() [function.simplexml-load-file]: er name="Rowan Kartoffel" /><character name="Sorctest" /></characters></account> in C:\wamp\www\connection.php on line 14
Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in C:\wamp\www\connection.php on line 14
NULL
Code : Tout sélectionner
<?xml version="1.0"?><account pass="potato666" premDays="0" premEnd="0"><characters><character name="An unknow Wanderer" /><character name="Druidtest" /><character name="Rowan Kartoffel" /><character name="Sorctest" /></characters></account>
au cas ou sa peut aider, voici le code de mon script
Code : Tout sélectionner
<?php
require "serverinfo.php";
$account = $_POST['account'];
$password = $_POST['password'];
$accountxml = $account . ".xml";
$fileaccountdir = $accountdir . $accountxml; // $accountdir est une variable dans serverinfo.php qui définit le chemin complet pour accédé au dossier contenant tout les account
if ($account && $password != null)
{
if (file_exists($fileaccountdir)) {
$fileaccount = simplexml_load_file($fileaccountdir);
echo $xml->account[0]['pass'];
var_dump($xml);
} else {
echo $fileaccountdir . '<BR>';
exit('Echec lors de l\'ouverture du fichier test.xml.');
}
}
else
{
echo '<CENTER>
<FORM method="post" action="connection.php">
Account: <input type="password" name="account"><BR><BR>
Password: <input type="password" name="password"><BR><BR>
<input type="submit" value="valider">';
}