vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Unexpected $end (https://vborg.vbsupport.ru/showthread.php?t=109428)

Aesma Deva 03-04-2006 03:01 PM

Unexpected $end
 
Ok, today I was experimenting on adding stuff to the admin CP, and I made a simple script to see the results and if it'd work. Well, it didn't. I keep getting "Parse error: syntax error, unexpected $end in C:\wamp\www\vbe\admincp\ban_user.php on line 19". Here is the script (named "ban_user.php"):
Code:

<?php
// ######################## SET PHP ENVIRONMENT ###########################
error_reporting(E_ALL & ~E_NOTICE);
@set_time_limit(0);
 
// #################### PRE-CACHE TEMPLATES AND DATA ######################
$phrasegroups = array('style');
$specialtemplates = array('products');
 
// ########################## REQUIRE BACK-END ############################
require_once('./global.php');
require_once(DIR . '/includes/adminfunctions_template.php');
 
print_cp_header();
echo "<form action='ban_user.php' method='post'><input type='hidden' value='ban' name='do' />Ban user:<br /><input type='text' name='toban' length='155' /><br /><input type='submit' value='Submit' /></form>";
if ($_POST["do"]=="ban")
mysql_array("UPDATE " . TABLE_PREFIX . "user SET usergroupid='8' WHERE username='" . $_POST["toban"] . "');
print_cp_footer();
?>

What is wrong with the "?>" there?
Thanks in advance.

merk 03-05-2006 03:03 AM

The code run by the conditional should be surrounded by curley braces. (Not necessary but strongly recommended)

if (condition)
{
code
}

Other than that, your code looks like it should work (regardless of how you're using " in unnecessary spots)

Aesma Deva 03-05-2006 06:53 AM

Still, it doesn't work. I'll try making the HTML with the functions VB provides.
Though, where are the " unnecessary?


All times are GMT. The time now is 12:05 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01395 seconds
  • Memory Usage 1,711KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete