Jump to content

banning script error


silverglade

Recommended Posts

Hi I am having fun making this little banning script, and it gives me the following error,

 

Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /hermes/bosweb/web173/b1739/public_html/banner.php on line 39

 

I cannot find what is wrong. please any help is greatly appreciated. Below is the code.

 

<?php
session_start(); 

ini_set ("display_errors", "1");
error_reporting(E_ALL);
$host		= " xxx";
$database 	= " xxx";
$username 	= " xxx";
$password 	= " xxx";

$tbl_name   = "members";
$conn = mysql_connect($host, $username, $password) or die("Could not connect: " . mysql_error());

if($conn)
{
mysql_select_db($database);
} else {
	echo "failed to select database";
}	   

$ip = mysql_real_escape_string($_POST['banip']);
$unbanip = mysql_real_escape_string($_POST['unbanip']);
$banned=0;
$unbanned=0;
$message="-";
				//THE BANNER SCRIPT PART

				if($_POST['submit'])
				{

					 mysql_query("INSERT INTO members (banned) VALUES ('$ip')"); 

			           $banned=1;
					` $message="You have banished ";

				}

		///////////////THE UNBANNER PART

				if($_POST['submit2'])
				{

		         mysql_query("DELETE FROM members WHERE  banned = '$unbanip'");

				$unbanned=1;
				 $message="You have unbanned this lucky SOB!!";
				} 









?>		 
<html>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
</head>
<style type="text/css">
<!--
.style1 {
color: #00CC66;
font-weight: bold;
font-size: larger;
}
.style2 {
color: #FF3300;
font-weight: bold;
font-size: larger;
}
-->
</style>
<body>
        
<form id="banip" method="post" action="banip.php">
  <p> 		  </p>
				   <p> </p>
				   <p align="center"><span class="style2">  IP address to Ban</span> 
				     <input type="text" name="banip" id="banip"/>


				     <input name="submit" type="submit" id="submit" value="Ban  !"/> 
				     <input type="reset" id="reset" name="reset"/>
				      <br>
			    <?php 
				echo $message ;
				?>
				</p>
</form>



<p align="center"><span class="style1">  IP address to UNban</span> 
  <input type="text" name="unbanip" id="unbanip"/>
  <input name="submit2" type="submit" id="submit2" value="Unban !!"/>
  <input type="reset" id="reset2" name="reset2"/>
</p>
</body>
</html>

Link to comment
https://forums.phpfreaks.com/topic/246597-banning-script-error/
Share on other sites

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.