my 'redesigned' one as follows:
<?php include "header2.php";
include('../Connections/POOLTIME.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "ADD_CHARACTER")) {
$insertSQL = sprintf("INSERT INTO persona (persona_user_id, persona_name, persona_gender, persona_age, persona_birthdate, persona_birthmonth, persona_birthplace, persona_type, persona_type2, persona_deathturn, persona_deathmonth, persona_deathday, persona_species, persona_species_char, persona_birthplace_alt, persona_mother, persona_mother_rank, persona_father, persona_father_rank, persona_siblings, persona_history, persona_sexor, persona_relstat, persona_spouse, persona_children, persona_height, persona_height2, persona_weight, persona_eye, persona_hair, persona_appear_dscrptn, persona_prsnlt_dscrptn, persona_rank, persona_hobbies, persona_stat, persona_curloc, persona_submitted, persona_modified, persona_approved, persona_voc1_craft, persona_voc1_rank, persona_voc1_specialty, persona_extra) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['PERSONA_USER_ID'], "int"),
GetSQLValueString($_POST['PERSONA_NAME'], "text"),
GetSQLValueString($_POST['PERSONA_GENDER'], "text"),
GetSQLValueString($_POST['PERSONA_AGE'], "int"),
GetSQLValueString($_POST['PERSONA_BIRTHDATE'], "text"),
GetSQLValueString($_POST['PERSONA_BIRTHMONTH'], "int"),
GetSQLValueString($_POST['PERSONA_BIRTHPLACE'], "text"),
GetSQLValueString($_POST['PERSONA_TYPE'], "text"),
GetSQLValueString($_POST['PERSONA_TYPE2'], "text"),
GetSQLValueString($_POST['PERSONA_DEATHTURN'], "int"),
GetSQLValueString($_POST['PERSONA_BIRTHMONTH'], "int"),
GetSQLValueString($_POST['PERSONA_DEATHDAY'], "int"),
GetSQLValueString($_POST['PERSONA_SPECIES'], "text"),
GetSQLValueString($_POST['PERSONA_SPECIES_CHAR'], "text"),
GetSQLValueString($_POST['PERSONA_BIRTHPLACE_ALT'], "text"),
GetSQLValueString($_POST['PERSONA_MOTHER'], "text"),
GetSQLValueString($_POST['PERSONA_MOTHER_RANK'], "text"),
GetSQLValueString($_POST['PERSONA_FATHER'], "text"),
GetSQLValueString($_POST['PERSONA_FATHER_RANK'], "text"),
GetSQLValueString($_POST['PERSONA_SIBLINGS'], "text"),
GetSQLValueString($_POST['PERSONA_HISTORY'], "text"),
GetSQLValueString($_POST['PERSONA_SEXOR'], "text"),
GetSQLValueString($_POST['PERSONA_RELSTAT'], "text"),
GetSQLValueString($_POST['PERSONA_SPOUSE'], "text"),
GetSQLValueString($_POST['PERSONA_CHILDREN'], "text"),
GetSQLValueString($_POST['PERSONA_HEIGHT'], "text"),
GetSQLValueString($_POST['PERSONA_HEIGHT2'], "int"),
GetSQLValueString($_POST['PERSONA_WEIGHT'], "text"),
GetSQLValueString($_POST['PERSONA_EYE'], "text"),
GetSQLValueString($_POST['PERSONA_HAIR'], "text"),
GetSQLValueString($_POST['PERSONA_APPEAR_DSCRPTN'], "text"),
GetSQLValueString($_POST['PERSONA_PRSNLT_DSCRPTN'], "text"),
GetSQLValueString($_POST['PERSONA_RANK'], "text"),
GetSQLValueString($_POST['PERSONA_HOBBIES'], "text"),
GetSQLValueString($_POST['PERSONA_STAT'], "int"),
GetSQLValueString($_POST['PERSONA_CURLOC'], "text"),
GetSQLValueString($_POST['PERSONA_SUBMITTED'], "int"),
GetSQLValueString($_POST['PERSONA_MODIFIED'], "int"),
GetSQLValueString(strtotime($_POST['PERSONA_APPROVED']), "int"),
GetSQLValueString($_POST['PERSONA_VOC1_CRAFT'], "text"),
GetSQLValueString($_POST['PERSONA_VOC1_RANK'], "text"),
GetSQLValueString($_POST['PERSONA_VOC1_SPECIALTY'], "text"),
GetSQLValueString($_POST['PERSONA_EXTRA'], "text"));
mysql_select_db($database_POOLTIME, $POOLTIME);
$Result1 = mysql_query($insertSQL, $POOLTIME) or die(mysql_error());
$insertGoTo = "index2.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header2(sprintf("Location: %s", $insertGoTo));
}
$MMBR_USERINFO = "-1";
if (isset($_GET['edit_id'])) {
$MMBR_USERINFO = (get_magic_quotes_gpc()) ? $_GET['edit_id'] : addslashes($_GET['edit_id']);
}
mysql_select_db($database_POOLTIME, $POOLTIME);
$query_USERINFO = sprintf("SELECT * FROM member, user WHERE member.member_id = %s AND user.user_member_id = member.member_id", GetSQLValueString($MMBR_USERINFO, "int"));
$USERINFO = mysql_query($query_USERINFO, $POOLTIME) or die(mysql_error());
$row_USERINFO = mysql_fetch_assoc($USERINFO);
$totalRows_USERINFO = mysql_num_rows($USERINFO);
?>
<!-- End whizzy stuff -->
<!-- Start whizzy display stuff -->
then the several hundred lines of table/form code and then:
<!-- End whizzy display stuff -->
<?php include('footer2.php'); ?>
<?php
mysql_free_result($USERINFO);
?>
The error I get when i test the 'redesigned' one is
Fatal error: Call to undefined function: header2() in /home/******/public_html/member_admin/users_characters_add2.php on line 92
Line 92 is the
header2(sprintf("Location: %s", $insertGoTo));
but that gives me no clue as how to 'fix', I've tried several things (taking out/putting in) and realize of course that it has to do with the header call but I have no clue how to fix it.
(Connections/POOLTIME is essentially an 'includes' file that just has the db, dbuser and password in it.)
Any assistance would be appreciated. And yes I 'own' the original version, but the guy that wrote it for me is no longer available for me to poke for help.