PDA

View Full Version : What's with this!


DrewM
03-17-2006, 07:54 PM
Well I was making a page where you could add pages to the data base and I get the error:
Parse error: parse error, unexpected $ in /home/rdsx667/public_html/Admin.php on line 68
The code is:

<?php
// ####################### SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);

// #################### DEFINE IMPORTANT CONSTANTS #######################
define('NO_REGISTER_GLOBALS', 1);
define('THIS_SCRIPT', 'Adminpages');

// ################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array();

$specialtemplates = array();

// pre-cache templates used by all actions
$globaltemplates = array(
'site_admin_add',
);

$actiontemplates = array();

// ######################### REQUIRE BACK-END ############################
chdir('/home/rdsx667/public_html/forum/');
require_once('./global.php');

// ################################################## #####################
// ######################## START MAIN SCRIPT ############################
// ################################################## #####################

$navbits = array();
$navbits[$parent] = admin;

$navbits = construct_navbits($navbits);
eval('$navbar = "' . fetch_template('navbar') . '";');

// ################ SHOW NO PERMISSION PAGE TO GUESTS ####################

if (!is_member_of($vbulletin->userinfo, 11) AND !is_member_of($vbulletin->userinfo, 6))
{
print_no_permission();
}

// ########################### ADD THE SITE ##############################

if ($_REQUEST['do'] == "add")
{
eval('print_output("' . fetch_template('site_admin_add') . '");');
}

if ($_REQUEST['save'] == "add")
{
//------------------------------------------------------------
// Add the site to the database if everything is ok.
//------------------------------------------------------------
// Sanitize User Submitted Data
$vbulletin->input->clean_array_gpc('p', array(
'name' => TYPE_STR,
'description' => TYPE_STR
));

$sql = "INSERT INTO " . TABLE_PREFIX . "page
name='".$db->escape_string($vbulletin->GPC['name'])."',
edit_by='".$db->escape_string($vbulletin->userinfo['username'])."',
status='1',
contents='".$db->escape_string($vbulletin->GPC['description'])."';
$db->query_write($sql);
}
?>

And also thank u!

Code Monkey
03-17-2006, 08:32 PM
Try this


$sql = "INSERT INTO " . TABLE_PREFIX . "page
name = '".$db->escape_string($vbulletin->GPC['name'])."',
edit_by = '".$db->escape_string($vbulletin->userinfo['username'])."',
status = 1,
contents = '".$db->escape_string($vbulletin->GPC['description'])."'";