I have this code so far <td>Referral:(optional)</td> <td><input id='referral' type='text' name='6' value='{$_SERVER['REQUEST_URI']}' class='input'></td> PHP: And I want the value to show the Referral Username. Right now i get this in the textbox which is normal /register.php/USERNAME.html how would i get the value of the textbox to show just the USERNAME and ignore /register.php/ and .html
$var = $_SERVER['REQUEST_URI']; $var = explode("/", $var); $var = explode(".html", $var[2]); echo $var[0]; PHP: But wouldn't it be easier to use GET? register.php?ref=USERNAME
h*tp://www.w3schools.com/PHP/php_get.asp register.php?ref=USERNAME, you can call ref anything you want, and the variable would be $_GET['ref'] or anything you want to use.