vengefuldeath87
01-30-2007, 11:28 PM
Ive just upgraded from 3.6.3 to 3.6.4, and now my custom admin page has stopped working totally.
<?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();
$con = mysql_connect("localhost","u","p");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db", $con);
// some code
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminusers'))
{
print_cp_no_permission();
}
$name = $_POST['inputname'];
if($name) {
$result = mysql_query("SELECT * FROM lacn where username='".$name."'",$con);
if (mysql_num_rows($result) == 1) {
$result = mysql_query("delete from lacn where username='".$name."'",$con);
print_description_row('Removed '.$name);
} else {
print_description_row('User '.$name.' was not found.');
}
}
mysql_close($con);
print_cp_header($vbphrase['FAdmin']);
print_form_header('fadmin');
print_table_header('Delete User');
print_input_row('Enter Name to remove:', 'inputname');
print_submit_row("Submit!", 0);
print_cp_footer();
?>
I cant even get anything to output from the code, and the $_POST has stopped working.
Just to add, the db stuff connects to a different db, not the vbulletin one.
<?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();
$con = mysql_connect("localhost","u","p");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("db", $con);
// some code
// ######################## CHECK ADMIN PERMISSIONS #######################
if (!can_administer('canadminusers'))
{
print_cp_no_permission();
}
$name = $_POST['inputname'];
if($name) {
$result = mysql_query("SELECT * FROM lacn where username='".$name."'",$con);
if (mysql_num_rows($result) == 1) {
$result = mysql_query("delete from lacn where username='".$name."'",$con);
print_description_row('Removed '.$name);
} else {
print_description_row('User '.$name.' was not found.');
}
}
mysql_close($con);
print_cp_header($vbphrase['FAdmin']);
print_form_header('fadmin');
print_table_header('Delete User');
print_input_row('Enter Name to remove:', 'inputname');
print_submit_row("Submit!", 0);
print_cp_footer();
?>
I cant even get anything to output from the code, and the $_POST has stopped working.
Just to add, the db stuff connects to a different db, not the vbulletin one.