Re: Newbie 2



I think after the line below,
if ($_POST['submit'] == "Register")
you should get the inputs into $username and $password variables from
post array as follows:
$username = $_POST['whatevertheinputfieldname'];
$password = $_POST['whatevertheinputfieldname'];

On Jun 30, 12:52 am, Reggie <joelregisfo...@xxxxxxxxxxx> wrote:
Notice: Undefined variable: username in /home/fhlinux169/c/
clashoff.co.uk/user/htdocs/create_entry.php on line 11

Notice: Undefined variable: password in /home/fhlinux169/c/
clashoff.co.uk/user/htdocs/create_entry.php on line 11

Ive got a new error message please help.Am trying to setup userlogin
on my website.

This is the code:

<?php

mysql_connect("localhost","root") or
die ("Could not connect to database");
mysql_select_db("user") or
dir ("Could not select database");

if ($_POST['submit'] == "Register")
{
$query = "insert into users
(username, password) values ('$username', '$password')";
mysql_query($query) or
die (mysql_error());
?>
<h3>You are now registered</h3>
<a href="index.html">Go back to main page</a>
<?php}

else
{
print("not registered");}

?>


.



Relevant Pages

  • Re: Newbie 2
    ... you should get the inputs into $username and $password variables from ... die; ... in my code an also where would i get my input file from. ...
    (comp.lang.php)
  • Re: Mounten von Windows-Freigaben
    ... kann, "username", falls der Server eine Authentizierung erwartet. ... | specifies the username to connect as. ... Spielt keine Rolle, die Option "user" benoetigt man in der fstab, damit ... der user selbst mounten kann (ohne diese Option benoetigt das mounten ...
    (de.comp.os.unix.linux.misc)
  • Re: max. Laenge eines Usernamens
    ... wie lang darf bei Linux ein Username sein? ... Zitat Linux admin FAQ, Punkt 16.7: ... What is the maximum username length, and is there way to extend it? ... Nur sind die dann in den logs ununterscheidbar. ...
    (de.comp.os.unix.linux.misc)
  • Re: Net::FTP help needed
    ... or die "Couldn't authenticate, even with username and password. ... documentation. ...
    (comp.lang.perl.modules)
  • I dont want to re-invent the Login/Login Wheel - Help with utilities
    ... I am starting a small project for a friend who expects to have ... users do a normal logon process using UserName & Password variables. ...
    (microsoft.public.vstudio.general)