You've put an apostrophe before the get variable, making PHP think it's a string. Syntax highlighting would have helped you see this very easily:
PHP Code:
<?php
include 'conifig.php';
echo $Loginname= $_GET["Loginname"];
$pass=$_GET["pass"];
$query = "SELECT * FROM table WHERE Loginname= '" . $Loginname . "' ";
$result = mysql_query($query, $con);
if ($result['flag']==0)
{
$sql="UPDATE table SET flag=1 WHERE Loginname=$Loginname";
echo "hi";
//header('Location:login.html');
}
else
{
echo "your activation is incomplete please activate your link by activation link";
}
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
mysql_close($con);
?>
Also you didn't put the variable in a string in the query.
Bookmarks