Checking Values
Moderator: General Moderators
-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
Checking Values
This is wrong. You can check it out, as you can see it doesn't update anything to the database. I know their is something wrong with my if statement on line:19.
Last edited by anthony88guy on Thu May 12, 2005 6:10 pm, edited 2 times in total.
-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm
-
method_man
- Forum Contributor
- Posts: 257
- Joined: Sat Mar 19, 2005 1:38 am
he means do this
replace line 19 with
if(($username !== "" || $pass1 !== "" || $pass2 !== "" || $statslink !== "") && $pass1 == $pass2){ like thallish said.
matt
Code: Select all
<?php
$status = "";
$status1 = "";
$status2 = "";
include_once('database.php');
if($_POST){
$username = $_POST['usrname'];
$pass1 = $_POST['pass1'];
$pass2 = $_POST['pass2'];
$statslink = $_POST['statslink'];
if($pass1 !== $pass2){
$status = "Passwords Do Not Match<br>";
}
if($username == "" || $pass1 == "" || $pass2 == "" || $statslink == ""){
$status1 = "Please Fill in All Fields";
}
if(($username !== "" || $pass1 !== "" || $pass2 !== "" || $statslink !== "") && $pass1 == $pass2) {
mysql_connect("$host", "$dbuser", "$dbpass") or die("Cannot Connect to Database at this time.");
mysql_select_db("$dbname") or die("Cannot Connect to Database at this time.");
mysql_close();
$status2 = "You have Successfully Registered, You can now <a href=\"login.php\">Login</a>.";
}
}
?>
<html>
<head>
<title>No Kidding</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body bgcolor="#333333" text="#CCCCCC" link="#FFCC00" vlink="#FFCC00" alink="#FFCC00" onLoad="MM_preloadImages('../Images/menu05ov.gif','../Images/menu02ov.gif','../Images/menu03ov.gif','../Images/menu04ov.gif','../Images/menu01ov.gif')">
<div align="center">
<table width="100%" height="50" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="50" background="../Images/bg.gif"> <div align="center"> </div>
<div align="right"></div>
<div align="center"><a href="http://www.nokidding.websiteallies.com" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image6','','../Images/menu01ov.gif',1)"><img src="../Images/menu01.gif" alt="Home" name="Image6" width="95" height="50" border="0"></a><a href="http://www.nokidding.websiteallies.com/downloads.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image2','','../Images/menu02ov.gif',1)"><img src="../Images/menu02.gif" alt="Downloads" name="Image2" width="140" height="50" border="0"></a><a href="http://www.nokidding.websiteallies.com/links.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image3','','../Images/menu03ov.gif',1)"><img src="../Images/menu03.gif" alt="Links" name="Image3" width="91" height="50" border="0"></a><a href="http://www.nokidding.websiteallies.com/bankingcalc.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image4','','../Images/menu04ov.gif',1)"><img src="../Images/menu04.gif" alt="KOC Calculators" name="Image4" width="163" height="50" border="0"></a><a href="http://www.nokidding.websiteallies.com/mail.html" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','../Images/menu05ov.gif',1)"><img src="../Images/menu05.gif" alt="Contact" name="Image5" width="111" height="50" border="0"></a>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image5','','../Images/menu05ov.gif',1)"></a></div></td>
</tr>
</table>
<p><strong>UNDER CONSTRUCTIO<font color="#CCCCCC">N</font> </strong> <br>
<br>
<?php print "<b><font color=\"#FF0000\"> $status $status1 $status2</font></b>";?> </p>
<form action="register.php" method="post" name="register" id="register">
<table width="520" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#990000"> </td>
<td width="68%" bgcolor="#990000"> <div align="center"><strong>Registration Form</strong></div></td>
</tr>
<tr>
<td width="32%" height="25" bgcolor="#666666">
<div align="right"><strong>KoC Username:</strong></div></td>
<td height="25" bgcolor="#666666">
<input name="usrname" type="text" id="usrname" size="20" style="color:black; background-color:#CCCCCC; border-width:0px;"></td>
</tr>
<tr>
<td height="25" bgcolor="#333333">
<div align="right"><strong>Password*:</strong></div></td>
<td height="25">
<input name="pass1" type="password" id="pass1" size="20" style="color:black; background-color:#CCCCCC; border-width:0px;"></td>
</tr>
<tr>
<td height="25" bgcolor="#666666">
<div align="right"><strong>ReEnter Password*:</strong></div></td>
<td height="25" bgcolor="#666666">
<input name="pass2" type="password" id="pass2" size="20" style="color:black; background-color:#CCCCCC; border-width:0px;"></td>
</tr>
<tr>
<td height="25" bgcolor="#333333">
<div align="right"><strong>KoC Stat Link:</strong></div></td>
<td height="25">
<input name="statslink" type="text" id="statslink" size="50" style="color:black; background-color:#CCCCCC; border-width:0px;"></td>
</tr>
<tr>
<td height="30" bgcolor="#990000"> <div align="center">
<input type="reset" name="Submit2" value="Reset" style="color:black; background-color:#CCCCCC; border-width:0px;">
</div></td>
<td height="30" bgcolor="#990000"> <div align="center">
<input type="submit" name="Submit" value="Register" style="color:black; background-color:#CCCCCC; border-width:0px;">
</div></td>
</tr>
<tr bgcolor="#333333">
<td colspan="2"><div align="center"><font size="-1"><strong>* Not your
KoC password, even though your password is encypted.</strong></font></div></td>
</tr>
</table>
</form>
<p><br>
</p>
<p> </p>
</div>
</body>
</html>if(($username !== "" || $pass1 !== "" || $pass2 !== "" || $statslink !== "") && $pass1 == $pass2){ like thallish said.
matt
-
method_man
- Forum Contributor
- Posts: 257
- Joined: Sat Mar 19, 2005 1:38 am
-
anthony88guy
- Forum Contributor
- Posts: 246
- Joined: Thu Jan 20, 2005 8:22 pm