Overskriften er lidt forkert fordi jeg har laet min topic om :-)
Alså jeg har en side som skal lave en option af alle funde resultater af userid X i databasens table. Men den laver ikke disse options :- /.
index.php:
<table width="800" border="0" align="center" cellpadding="0" cellspacing="0">
<tr background="images/content.png">
<td height="30" colspan="2"><span class="overskrift">FragHost - <strong>Restart</strong></span></td>
</tr>
<tr background="images/split.png">
<td height="6" colspan="2"></td>
</tr>
<tr valign="top" bgcolor="686868">
<td colspan="2" class="content"><p align="center">
<table id="Tabelle_01" width="800" height="400" border="0" cellpadding="0" cellspacing="0" align="center">
<tr>
<td>
<?php
$_SESSION['userid'] = $_POST['userid'];
if ($_POST['rcon']){
$IP=$_POST['serverip'];
$PORT=$_POST['serverport'];
require_once("rcon_code.php");
$COMMAND = "quit";
$srcds_rcon = new srcds_rcon();
$OUTPUT = $srcds_rcon->rcon_command($IP, $PORT, $_POST["rcon"], $COMMAND);
echo "<p align=center>" . $IP . ":" . $PORT . " - Var restarted</p>";
echo "<br><a href=http://www.fraghost.dk/>Tilbage til forsiden</a>";
mysql_close($con);
}
?>
<form action="<?php echo $_SERVER['PHP_SELF'] ?>" method="post">
Server:<br>
<SELECT NAME="serverip">
<OPTION SELECTED VALUE="">---------- Select din servers ip -----------
<?php include ("index_getserver"); ?>
</SELECT><br>
<SELECT NAME="serverport">
<OPTION SELECTED VALUE="">---------- Select din servers port -----------
<?php include ("index_getserver2"); ?>
</SELECT><br>
Rcon password:<br><input type="text" name="rcon" /><br /><input type="submit" name="submit" value="Restart"><br><hr>
</form>
</td>
</tr>
</table>
<br><br><br> <p align="center">Copyright © FragHost og Fraghost.dk<br>Intet tekst må
kopires uden tilladelse !<br>
<a href="http://www.fraghost.dk/betingelser.php">Handelsbetingelser</a></p>
</p>
<div class="wrote"><br>
</div></td>
</tr>
<tr>
<td height="1" colspan="2"></td>
</tr>
</table>
index_getserver.php:
<?php
session_start();
$con = mysql_connect("localhost","root","xxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("xxxx", $con);
$result = mysql_query("SELECT * FROM xxxxx WHERE userid='" . $_SESSION['userid'] . "'");
while($row = mysql_fetch_array($result))
{
echo "<option value=" . $row['serverip'] . ">" . $row['serverip'] . "</option>";
}
?>
index_getserver2.php:
<?php
session_start();
$con = mysql_connect("localhost","root","xxxxx");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("xxxx", $con);
$result = mysql_query("SELECT * FROM xxxxxx WHERE userid='" . $_SESSION['userid'] . "'");
while($row = mysql_fetch_array($result))
{
echo "<option value=" . $row['serverport'] . ">" . $row['serverport'] . "</option>";
}
?>
Nogle der ved hvorfor den ikke laver de options som er muelige fra databasen`?
Indlæg senest redigeret d. 04.08.2009 22:03 af Bruger #14614