Newbie problem with a login...
Posted: Sat Mar 22, 2003 12:50 am
I am just learning how to use sessions and stuff and I keep getting an 'error' you could say..here are the scripts (nothing too fancy):
index.php:
process.php:
index2.php:
It gets to index2.php just fine, but when it hits there the 'error' as I mentioned is this:
Currently logged in as: !
how do I get it to not say that? Thanks for any help
Again, I am not the greatest scripter inthe world, just started learning a few days ago.
index.php:
Code: Select all
<HTML>
<HEAD>
<TITLE>.: Random Design :..: Home :.</TITLE>
</HEAD>
<BODY bgcolor="White" text="Black" link="Navy" alink="Fuchsia">
<p align="Center">
<? print "Welcome! Please log in." ?>
<FORM action="process.php" method="POST">
Username:<input type="text" name="username" maxlength="15"><br>
Password:<input type="password" name="password" maxlength="10"><br>
<INPUT type="submit" value="Log in!">
</BODY>
</HTML>Code: Select all
<? session_start(); ?>
<? session_register("username","password"); ?>
<?php
if( !$_POSTї'username'] ) {
print "No <b>username</b> entered!";
die;
}
if( !$_POSTї'password'] ) {
print "No <b>password</b> entered!";
die;
}
else {
print "Thank you for logging in, <b>".$_POSTї'username']."</b>!";
}
?>
<br>
<? print "Goto the main website by clicking " ?>
<a href="index2.php">here!</a>Code: Select all
<? session_start(); ?>
<? session_register("username","password"); ?>
<br>
<br>
<br>
<?php print "Currently logged in as: ".$username."!"; ?>Currently logged in as: !
how do I get it to not say that? Thanks for any help