Først og fremmest vil jeg lige sige, at din kode er enormt rodet. Det kan godt være du selv kan finde rundt i det, men andre, der skal hjælpe dig(eks. mig), kan have sværere ved at forstå koden.
Jeg har derfor gjort koden en smule mere overskuelig (synes jeg selv). Så kan du jo også lure nogle fifs af sådan du selv kan gøre det mere overskueligt næste gang.
Her er den:
<?
session_start();
?>
<style type="text/css">
<!--
body,td,th {
color: #000000;
}
body {
background-color: #BE0000;
}
a {
font-weight: bold;
}
a:link {
text-decoration: none;
color: #000000;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
color: #000000;
}
a:active {
text-decoration: none;
color: #000000;
}
-->
</style><title>[Team-SMG]</title><body oncontextmenu="return false" ondragstart="return false" onselectstart="return false">
<div align="center">
<p align="center">
<?
if(isset($_SESSION['logget_ind'])){
include ("sql.php");
$get_user = mysql_query("SELECT * FROM users WHERE brugernavn = '$brugernavn'") or (die mysql_error));
$row = mysql_fetch_array($get_user);
if($row['status'] == "Clan-Leader" OR $row['status'] == "Clan-Member") {
if($_GET['tjek'] == "true") {
echo '<b>New Clan-War</b>
<p align="center">';
$modstander = $_POST['modstander'];
$beskrivelse = $_POST['beskrivelse'];
$server = $_POST['server'];
$hp = $_POST['hp'];
$tid = $_POST['tid'];
$dag = $_POST['dag'];
$month = $_POST['month'];
$dato = $_POST['dato'];
if(empty($modstander)) {
echo "The fields are not full !";
} elseif(empty($hp)) {
echo "The fields are not full !";
} elseif(empty($beskrivelse)) {
echo "The fields are not full !";
} elseif(empty($server)) {
echo "The fields are not full !";
} else {
mysql_query("INSERT INTO cw (modstander, beskrivelse, server, tid, dag, dato, month, hp) VALUES ('$modstander', '$beskrivelse', '$server', '$tid', '$dag', '$dato', '$month', '$hp')") or (die mysql_error));
echo "Your Clan-War got createt";
}
}
echo '
<form method="post" action="newpcw.php?tjek=true">
<div align="center">Enemy:<br>
<input type="text" name="modstander" style="background-color: #99CCCC">
<br>Server:<br>
<input type="text" name="server" style="background-color: #99CCCC">
<br>
Enemy Homepage:<br>
<input type="text" name="hp" style="background-color: #99CCCC">
<br>Clock:<br>
<select name="tid" style="background-color:#99CCCC">
<option>01:00 AM</option>
<option>02:00 AM</option>
<option>03:00 AM</option>
<option>04:00 AM</option>
<option>05:00 AM</option>
<option>06:00 AM</option>
<option>07:00 AM</option>
<option>08:00 AM</option>
<option>09:00 AM</option>
<option>10:00 AM</option>
<option>11:00 AM</option>
<option>12:00 AM</option>
<option>01:00 PM</option>
<option>02:00 PM</option>
<option>03:00 PM</option>
<option>04:00 PM</option>
<option>05:00 PM</option>
<option>06:00 PM</option>
<option>07:00 PM</option>
<option>08:00 PM</option>
<option>09:00 PM</option>
<option>10:00 PM</option>
<option>11:00 PM</option>
<option>12:00 PM</option>
</select>
<br>Day:<br>
<select name="dag" style="background-color:#99CCCC">
<option>Monday</option>
<option>Tuesday</option>
<option>Wednesday</option>
<option>Thursday</option>
<option>Friday</option>
<option>Saturday</option>
<option>Sunday</option>
</select>
<br>Month:<br>
<select name="month" style="background-color:#99CCCC">
<option>January</option>
<option>February</option>
<option>March</option>
<option>April</option>
<option>May</option>
<option>June</option>
<option>July</option>
<option>August</option>
<option>September</option>
<option>October</option>
<option>November</option>
<option>December</option>
</select>
<br>Date:<br>
<select name="dato" style="background-color:#99CCCC">
<option>1.</option>
<option>2.</option>
<option>3.</option>
<option>4.</option>
<option>5.</option>
<option>6.</option>
<option>7.</option>
<option>8.</option>
<option>9.</option>
<option>10.</option>
<option>11.</option>
<option>12.</option>
<option>13.</option>
<option>14.</option>
<option>15.</option>
<option>16.</option>
<option>17.</option>
<option>18.</option>
<option>19.</option>
<option>20.</option>
<option>21.</option>
<option>22.</option>
<option>23.</option>
<option>24.</option>
<option>25.</option>
<option>26.</option>
<option>27.</option>
<option>28.</option>
<option>29.</option>
<option>30.</option>
<option>31.</option>
</select>
<br>Description:<br>
<textarea name="beskrivelse" cols="30" rows="6" style="background-color:#99CCCC"></textarea>
<br>
<input type="submit" value="Create" style="background-color:#99CCCC">
<br>';
} elseif($row['status'] == "User") {
echo "<b>Error</b><br><br>
You are logget on at the status User :s";
}
} else {
echo "<b>Error</b>
<br><br> You are not logged on :s";
}
?>
</div>
</div>
</div>
</body>
</html>
Håber det virker!