I really can't find my error this time :queasy:
This is the full errormessage:
Parse error: parse error, unexpected $ in /home/tla/public_html/test/ranks.php on line 76
I tried to remove allt he includes so very sure the error must be in this file.
I hope sm can help me. :glare:
<?php
/*
$level="root";
include '../connect.php';
include '../verify.php';
include 'verifyadmin.php';
include 'header.php';
*/
echo "fjioewafj";
function show_search_form(){
$form="<form action=ranks.php method=post>
Username: <input name=target><br>
<input type=submit name=search value='Edit Rank'>
</form>";
return $form;
}
function show_edit_form($target){
$form="";
$result=mysql_query("SELECT farmadmin,mstatadmin FROM users WHERE username='$target'");
$row=mysql_fetch_array($result);
if(mysql_num_rows($result)==0){
//cant find user
}else{
$form = "Username: $target";
$form .= "<form action=ranks.php method=post>";
$form .= "<input type=hidden name=target value=$target >";
if($row['farmadmin']=='y'){
$form .= "Farm admin: <input type=check name=farmadmin value=y checked>";
}else{
$form .= "Farm admin: <input type=check name=farmadmin value=y>";
}
if($row['mstatadmin']=='y'){
$form .= "M-Stat admin: <input type=check name=mstatadmin value=y checked>";
}else{
$form .= "M-Stat admin: <input type=check name=mstatadmin value=y>";
}
$form .= "<input type=submit value='Change rank' name=updaterank>";
return $form;
}
function update_rank($target,$farmadmin,$mstatadmin){
mysql_query("UPDATE users SET farmadmin='$farmadmin',mstatadmin='$mstatadmin' WHERE username='$target'");
//success messagebox
$message="";
return $message;
}
if(!isset($_POST['search']) && !isset($_POST['updaterank'])){
echo show_search_form();
}
if($search){
echo show_edit_form($_POST['target']);
}
if($updaterank){
$mstatadmin=$_POST['mstatadmin'];
$farmadmin=$_POST['farmadmin'];
$target=$_POST['target'];
echo update_rank($target,$farmadmin,$mstatadmin);
}
?>
<?
echo "blabla";
mysql_close('$link');
include '../bottom.php';
?>