Page 1 of 1

problem with simple login script

Posted: Fri Aug 18, 2006 11:56 am
by tommy1987
feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Code: Select all

<?php
include("include-mysql.php");

if(!isset($_SESSION['myusername'])) {
?>
<form action="check_login.php" 
      method="post">
	<table align="center" bgcolor="#CCCCCC">
		<tr>
			<td align="right">Username: </td>
			<td><input type="text" name="myusername" id="myusername"></td>
		</tr>
		<tr>
			<td width="92" align="right">Password: </td>
			<td width="189"><input type="password" name="mypassword" id="mypassword"></td>
		</tr>
		<tr>
			<td colspan="2" align="center"><input type="submit" value="Log in" /></td>
		</tr>
	</table>
</form>


<?php
   //exit;        
} else {
  echo 'You are already logged in.';
}
?>
I have the above code, and whenever I try to submit the form, it displays this in the address bar:

http://www.subaddress.myaddress.co.uk/i ... ssientered.

This puzzles me because 1. I am not sending the form to index.php, and 2. I am using POST, therefore the data should not be able to be observed in the address bar.

Hope somebody can help,, its driving me mad!


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]

Posted: Fri Aug 18, 2006 12:13 pm
by feyd
Do you have a live page we can look at?

Posted: Fri Aug 18, 2006 12:41 pm
by s.dot
My guess would be you have not closed another form on the page (</form>). Although it's hard to say, your example seems fine.