Error In Syntax
Posted on
16th Feb 2014 07:03 pm by
admin
I got this error:
Code: Parse error: syntax error, unexpected '>' in /home/bucket/public_html/inc/func.ban.php on line 56
<?php
error_reporting(E_ALL);
ini_set('display_errors', '1');
// func.ban.php
// checks the ip to see if it is banned
function checkban($ip)
{
// querys database
$q = mysql_query("SELECT * FROM `banned` WHERE `ip` = '$ip' LIMIT 1");
$get = mysql_num_rows($q);
// if found
if ($get == "1")
{
// deny user access
$r=mysql_fetch_array($q);
die("You have been banned from this website for $r[reason].");
}
}
// places a ban in the database
function addban($ip,$reason,$legnth)
{
// get current time
$time = time();
// inserts code into database
$insert = mysql_query("INSERT INTO `banned` (`ip`,`time`,`long`,`reason`) VALUES ('$ip', '$time', '$legnth', '$reason')") or die("Could not add ban.<br />".mysql.error()."");
echo "The ip address, $ip, has been added to the ban list.";
}
// deletes a ban from the database
function delban($id)
{
// runs a delete query
$delete = mysql_query("DELETE FROM `banned` WHERE `id` = '$id' LIMIT 1") or die("Could not remove ban.<br />".mysql.error()."");
echo "The ip address has been removed from the ban list.";
}
// lists the bans in the ban admin
function listbans()
{
// link to add ban
echo "<a href='accounts-banned.php?x=add'>Add Ban</a><p>";
echo "<table class="gridtable">
<thead>
<tr>
<th scope="col" align="center">IP Address</th>
<th scope="col" align="center">Reason</th>
<th scope="col" align="center">Legnth</th>
</tr>
</thead><tbody>";
// loop to show all band
$query = mysql_query("SELECT * FROM `banned` ORDER BY time DESC");
$num = mysql_num_rows($query);
if ($num)
{
while ($r=mysql_fetch_array($query))
{
echo "<tr align="center">;
echo "<td>$r[ip]</td>";
echo "<td>$r[reason]</td>";
echo "<td><a href='accounts-banned.php?x=delete&id=$r[id]'>Delete</a></td>";
echo "</tr>;
}
}
echo "</tbody></table>";
}
?>
Line 56 is:
echo "<td>$r[ip]</td>";
Whats the problem?
No comments posted yet
Your Answer:
Login to answer
96
45
Other forums
curl javascript problem
Hi Experts.
I'm new curl and wanna to get some info from this http://www.amadeus.net/
when
Login page problems
I developed a website a few months ago and I am now having an issue with logging into it. The place
data type in column definition
Hi,
I create a table with column called "Direction of Travel code ".
The travel codes in t
try catch error
I have been trying try catch but, I can't get it to work. The code opens a non existing file called
Can't find a decent web analytics!!!
I've downloaded and installed Piwik. It's location detection based on IP addresses is fairly inaccur
Serial number of exernal hard disk/Thumbdrive
Hi guys,
I am new tio java networking concepts.Please tel me how to get Serial
number of exernal
SAP Management Console is blank
Dear All ,
I am facing problem in my des sever suddely in SAP Management Console is blank and
how do i display data on a page from mysql
1 - do i use this code at the top of each of my page i wish to only alow access if there as been a s
Date/Time and Checkbox
Hi Everyone,
I am trying to figure out how to insert the current date and tim
Dynamic Array using glob?
Is there an easier way to do this?
I am trying to get create a dyamic array based on files wi