Love Calculator Using PHP | Calculate the love factor between two names in PHP Tutorial

love-calculator

Calculate the love factor between two names in PHP Tutorial

 

Love Percentage Calculator utilizing PHP source code This PHP venture is utilized to ascertain your adoration rate. This code will give you rough values. Try not to take this as a genuine one. This basic venture was produced for the sake of entertainment making purposes. Sweethearts can utilize this number cruncher for esteeming their affection. Clients need to enter their name and accomplices name in the content boxes. After need to click figure catch. At that point, the Love rate will be shown on the screen. We have a unique segment for PHP smaller than normal ventures free download. Visit our extraordinary page and discover parcel of valuable PHP scaled down ventures.

Both young men and young ladies can discover their affection rate. Be that as it may, you ought to enter your name and your adorable accomplice’s sweet name.

Live Demo   Download Source Code

 

Index.php

<!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 | Lisenme.com</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><a href = "https://www.lisenme.com/"><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" value = "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" value = "Enter Full Name" type = "text" />

                                <br />                            </td>
                      </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 />
                  
                  <span class="style1">&copy; 2017 <a href = "https://www.lisenme.com/">Love Calculator - lisenme.com</a></span></p>
          </center>
        </div>

</body>
</html>

Style.css

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

<?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];
?>

 

 

 

 

You May Also Like

About the Author: Ranjith Kumar A

0 0 votes
Article Rating
Subscribe
Notify of
guest
9 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Sohail Anwar
2 years ago

Can we put Adsense code in this script? and will it be secure to use Adsense code in this script?

Best places to visit in Uttarakhand

great website !! loved it

Chandan Ghosh
2 years ago

Where to upload this code and run this script on the internet ???
Tell me Full detail.
Plsss reply first.

anjli
2 years ago

excellent work

Aisha
1 year ago

Nice Post.
bookmarked this site

Komal
1 year ago

Please please reply How to upload this code?
Waiting

Deployer
1 year ago

Blogger

subham kumar
1 year ago

Awesome website

9
0
Would love your thoughts, please comment.x
()
x