RE: [PHP-WIN] forms, php

From: Date: Mon, 20 Jan 2003 02:38:00 +0000
Subject: RE: [PHP-WIN] forms, php
References: 1  Groups: php.windows 
Request: Send a blank email to php-windows+get-17983@lists.php.net to get a copy of this message
For starters. $username = $_POST['username']; in your form, you declare name, not username is this code you've given from the page login.php? is it simply submitting to itself? chris kranz <http://www.fatcuban.com/> fatcuban.com -----Original Message----- From: Adrian Partenie [mailto:adrian.partenie@artelecom.net] Sent: Sunday, January 19, 2003 10:41 PM To: php-windows@lists.php.net Subject: [PHP-WIN] forms, php Hello, The code below outputs the errors: Notice: Undefined index: submit in login.php on line 19 Notice: Undefined index: username in on line 20 Notice: Undefined index: password in on line 21 In rest works fine. Register_globals are on. What I'm doing wrong? Thanks, Adrian ?php echo " <form method=post action=/login.php> <br> <b>name:</b><br><input type=\"text\" name=\"name\"><br> <b>password:</b><br><input type=\"text\" name=\"password\"><br> <input type=\"submit\" name=\"submit\" value=\"Submit\"> "; $submit = $_POST['submit']; //line 19 $username = $_POST['username']; //line 20 $password = $_POST['password']; if ($submit) { $result=mysql_connect("localhost", $username, $password) or die("Invalid username or password"); //printf("Succesfully conected"); if ($result){ echo "<td><a href=\"main_page.html\">Database</a></td>"; } } ?> </body> </html>

« previous php.windows (#17983) next »