I have the following piece of code and wish to display it as text in a webpage. How can I do it? I wat the code mentioned below to be displayed as text in a webpage. The page might be either a .html page or a .php page. Kindly help.
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Log in!</title>
<style type="text/css">
div {
width:300px;
height:120px;
margin: 0px auto;
margin-top: 100px;
padding: 30px 20px;
border:2px solid #00F;
background-color:#0CF;
border-radius:10px;
}
span{
margin:0px auto;
color:#F00;
font-family:Verdana, Geneva, sans-serif;
font-size:12px;
}
</style>
</head>
<body>
</body>
<?php
require_once('conn.php');
$sql="select * from contacts where contacts_id=14";
$result=$mysqli->query($sql);
$row=$result->fetch_array();
if( isset($_POST['id']) && $row['email']==$_POST['id'] && $_POST['password']==$row['password'])
{
header("location:view.php") ;
$_SESSION['sid']= $row['email'];
$flag=1;
}
?>
<div>
<form method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">
<table align="center" border="0">
<tr>
<td>Id</td>
<td>:</td>
<td><input type="text" name="id" placeholder="Email" /></td>
</tr>
<tr>
<td>Password</td>
<td>&:</td>
<td><input type="password" name="password" /></td>
</tr>
<tr>
<td></td>
<td colspan="2"><input type="submit" value="Log In!" /></td>
</tr>
</table>
</form>
<?php
if (isset($_POST['id']) && isset($_POST['password']) && $flag==0)
{
echo "<center><span>Invalid Id/Password</span></center>";
}
?>
</div>
</body>
</html>
.phpsextension, or usehighlight_file()php.net/manual/en/function.highlight-file.php - If that'swhat this question is about. Or, are you asking to do a "printer-friendly" method? Your question is a bit unclear.@symbol followed by my name, should you need more info.