I made a simple script for practice and it does work but not intirely the way I wanted. After logging in it opens a new window instead of loadiing in the same page. In what way can I change this script to continue in the same window?
Thankx,
Denise
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HEAD>
<TITLE>Form</TITLE>
</HEAD>
<BODY>
<?
if (empty($stage))
{
display_form();
}
else
{
process_form();
}
?>
<?
function display_form() {
?>
<FORM TARGET="<?php echo $PHP_SELF; ?>" METHOD=post>
<table>
<tr>
<td>Name:</td><td><INPUT TYPE=TEXT NAME="name"></td>
</tr>
<tr>
<td>Password:</td><td><INPUT TYPE=password NAME="passw"></td>
</tr>
<tr>
<td colspan="2" align="center"><INPUT TYPE=HIDDEN NAME="stage" VALUE="results"><INPUT TYPE="submit" value="Inloggen"></td>
</tr>
</FORM>
<?
}
?>
<?
function process_form() {
global $name;
global $passw;
if ($name == 'Denise')
{
if ($passw == 'wachtwoord')
{
echo ("Hoi Denise, je bent nu ingelogd");
}
else
{
echo ("Je wachtwoord is niet juist");
display_form();
}
}
else
{
echo ("Je gebruikersnaam is niet juist!");
display_form();
}
}
?>
</BODY>