Posts

Showing posts from August, 2010

Replacing form fields by text in PHP

Image
In PHP, the form field has replaced with the custom text after processing by either using an HTML file or hiding the form fields using the PHP script. This method can also be used for applying static header and footer on the web page. In the following example, I have used an HTML file and PHP script to add two numbers. The HTML file content has replaced during the execution.Before ExecutionAfter ExecutionSource Code:form.html<form method="post" action="<?php print $_SERVER['PHP_SELF']; ?>" > First Number: &nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="first"><br> Second Number: <input type="text" name="second"><br><br> <input type="reset" value="Reset"><input type="submit" value="Submit"> </form>addition.php<html> <head> <title>Adding two numbers</title> …