today i just found a new bug in my add squad system in a clan management system for my friends website since i his webmaster and when i went to test add squad module and it came bck after entering all the information with these errorrs
[CODE]
Notice: Use of undefined constant password – assumed ‘password’ in /home/bcdesign/public_html/dbs/addSquad.php on line 20
Notice: Use of undefined constant disable – assumed ‘disable’ in /home/bcdesign/public_html/dbs/addSquad.php on line 20
Notice: Use of undefined constant rank – assumed ‘rank’ in /home/bcdesign/public_html/dbs/addSquad.php on line 20
Notice: Use of undefined constant rank – assumed ‘rank’ in /home/bcdesign/public_html/dbs/addSquad.php on line 86
Notice: Undefined variable: clan in /home/bcdesign/public_html/dbs/addSquad.php on line 97
Notice: Undefined variable: leader in /home/bcdesign/public_html/dbs/addSquad.php on line 98
Notice: Undefined variable: site in /home/bcdesign/public_html/dbs/addSquad.php on line 99
Notice: Undefined variable: date in /home/bcdesign/public_html/dbs/addSquad.php on line 100
Notice: Undefined variable: channel in /home/bcdesign/public_html/dbs/addSquad.php on line 101
Notice: Undefined variable: members in /home/bcdesign/public_html/dbs/addSquad.php on line 103
Here is the code for it
[code=php]
if ($username == NULL) {
$username = $usercook;
$password = $passcook;
}
error_reporting(E_ALL);
?>
<?php
include(“header.php”);
$today = date( “Ymd”, time() );
$today2 = date( “m-d-Y”, time() );
$result = @mysql_query(“SELECT * FROM members WHERE username = “$username””);
$myrow = mysql_fetch_array($result);
if ($password == $myrow[password] and $username != NULL and $myrow[disable] != 1 and $myrow[rank] >= 16) {
if($myrow[“rank”] == 20) {
$rank = “Commander”;
}
if($myrow[“rank”] == 19) {
$rank = “General”;
}
if($myrow[“rank”] == 18) {
$rank = “Lt. General”;
}
if($myrow[“rank”] == 17) {
$rank = “Maj. General”;
}
if($myrow[“rank”] == 16) {
$rank = “Brig. General”;
}
if($myrow[“rank”] == 15) {
$rank = “Colonel”;
}
if($myrow[“rank”] == 14) {
$rank = “Lt. Colonel”;
}
if($myrow[“rank”] == 13) {
$rank = “Major”;
}
if($myrow[“rank”] == 12) {
$rank = “Captain”;
}
if($myrow[“rank”] == 11) {
$rank = “1st Luit.”;
}
if($myrow[“rank”] == 10) {
$rank = “2nd Luit.”;
}
if($myrow[“rank”] == 9) {
$rank = “Sgt. Major”;
}
if($myrow[“rank”] == 8) {
$rank = “Mstr. Gunnery Sgt.”;
}
if($myrow[“rank”] == 7) {
$rank = “1st Sgt.”;
}
if($myrow[“rank”] == 6) {
$rank = “Gunnery Sgt.”;
}
if($myrow[“rank”] == 5) {
$rank = “Staff Sgt.”;
}
if($myrow[“rank”] == 4) {
$rank = “Sergeant”;
}
if($myrow[“rank”] == 3) {
$rank = “Corporal”;
}
if($myrow[“rank”] == 2) {
$rank = “Lance Corporal”;
}
if($myrow[“rank”] == 1) {
$rank = “Priv. 1st Class”;
}
if($myrow[“rank”] == 0) {
$rank = “Private”;
}
if ($myrow[rank] >= 16) {
@mysql_query(“INSERT INTO squads SET clan = “$clan”, status = “$status”, leader = “$leader”,
site = “$site”, date = “$today”, channel = “$channel”, members = “$members”
“);
@mysql_query(“INSERT INTO log SET info = “$rank $username added $clan to squads page on $today2.”,
ip = “$ip””);
echo(”
<br> <br><br> <br>
Squad: $clan<br>
Leader: $leader<br>
Website: $site<br>
Date: $date<br>
Channel: $channel<br>
Number of Members: $members
<br> <br>
Click <a href=index.php>here</a> to return to login.<p>
“);
}
else {
echo(”
<br> <br><br> <br>
I’m sorry you do not have high enough rank.<a href=index.php>Back</a>
“);
}
}
else {
echo(”
<br> <br><br> <br>
Please Login
“);
}
include(“footer.php”);
How can i fix this?