Jump to content

T_CONSTANT_ENCAPSED_STRING


adamjones

Recommended Posts

Hi. Having a problem with this script, and I can't see any errors in it... seem to have all my semi-colons, brackets and speech marks :S

 

<?php

session_start();

require_once('config.php');
$link = mysql_connect(DB_HOST, DB_USER, DB_PASSWORD);
if(!$link) {
	die('Failed to connect to server: ' . mysql_error());
}
$db = mysql_select_db(DB_DATABASE);
if(!$db) {
	die("Unable to select database");
}

function clean($str) {
	$str = @trim($str);
	if(get_magic_quotes_gpc()) {
		$str = stripslashes($str);
	}
	return mysql_real_escape_string($str);
}

$qry="SELECT * FROM fuse_rights WHERE username='".$_SESSION['username']."'";
$result=mysql_query($qry);

if($result) {
	if(mysql_num_rows($result) == 1) {

		$checks = mysql_fetch_assoc($result);
		$hk = $checks['housekeeping'];
		$comp = $checks['competitions'];
		$news = $checks['news'];
		$events = $checks['events'];
		$twitter = $checks['twitter'];
		$forum = $checks['forum_admin'];
		$pages = $checks['pages'];
		$users = $checks['users'];
		$settings = $checks['settings'];
		$bans = $checks['bans'];			
		}
		}

if(isset($_SESSION['username']) && $hk == 0)
{ $errflag = true;
	$errmsg_arr[] = 'You do not have access to the Intra.';
	if($errflag) {
	$_SESSION['ERRMSG_ARR'] = $errmsg_arr;
	session_write_close();
	header("location: ./error");
}
}
if(isset($_SESSION['username']) && $users == 0)
{ header("location: ./dash");
}

$uname=$_GET['uname'];
$badge=$_GET['badge'];

$sql="DELETE FROM badges WHERE username='$uname' AND badge='$badge'";
$result=mysql_query($sql);

if($result){

$errflag = true;
	$errmsg_arr[] = '<div id="message-success" class="message message-success">
							<div class="image">
								<img src="resources/images/icons/success.png" alt="Success" height="32" />
							</div>
							<div class="text">
								<h6>Success</h6>
								<span>Badge removed.</span>
							</div>
							<div class="dismiss">
								<a href="#message-success"></a>
							</div>
						</div>';
	if($errflag) {
	$_SESSION['ERRMSG_ARR5'] = $errmsg_arr;
	session_write_close();
	header("location: ./edit_user?username=".$uname"#box-badges");
}
}
?>

 

Error is;

 

"Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/habhubc/public_html/intra/update_remove_badge.php on line 80"

 

Thanks!

Link to comment
https://forums.phpfreaks.com/topic/201422-t_constant_encapsed_string/
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.