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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.