Gimli
Mitglied
Ich versteh nicht das Problem! In meiner change_rank.php ist ein kleiner Ajax Script, der auch funktioniert, aber die Funktion change() wird irgendwie nicht aufgerufen wenn ich auf den button klicke! Híer mal der Code:
PHP:
<?php
require_once("../config/config.ini.php");
require_once("../config/checklogin.php");
require_once("../functions/whoisonline.php");
$sql = mysql_query("SELECT * FROM ".$dbfront."users WHERE id = ".$_GET['id']."");
$user = mysql_fetch_object($sql);
$name = stripslashes($user->name);
$zeit = $user->zeit;
$avatar = $user->avatar;
$email = $user->email;
$rank = $user->rank;
$banned = $user->banned;
$vname = $user->vname;
$nname = $user->nname;
$age = $user->age;
$active = $user->active;
$description = $user->description;
?>
<!DOCTYPE html>
<html>
<head>
<title>Rang von <?=$name?> ändern</title>
<?
require_once("../config/meta.php");
?>
<style type="text/css" media="screen">
@import url("../style.css");
</style>
<script type="text/javascript">
// <![CDATA[
var XMLHTTP = null;
if(window.XMLHttpRequest) {
XMLHTTP = new XMLHttpRequest();
}
else if(window.ActiveXObject) {
try {
XMLHTTP = new ActiveXObject("Msxml2.XMLHTTP");
} catch (ex) {
try {
XMLHTTP = new ActiveXObject("Microsoft.XMLHTTP");
} catch(ex) {
}
}
}
function DatenAusgeben() {
if(XMLHTTP.readyState == 4) {
var d = document.getElementById("resp");
d.innerHTML += XMLHTTP.responseText;
document.getElementById("resp").style.display = "";
}
}
function change {
XMLHTTP.open("GET", "change.php?form=rank&id="+document.getElementsByName('id').value+"&rank="+document.getElementsByName('rank').value+"", true);
XMLHTTP.onreadystatechange = DatenAusgeben;
XMLHTTP.send(null);
}
// ]]>
</script>
</head><body _texified="true">
<div id="wrapper">
<div id="header"></div>
<div id="nav">
<div id="navlinks">
<?php
include("../navigation/ebene2/nav.php");
?>
</div>
</div>
<div class="spacer"></div>
<div style="width:154px;margin-left:15px;border-bottom:1px solid #000;"></div>
<div id="leftnav">
<a href="../index.php" class="left">Startseite</a>
<a href="../modules/stats/index.php" class="left_on">Statistiken</a>
<a href="../support.php" class="left">Support</a>
</div>
<div id="con">
<h1>Rang von <?=$name?> ändern</h1>
<p>
<fieldset id="resp" style="display:none;">
</fieldset>
<form method="post">
<fieldset>
<select name="rank" style="width:100px;">
<?php
$sql = mysql_query("SELECT * FROM ".$dbfront."ranks");
while($ranks = mysql_fetch_object($sql)) {
$rank = $ranks->rank;
?><option value="<?=$rank?>"><?=$rank?></option>
<? } ?>
</select>
<input type="hidden" name="form" value="rank">
<input type="hidden" name="id" value="<?=$_GET['id']?>">
<input type="button" onClick="change()" value="Ändern">
</fieldset>
</form>
</p>
</div>
<div style="clear:both;overflow:hidden;height:1px;"></div>
<div style="position:absolute;bottom:40px;z-index:2;margin-left:15px;height:1px;width:154px;border-top:1px solid #000;"></div>
<div class="spacer" style="position:absolute;bottom:21px;"></div>
<?php
include("../navigation/ebene2/bot.php");
?>
</div>
</body>
</html>