Parcourir la source

choix du nombre d'XP lors de la creation du joueur

master
heuzef il y a 10 ans
Parent
révision
fbedc65af7
2 fichiers modifiés avec 17 ajouts et 1 suppressions
  1. +14
    -1
      index.php
  2. +3
    -0
      new_player.php

+ 14
- 1
index.php Voir le fichier

@@ -209,7 +209,20 @@ $message[4]='
<div class="modal-body">
<div class="form-group">
<label class="control-label" for="focusedInput">Nom :</label>
<input class="form-control" id="focusedInput" type="text" name="player_name">
<input class="form-control" id="focusedInput" type="text" name="player_name" value="Derpy">
</div>
<div class="form-group">
<label class="control-label" for="focusedInput">Nombre d'XP</label>
<div class="input-group">
<span class="input-group-addon"><i class="glyphicon glyphicon-flash" style="color:#FFD700;";></i></span>
<select class="form-control" id="focusedInput" name="player_xp">
<option>0</option>
<option>10</option>
<option>50</option>
<option>100</option>
<option>999</option>
</select>
</div>
</div>
</div>
<div class="modal-footer">


+ 3
- 0
new_player.php Voir le fichier

@@ -1,12 +1,15 @@
<?php
include "header.php";
$player_name=$_POST['player_name'];
$player_xp=$_POST['player_xp'];
copy("medias/default/player1.xml", "medias/".$hash."/".$player_name.".xml");

$xml = simplexml_load_file('./medias/'.$hash.'/'.$player_name.'.xml');

$xml->entry->nom = $player_name;

$xml->entry->xp = $player_xp;

$xml->asXml('./medias/'.$hash.'/'.$player_name.'.xml');

header("location: index.php");

Chargement…
Annuler
Enregistrer