PHP Register Form > Code appears on the form

simonz32

New Member
When I type in the code
<?php
echo "<h1> Registration </h1>";

$submit = $_POST['submit'];

// form data
$fullname = $_POST['fullname'];
$username = $_POST['username'];

$password = $_POST['password'];
$repeatpassword = $_POST['repeatpassword'];


if ($submit)
{

echo "$username/$password/$repeatpassword/$fullname";

}

?>

<html>


<style type="text/css">
<!--
@import url("file:///C|/Users/Sheiße/Desktop/LS/black/styles.css");
.style14 {
color: #FFFFFF;
background-image: url(images/woodbutton.jpg);
width: inherit;
font-style: normal;
}
.style22 {
font-family: "Palatino Linotype";
font-weight: bold;
color: #000000;
}
.style24 {width: inherit; font-style: normal; background: url(file:///C|/Users/Shei%C3%9Fe/Documents/CASPECT/woodbutton.jpg);}
-->
</style>
<form action='file:///C|/Users/Sheiße/Desktop/LS/black/register.php method='POST'>
<table width="375" height="147" background="images/x (2).jpg" bgcolor="#2B3928">
<tr>
<td background="images/lol.jpg" bgcolor="#FFFFFF"><div align="center"><span class="style22">
Your Full Name </span></div></td>
<td>
<div align="center">
<input type='text' name='fullname'>
</div></td>
</tr>
<tr>
<td background="images/lol.jpg" bgcolor="#FFFFFF"><div align="center"><span class="style22">
Choose a Username </span></div></td>
<td>
<div align="center">
<input type='text' name='username'>
</div></td>
</tr>
<tr>
<td background="images/lol.jpg" bgcolor="#FFFFFF"><div align="center"><span class="style22">
<span class="style22">Choose</span> a Password </span></div></td>
<td>
<div align="center">
<input type='password' name='password'>
</div></td>
</tr>
<tr>
<td background="images/lol.jpg" bgcolor="#FFFFFF"><div align="center"><span class="style22">
Confirm Password
</span></div></td>
<td background="dark-wood-texture.jpg">
<div align="center">
<input type='password' name='repeatpassword'>
</div></td>
</tr>
</table>
<div align="left"></div>
<p align="left">
<input name='submit' type='submit' class="style14" value='Register'>

</form>

</html>

All this has happened, it shows the coding at the top of my form when I try to preview in Firefox ... I have this code on the top script and before <html> Tagg

why does it do this
?

5cf4gm.jpg
 

logoarena

New Member
uhm seems like you are just opening in firefox without using the webserver.
Did you installed apache + php?

anyway this form:
<form action='file:///C|/Users/Sheiße/Desktop/LS/black/register.php method='POST'>

can't work because action file should refer to a file in the server (setup by apache), this is like you are pointing to a file in the system, also is missing a ' at the end
<form action="somefile.php" method="post" name="form">
...
 
Top