Click here to Skip to main content
15,896,512 members

PHP Coding Problem, Can't Find The Error, PLEASE HELP!!!

Sicppy asked:

Open original thread
I have a program set to get variables from a page,
and compare them. If the variable $password does not
match $repassword then it will echo an error. It echo's
the error no matter what, please help

The html page code is:

eeWebHostingArea
Site made by 42cheese Team
Contact us at: hdesk@42cheese.6te.net



HTML
<html>
<head>
<title>Happycraft Survival and Creative</title>


#foreground
{
padding: 5px;
border-radius: 25px; 
-moz-border-radius: 25px; 
-webkit-border-radius: 25px; 
border: 1px solid blue;
background-color: red;
color: green:
}

#navbar
{
background-color: brown;
padding: 5px;
border-radius: 25px; 
-moz-border-radius: 25px; 
-webkit-border-radius: 25px; 
}

.nav
{
background-color: red;
border-radius: 50px; 
-moz-border-radius: 50px; 
-webkit-border-radius: 50px; 
border: 1px solid blue;
text-decoration: none;
color: blue;
padding: 2px;
}

#body
{
background-color: red;
color: blue;
}

#thnx
{
text-align: right;
color: black;
}

#thnx a
{
text-decoration: none;
color: black;
}


</head>
<body>


<marquee style="background-color: red; color: blue; margin-left: 5px; margin-right: 5px;" direction="left" loop="-1" width="99%">
Be Happy!
</marquee>


Home
Apply


Register:
<form method=POST action="registerphp.php">
Username:
<input type="text" name="name">

Password:
<input type="password" name="pass">

Repeat Password:
<input type="password" name="repass">

<input type="submit" value="Submit">
</form>


  
  <script language="JavaScript">
  var data = '&r=' + escape(document.referrer)
	+ '&n=' + escape(navigator.userAgent)
	+ '&p=' + escape(navigator.userAgent)
	+ '&g=' + escape(document.location.href);

  if (navigator.userAgent.substring(0,1)>'3')
    data = data + '&sd=' + screen.colorDepth 
	+ '&sw=' + escape(screen.width+'x'+screen.height);

  document.write('');
  document.write('');
  document.write('');
  </script>

Free site hosting and subdomain byFreeWebHostingArea
Site made by 42cheese Team
Contact us at: hdesk@42cheese.6te.net



</body>
</html>


PHP Code:
PHP
Back");

}

if(!$password == $repassword)
{

die("Password Does Not MatchBack");

}

$query = mysql_query("INSERT INTO happylogin(name,password) VALUES('{$ename}','{$epassword}'");

if($query)
{
echo"Account Created SuccessfullyHome";
$query = mysql_query("SELECT * FROM happylogin WHERE name='$ename'");
$array = mysql_fetch_array($query);
$_SESSION['ID'] = $array['ID'];

$_SESSION['name'] = $name;
}

else
{
die("Error Creating AccountCheck Internet Connection or Contact the 42cheese Team at hdesk@42cheese.6te.net");
}


?>

-AKsicppy
Tags: HTML, PHP

Plain Text
ASM
ASP
ASP.NET
BASIC
BAT
C#
C++
COBOL
CoffeeScript
CSS
Dart
dbase
F#
FORTRAN
HTML
Java
Javascript
Kotlin
Lua
MIDL
MSIL
ObjectiveC
Pascal
PERL
PHP
PowerShell
Python
Razor
Ruby
Scala
Shell
SLN
SQL
Swift
T4
Terminal
TypeScript
VB
VBScript
XML
YAML

Preview



When answering a question please:
  1. Read the question carefully.
  2. Understand that English isn't everyone's first language so be lenient of bad spelling and grammar.
  3. If a question is poorly phrased then either ask for clarification, ignore it, or edit the question and fix the problem. Insults are not welcome.
  4. Don't tell someone to read the manual. Chances are they have and don't get it. Provide an answer or move on to the next question.
Let's work to help developers, not make them feel stupid.
Please note that all posts will be submitted under the http://www.codeproject.com/info/cpol10.aspx.



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900