Login   Register  
PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Ludovic Bellière  >  PHP Mud Names  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: Example with all information about the process.
Class: PHP Mud Names
Generate random names for Multi-User Dungeon games
Author: By
Last change:
Date: 2009-08-27 17:53
Size: 1,320 bytes
 

Contents

Class file image Download
<?php

require('./mudnames.php');

$file = (isset($_GET['f']) && !empty($_GET['f'])) ? $_GET['f'] : 'random' ;

$gname = new mudnames();

$name $gname->generate_name_from($file);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html>
<head>
    <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    <title>Mudnames-php</title>
    <link type="text/css" href="style.css" title="Main style" rel="stylesheet" />
</head>
<body>
<div id="main">
<p>This is a names generator for MUD. It's great when we're in a unimaginative day !</p>

Your generated name : <input type="text" value="<?php echo $name ?>" />

<h1>Tips :</h1>
<strong>File used :</strong> <?php echo $gname->get_info('file used'?><br/>
<strong>Particles used :</strong> <?php print_r($gname->get_info('particles used')); ?><br/>
<strong>Capability used :</strong> <?php echo $gname->get_info('capability') . ($gname->get_info('is forced') ? ' -- <em>Forc&eacute;</em>' ''); ?><br />
<strong>All possibilities of capacity :</strong> <?php echo $gname->get_info('capability_list'); ?>

<h1>Choose a file :</h1>
<ul>
<?php
foreach ($gname->get_file_list() as $namefile) {
    echo 
'<li><a href="'.$_SERVER['PHP_SELF'].'?f='.$namefile.'">'.$namefile.'</a></li>';
}
?>
</ul>
</div>
</body>
</html>