Can't find where this </br> is coming into a link.
PHP:
<?php
if(isset($_POST['submit'])) { //execute only if an item is posted.
$name = preg_replace('~([^a-zA-Z])~','',$_POST['name']) . "\n"; //strip out all but alpha characters in the posted name.
$file = fopen('names.txt','a'); //open file('names.txt') or create if it doesn't exist.
fwrite($file,"<a href='http://xwis.net/ra2/players/$name'>".$name."</a>"); //write the name to the end of the file.
fclose($file); //close the file.
}
echo implode('<br />',file('names.txt')); //print the contents to the page, one name per line.
?>
<form action="" method="post">
<label>Name: </label><br />
<input type="text" name="name" value="" /><br />
<input type="submit" name="submit" value=" Submit " />
</form>
Last edited: