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 PHP program to create a simple calculator that can accept two numbers and perform operations like add, subtract, multiplication and divide (using Self Processing form)

Write an Ajax program to print the content of the myfile.dat. This code asks the user to click a button, fetches data from the server using Ajax techniques and displays that data in the same web page as the button without refreshing the page