Love Calculator Code

Index.html Code

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv = “Content-Type” content = “text/html; charset=iso-8859-1″ />
<title>Lover Calculator</title>

<link rel=”stylesheet” type=”text/css” media=”screen” href=”./style.css” />
<style type=”text/css”>
<!–
body {
background-image: url(img/bg.jpg);
background-repeat: no-repeat;
}
.style1 {
color: #FFFFFF;
font-weight: bold;
}
a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FFFFFF;
}
a:hover {
text-decoration: underline;
color: #CCCCCC;
}
a:active {
text-decoration: none;
}
.style3 {
font-family: “Times New Roman”, Times, serif;
font-size: 12px;
}
.style5 {font-family: “Times New Roman”, Times, serif}
–>
</style></head>

<body>
<script language = “javascript” type = “text/javascript”>
var request = false;

try
{
request = new XMLHttpRequest();
}
catch (trymicrosoft)
{
try
{
request = new ActiveXObject(“Msxml2.XMLHTTP”);
}
catch (othermicrosoft)
{
try
{
request = new ActiveXObject(“Microsoft.XMLHTTP”);
}
catch (failed)
{
request = false;
}
}
}

if (!request)
alert(“Error initializing XMLHttpRequest!”);

function updateDiv(person1, person2)
{
var url = “calc.php”;
var params = “p1=” + person1 + “&p2=” + person2;
request.open(“POST”, url, true);
request.setRequestHeader(“Content-type”, “application/x-www-form-urlencoded”);
request.setRequestHeader(“Content-length”, params.length);
request.setRequestHeader(“Connection”, “close”);
request.onreadystatechange = function()
{
if (request.readyState == 4 && request.status == 200)
{
var response = request.responseText;
document.getElementById(‘targetDiv’).innerHTML = response + “% “;
}
}

request.send(params);
}
//–>
</script>

<div id = “main” align = “center”>
<p><img src = “./img/logo.png” alt = “Calculate your love!” width=”414″ height=”91″ style = “border: medium none ;” /></a> </p>
<p>&nbsp;</p>
<p><br />
</p>
<form name = “test” action = “#”>
<table border = “0”>
<tbody>
<tr>
<td><span class=”style1″><img src=”./img/man.png” width=”50″ height=”50″ /></span>
<input size = “30” class = “name” name = “p1” placeholder = “Enter Full Name” type = “text” /> </td>

<td style = “background-image: url(‘img/heart.png’);background-repeat:no-repeat; width: 128px; height: 128px;”>
<div id = “targetDiv” valign=”middle” align = “center”>0%
</div>
</td>
<td><span class=”style1″><img src=”./img/woman.png” width=”50″ height=”50″ /></span>
<input size = “30” class = “name” name = “p2” placeholder= “Enter Full Name” type = “text” />

<br /> </td> <input type=”reset” style=”color:white;font-family:arial;background-color:purple;height:42px;width:22;border-color:white;margin-right:9px;text-decoration:bold;”/>
</tr>
</tbody>
</table>

<br />
<br />
<input onclick = “updateDiv(p1.value, p2.value)”
value = “”
style = “border: medium none ; background: transparent url(img/calculate.png) repeat scroll 0% 0%; -moz-background-clip: border; -moz-background-origin: padding; -moz-background-inline-policy: continuous; width: 131px; height: 52px;”
type = “button”>

<br />
<br />
<div id = “instructions”><img src=”./img/how-it-works.png” alt=”how does it work?” width=”598″ height=”201″ /></div>
</form>

<center>

<p><br />

<br />
<br />
<br />

</center>
</div>

</body>
</html>

 

 

 

style.css code

 

 

 

body
{
font-family: sans-serif;
font-size: 12px;

}

#instructions
{
font-family: verdana;
font-size: 14px;
color: black;
border: 1px black dashed;
width: 600px;
}

#instructions a
{
color: #336699;
}

#targetDiv
{
align: center;
z-index: 4;
color: #FFFFFF;
width: 133;
font-size: 28px;
}

input.name
{
font-size: 20px;
}

 

 

 

calc.php code

 

 

<?php

$lovename=strtolower(preg_replace(“/ /”, “”, strip_tags(trim($_POST[‘p1’] . $_POST[‘p2’]))));

$alp =count_chars($lovename);

for ($i=97; $i <= 122; $i++)
{
if ($alp[$i] != false)
{
$anz=strlen($alp[$i]);

if ($anz < 2)
{
$calc[]=$alp[$i];
}
else
{
for ($a=0; $a < $anz; $a++)
{
$calc[]=substr($alp[$i], $a, 1);
}
}
}
}

while (($anzletter=count($calc)) > 2)
{
$lettermitte = ceil($anzletter / 2);

for ($i=0; $i < $lettermitte; $i++)
{
$sum = array_shift($calc) + array_shift($calc);
$anz =strlen($sum);

if ($anz < 2)
{
$calcmore[]=$sum;
}
else
{
for ($a=0; $a < $anz; $a++)
{
$calcmore[]=substr($sum, $a, 1);
}
}
}

$anzc=count($calcmore);

for ($b=0; $b < $anzc; $b++)
{
$calc[]=$calcmore[$b];
}

array_splice($calcmore, 0);
}

echo $calc[0] . $calc[1];
?>

 

Images ..:)

 

heart how-it-works hsaeart logo man woman bg calculate

renewdev

I Am Developer And Want To Share My Knowledge With The World..:) ;) . I Have Another Social Networking Website (Renewchat) And For Designing Or Developing Of Website Purpose You Can Contact Me On Renew Coder .. :) ;)

Leave a Reply

Your email address will not be published. Required fields are marked *