Original Post
Hi!
I'm new to PHP and trying to make a login form. I keep getting the warnings:
[font="Times New Roman"]Here is my code:[/font]
[font="Times New Roman"] [/font][font="'Times New Roman"]
[size=2]
[size=2][/font]
I'm new to PHP and trying to make a login form. I keep getting the warnings:
Notice: Undefined index: TxtFname in C:\Programfiler\xampp\htdocs\login.php on line 3
Notice: Undefined index: TxtPwd in C:\Programfiler\xampp\htdocs\login.php on line 4[font="Times New Roman"]Here is my code:[/font]
[font="Times New Roman"] [/font][font="'Times New Roman"]
[size=2]
[size=2]<?php
[size=2]/* Created on: 16.03.2011 */
[size=2]$TxtFname = $_POST["TxtFname"];
[size=2]$TxtPwd = $_POST["TxtPwd"];
[size=2]
[size=2]if (!isset($_POST["BtnSubmit"])) //If form is not submitted to itself yet...
[size=2]{
[size=2]?>
[size=2]<html>
[size=2]<body>
[size=2] <form method="post" action="<?php echo $PHP_SELF;?>">
[size=2] Brukernavn:<input type="text" size="20" maxlength="20" name="TxtFname">
[size=2] Passord:<input type="text" size="20" maxlength="20" name="TxtPwd">
[size=2] <input type="submit" value="Logg inn" name="BtnSubmit">
[size=2]
[size=2] </form>
[size=2] <?
[size=2] }
[size=2] else
[size=2] {
[size=2] //TODO: DB...
[size=2] }
[size=2] ?>
[size=2]</body>
[size=2]</html>[size=2][/font]