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

Sticky.php
<html>
<body>
<form method=post action="Sticky.php">
<fieldset>
<legend>Enter Strings in the text Boxes !</legend>
<p><b>String1 :</b><input type=text name=s1 value="<?php if(isset($_POST['s1'])) echo $_POST['s1'];?>"></p>
<p><b>String2 :</b><input type=text name=s2 value="<?php if(isset($_POST['s2'])) echo $_POST['s2'];?>"></p>
</fieldset>
<div align=center>
<input type=submit name=submit value="submit string">
</div>
<input type="hidden" name="submit" value=true>
</form>
<?php
if(isset($_POST['submit']))
     {
            $s1=$_POST['s1'];
            $s2=$_POST['s2'];
if(strcmp($s1,$s2)==0)
echo"<br><b>Matching</b>";
else
echo"<br><b>Not Matching</b>";
      }
?>
</body>
</html>

Comments

Popular posts from this blog

Create an XML file which gives details of books available in “ABC Bookstore” from following categories. 1)      Technical 2)      Cooking 3)      Yoga And elements in each category are in the following format.     …….     …….     ……. Save the file as “Book.xml” Create an application that reads “Book.xml” file into simple XML object. Display attributes and elements. (Hint:- Use simple_xml_load_file() function). 

Write a simple PHP program which implements Ajax for addition of two numbers

Consider the following relational database: Project (P_Group_No, Project_Title) Student (Seat no, Name, Class, P_Group_No) Write a PHP script to accept project title and display list of students those who are working in a particular project.