can someone give me a better version of this...
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$txt1 = "Your username is <b>" . $_POST['username'] ."</b><br/>";
$txt2 = "Your password is <b>" . $_POST['password'] ."</b><br/>";
if (strlen($password)<= 3)
{
echo "<ul><li><font color=\"red\">Password needs to be 4 or more characters!
</font></li>";
}
if (strlen($username)<= 3)
{
echo "<li><font color=\"red\">Username needs to be 4 or more characters!
</font></li></ul>";
}
?>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<input type="text" name="username" />
<input type="password" name="password" />
<input type="submit" value="Enter" />
</form>
<?php
if (isset($username) && ($password))
{
echo "$txt1";
echo "$txt2";
}
else {
echo "<br />";
}
?>
Thanks!
<?php
$username = $_POST['username'];
$password = $_POST['password'];
$txt1 = "Your username is <b>" . $_POST['username'] ."</b><br/>";
$txt2 = "Your password is <b>" . $_POST['password'] ."</b><br/>";
if (strlen($password)<= 3)
{
echo "<ul><li><font color=\"red\">Password needs to be 4 or more characters!
</font></li>";
}
if (strlen($username)<= 3)
{
echo "<li><font color=\"red\">Username needs to be 4 or more characters!
</font></li></ul>";
}
?>
<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post">
<input type="text" name="username" />
<input type="password" name="password" />
<input type="submit" value="Enter" />
</form>
<?php
if (isset($username) && ($password))
{
echo "$txt1";
echo "$txt2";
}
else {
echo "<br />";
}
?>
Thanks!