Jump to content

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in C:\xampp\htdoc


Danny620

Recommended Posts

Warning: Unexpected character in input: '\' (ASCII=92) state=1 in C:\xampp\htdocs\report.php on line 27

 

Parse error: parse error, expecting `','' or `';'' in C:\xampp\htdocs\report.php on line 29

 

<?php require('config.php'); ?>
<link href="css/testting.css" rel="stylesheet" type="text/css" />
<table width="612" height="60" border="0" align="center" cellpadding="0" cellspacing="0">
  <!--DWLayoutTable-->
  <tr>
    <td height="27" colspan="3" valign="top" class="top_table">Alliance</td>
  </tr>
  <tr>
    <td width="200" height="33" valign="top" class="table_bottom">k</td>
    <td width="206" valign="top" class="table_bottom">k</td>
    <td width="206" valign="top" class="table_bottom"><label>k</label></td>
  </tr>
</table>
<?php 

if (!$_GET[clan]) {
//we select id and username of everyone except us
$q = "SELECT inviteid, clan FROM invite WHERE username='$user[username]'";
$r = mysqli_query ($dbc, $q);
while ($alliance = mysqli_fetch_array($r)) {
//we show all selected users as well as link to their "attack" subpage
echo "<table width=\"612\" height=\"33\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
  <!--DWLayoutTable-->
  <tr>
    <td height=\"33\" valign=\"top\" class=\"table_bottom\">$alliance[clan]</td>
    <td valign=\"top\" class=\"table_bottom\"><a href=\"report.php?accept=\".$alliance[inviteid].\"\">accept</a></td>
    <td valign=\"top\" class=\"table_bottom\"><a align=\"right\"><a href=\"report.php?decline=\".$alliance[inviteid]."\">decline</a></td>
  </tr>
</table>";
}

}
if (!$_GET[report]) {
//we select id and username of everyone except us
$q = "SELECT username, outcome, messageid FROM reports WHERE id='$user[id]'";
$r = mysqli_query ($dbc, $q);
echo '<table width="400" border="0" align="center">';
while ($report = mysqli_fetch_array($r)) {
//we show all selected users as well as link to their "attack" subpage
echo "<tr>
    <td>$report[username]</td>
<td>$report[outcome]</td>
    <td><a href=\"report.php?report=".$report[messageid]."\">Read Report</a></td>
<td><a href=\"report.php?reportd=".$report[messageid]."\">Delete Report</a></td>
  </tr>";
}
echo '</table>';
}

//if user selected link to attack player
if ($_GET[report]) {
$report = $_GET[report]; 
//we check if ID submited is numerical
if (!is_numeric($report)) { die("Bad target ID!"); }
//we select user with that ID
$q = "SELECT * FROM reports WHERE id='$user[id]' && messageid = '$report' LIMIT 1";
$r = mysqli_query ($dbc, $q);
$reportcheck = mysqli_num_rows($r);
//we check that rows are 1. if there are zero rows this means user is modifying link so we close our script!
if ($reportcheck <> 1) { die("Bad target ID!"); }
//all is fine, we select attacked user
echo '<table width="400" border="0" align="center">';
while ($report = mysqli_fetch_array($r)) {
//we show all selected users as well as link to their "attack" subpage
echo "<tr>
    <td>$report[username]</td>
<td>$report[message]</td>
    <td>$report[outcome]</td>
  </tr>";
}
echo '</table>';
}

if ($_GET[reportd]) {
$deletereport = $_GET[reportd];
$q = "SELECT * FROM reports WHERE messageid='$deletereport'";
$r = mysqli_query($dbc, $q);
$usercheck = mysqli_fetch_array($r);
if($usercheck[id] !== $user[id]){die("You do not have acess to this report"); }
$q = "DELETE FROM reports WHERE messageid='$deletereport'";
$r = mysqli_query($dbc, $q);
echo "Report deleted";
$url = 'report.php'; // Define the URL:
		ob_end_clean(); // Delete the buffer.
		header("Location: $url");
		exit(); // Quit the script.
}

if ($_GET[accept]) {
$accept = $_GET[accept];
$q = "SELECT * FROM invite WHERE username='$user[username]' && inviteid='$accept'";
$r = mysqli_query($dbc, $q);
$usercheck = mysqli_fetch_array($r);
if($user[clan] !== 'false'){die("You are already in and alliance if you wish to join this alliance please leave your current one");}
if($usercheck[username] !== $user[username]){die("You are not invited to this alliance"); }else{
$q = "UPDATE test SET clan='$usercheck[clan]' WHERE id='$user[id]'";
$r = mysqli_query($dbc, $q);
$q = "INSERT INTO clan (users,clan,admin) VALUES ('$user[username]','$usercheck[clan]','user')";
$r = mysqli_query($dbc, $q);
$q = "DELETE FROM invite WHERE inviteid='$usercheck[inviteid]'";
$r = mysqli_query($dbc, $q);
echo "You are now in the clan $usercheck[clan]";
$url = 'alliance.php'; // Define the URL:
		ob_end_clean(); // Delete the buffer.
		header("Location: $url");
		exit(); // Quit the script.
}
}

if ($_GET[decline]) {
$decline = $_GET[decline];
$q = "SELECT * FROM invite WHERE username='$user[username]' && inviteid='$decline'";
$r = mysqli_query($dbc, $q);
$usercheck = mysqli_fetch_array($r);
if($usercheck[username] !== $user[username]){die("You can not delecte somebody elses invite"); }else{
$q = "DELETE FROM invite WHERE inviteid='$usercheck[inviteid]'";
$r = mysqli_query($dbc, $q);
$url = 'report.php'; // Define the URL:
		ob_end_clean(); // Delete the buffer.
		header("Location: $url");
		exit(); // Quit the script.
}
}
include('include/footer.html');
?>

echo "<table width=\"612\" height=\"33\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">
  <!--DWLayoutTable-->
  <tr>
    <td height=\"33\" valign=\"top\" class=\"table_bottom\">".$alliance['clan']."</td>
    <td valign=\"top\" class=\"table_bottom\"><a href=\"report.php?accept=".$alliance['inviteid']."\">accept</a></td>
    <td valign=\"top\" class=\"table_bottom\"><a align=\"right\"><a href=\"report.php?decline=".$alliance['inviteid']."\">decline</a></td>
  </tr>
</table>";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.