PHP Version of FLAMES Ready!
PHP Version of the same is ready... 😀
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "https://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="https://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Flames by Praveen</title>
<style type="text/css">
body, input {font-family: candara, tahoma; font-size: 12px; width: 150px;}
form div {margin: 5px;}
</style>
</head>
<body>
<?php
$flames = array(
"F" => "Friends",
"L" => "Lovers",
"A" => "Affectionate",
"M" => "Married",
"E" => "Enemies",
"S" => "Siblings"
);
if(isset($_GET["names"]))
if(count($_GET["names"])==2)
{
$n1 = strtoupper(str_replace(" ", "", $_GET["names"][0]));
$n2 = strtoupper(str_replace(" ", "", $_GET["names"][1]));
if($n1 == $n2)
echo "<div>Both the names are same!</div>";
else
{
for($i = 0; $i < strlen($n1); $i++)
{
if(isset($n1[$i]))
for($j = 0; $j < strlen($n1); $j++)
if(isset($n2[$j]))
if($n1[$i] == $n2[$j])
{
$n1[$i] = $n2[$j] = "/";
break;
}
}
$n1 = str_replace("/", "", $n1);
$n2 = str_replace("/", "", $n2);
$count = strlen($n1) + strlen($n2);
$flame = "FLAMES";
echo "<div>";
while(strlen($flame)!=1)
{
$flame[$count%strlen($flame)] = "/";
$flame = str_replace("/", "", $flame);
}
echo "You both are [b]" . $flames[$flame] . "[/b]</div>";
}
}
else ;
else
{?>
<form method="get" action="">
<div>Enter the Names</div>
<div><input type="text" name="names[]" /></div>
<div><input type="text" name="names[]" /></div>
<div><input type="submit" value="Get Relation" /></div>
</form>
<?php } ?>
</body>
</html>