M0nstas code sorta works..
How can i make it so if its abcdefghijklmn123456789
and it was limited to 4 it would only show
abcd ?
$u = mysql_real_escape_string(strip_tags($_GET['user']));
if(!isset($u))
{
echo 'cannot find user';
}
else
{
echo substr($u, 0, 15); //Will limit to 15
}
M0nstas code sorta works..
How can i make it so if its abcdefghijklmn123456789
and it was limited to 4 it would only show
abcd ?
<?php
if(isset($_GET['user'])) {
if(strlen($_GET['user']) > 15 || strlen($_GET['user']) < 1) {
echo 'Sorry, but your username must be one to 15 characters long.';
}else if($_GET['user'] != preg_replace('/[^a-zA-Z0-9]/', '', $_GET['user'])) {
echo 'Sorry, but your username can only contain letters and numbers.';
}else{
//run success code
}
}