Write a PHP program to accept two strings from user and check whether entered strings are matching or not. (Use sticky form concept)||EasyCoding45

 In this Tutorial we are going to learn how we can  Write a PHP program to accept two strings from user and check whether entered strings are matching or not. (by Using sticky form concept)


Program ::--

<html>

<title>String Match</title>

<body>

<form method="POST" action="<?php $_SERVER['PHP_SELF'];?>">

Enter String 1 :<input type=text name=t1 value="<?php if(isset($_POST['t1'])) echo $_POST['t1'];?>"></br>

Enter String 2 :<input type=text name=t2 value="<?php if(isset($_POST['t2'])) echo $_POST['t2'];?>"></br>

<input type=submit value=submit></br>

</form>

</body>

</html>


<?php

if(isset($_POST['t1']))

{

if($_POST['t1']==$_POST['t2'])

echo"Strings are matching ";

else

echo "Strings are not Matching";

}

?>

Output ::--




Comments