How to include PHP in HTML
Posted: Mon May 25, 2009 12:22 pm
Hello!
I have a html file that has forms and some submit buttons.
I want that html page to show some information that is executed from a PHP code but I dont know how to do it... (how to maintain the looks of the html page and return the result of the PHP script?)
I think it should be something like this:
Thanks a lot! 
I have a html file that has forms and some submit buttons.
I want that html page to show some information that is executed from a PHP code but I dont know how to do it... (how to maintain the looks of the html page and return the result of the PHP script?)
I think it should be something like this:
Code: Select all
<?php
include('config.php');
?>
<html>
<head>
<title>Personal INFO</title>
</head>
<body>
<form method="post" action="<?php echo $PHP_SELF;?>">
First :<input type="int" size="12" maxlength="12" name="Fname"><br />
</form>
<?php
$Fname = $_POST["Fname"];
$Lname = $_POST["Lname"];
$nome = mysql_query("SELECT * FROM `names` WHERE id =".$Fname."");
$array = array();
$coiso= mysql_fetch_array($nome);
array_push($array,$coiso);
print_r($array);
?>
</body>