Hello. I'm trying to create a combined login/database input script that has an if conditional where if the login details have been entered it present the database input screen and if they are not entered it presents the login screen. Now I've got it to work, it runs, but both forms are being displayed, and it seems to be ignoring the if conditional (obviously when the page first loads nothing's been entered).
Here's my code so far (oh and the top 'header.html' is not being included, to see it see www.patwanet.co.uk/header.html))
<html>
<head>
<title>HP Fanfic Upload</title>
</head>
<body>
<div align="center">
<?php
include('header.html');
if ($username=="patwa" && $password=="usual")
// if login details are correct present upload form
?>
<h1>HP Fanfic Upload</h1>
<p>
<form action="hpupload2.php" method="POST">
<table border="0">
<tr>
<td>Story Name</td>
<td><input type="text" name="storyname" size="20"></td>
</tr>
<tr>
<td>Chapter No</td>
<td><input type="text" name="ChapterID" size="4"></td>
</tr>
<tr>
<td>Chapter Title</td>
<td><input type="text" name="ChapterTitle" size="20"></td>
</tr>
<tr>
<td>Text</td>
<td><input type="textarea" rows="10" cols="30"></td>
</tr>
<tr>
<td><input type="reset" value="Clear"></td>
<td><input type="submit" value="Upload"></td>
</tr>
</table>
</form>
</p>
<?php
else
// otherwise present login form again
?>
<p>Please enter the Administrator Username and Password</p>
<form action="hpupload.php" method="POST">
<table border="0">
<tr>
<td>Username</td>
<td><input type="text" name="username" size="20"></td>
</tr>
<tr>
<td>Password</td>
<td><input type="text" name="password" size="20"></td>
</tr>
<tr>
<td><input type="reset" value="Clear"></td>
<td><input type="submit" value="Login"></td>
</tr>
</table>
</form>
<img src="http://s93107741.onlinehome.us/tinc?key=dntPuKf1">
</div>
</body>
</html>
The result can be seen at www.patwanet.co.uk/hpupload.php
Your help with this would be appreciated. Please do keep in mind tho that i'm a newbie to PHP.
Thanks.
Hussein.