if($_GET['username'])
{
mysql_query('SELECT * FROM users WHERE examplename = '" . $_GET['username'] . "'');
} else {
die();
}
<?php
if (isset( $_GET['username'] ))
{
$user = mysql_real_escape_string( $_GET['username'] );
$checkQ = @mysql_query( "SELECT * FROM `users` WHERE `username` = '" . $user . "' LIMIT 1" );
if (mysql_num_rows( $checkQ ) == 0)
{
echo 'This user does not exist.';
}
else
{
$row = @mysql_fetch_array( $checkQ );
echo $row['email'] . '<br />';
echo $row['joindate'] . '<br />';
echo $row['rank'];
}
}
else
{
echo 'No username set.';
}
?>
Why not make a secure function?Thanks Monsta But i already Codded what i needed codded
but i am gonna use the $user = mysql_real_escape_string( $_GET['username'] ); Do You want credits in the profile page ;P
function secure($str) {
mysql_real_escape_string(htmlentities($str));
}
Why not make a secure function?
PHP:function secure($str) { mysql_real_escape_string(htmlentities($str)); }
Are you aware of what does function actually does?For The project that was needed for the functions were already codded but this could be useful later on in life on other projects