Re: Newbie



On Jun 29, 11:15 am, Reggie <joelregisfo...@xxxxxxxxxxx> wrote:
Notice: Undefined variable: submit in /home/fhlinux169/c/
clashoff.co.uk/user/htdocs/create_entry.php on line 7
not registered

This is an error message i get when trying to setup userlogin on my
website.

This is my code please help.

<?php

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

if ($submit == "Register")
{
$query = "insert into user
(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");}

?>

You get the error because $submit is not defined. You need to use
$_POST['submit'] (and probably $_POST['username'] and
$_POST['password'] as well).

Read this:

<http://www.php.net/manual/en/language.variables.predefined.php>

And pay special attention to the notes about register_globals.

.



Relevant Pages

  • Re: Problems connecting to internet via GPRS
    ... The error message is basically saying that it can't find System.SR.dll so there's no error message. ... da die optionale Ressource der Assembly, ... If the application forces the connection itself (for example via web ... Es kann keine Fehlermeldung angezeigt werden, ...
    (microsoft.public.dotnet.framework.compactframework)
  • Re: Embedded Functions in MATLAB with MPC555
    ... the Model Explorer and specify everything about the signal type on the input ... this would either work or give you a different error message. ... % Diese Variablen hälten Eigenschaften die Funktionen ... if (isempty(byte_identifier)) ...
    (comp.soft-sys.matlab)
  • Re: Detecting line terminators in a CSV file
    ... precedence || operator means it won't die even if you wanted it to. ... I'll check out that precedence thing ... shouldn't use evalto print an error message from a built-in function. ... openfails it returns undef and puts the error message in $!. ...
    (perl.beginners)
  • Re: finding compile time errors
    ... It looks a *lot* like the Perl DBI module which might be the ... Is there a die in PHP with an error message? ... Of course there's a way to kill a script with dieand an error ...
    (comp.lang.php)
  • How to catch runtime error?
    ... error message for every execution of the sub ... die} ... the program runs w/o any problem for reasonable sizes. ...
    (comp.lang.perl.misc)