Insert/Edit Image not working
For some reason, I have lost the ability to upload images through the editor. The upload button has disappeared and I don't know why.
I have an error:
Notice: Use of undefined constant php - assumed 'php' in \\NAS37ENT\domains\e\ewguk.com\user\htdocs\_admin\news\tbl_news_Update.php on line 128
Line 128 is:
<?php?>
And it sits in this block of code:
<?php
$Paramfld_id_WADAtbl_news = "-1";
if (isset($_GET['fld_id'])) {
$Paramfld_id_WADAtbl_news = (get_magic_quotes_gpc()) ? $_GET['fld_id'] : addslashes($_GET['fld_id']);
}
mysql_select_db($database_con_evo, $con_evo);
$query_WADAtbl_news = sprintf("SELECT fld_id, fld_division, fld_image, fld_headline, fld_intro, fld_content, fld_show FROM tbl_news WHERE fld_id = %s", GetSQLValueString($Paramfld_id_WADAtbl_news, "int"));
$WADAtbl_news = mysql_query($query_WADAtbl_news, $con_evo) or die(mysql_error());
$row_WADAtbl_news = mysql_fetch_assoc($WADAtbl_news);
$totalRows_WADAtbl_news = mysql_num_rows($WADAtbl_news);?>
<?php
$maxRows_WADADynListtbl_division = 1000;
$pageNum_WADADynListtbl_division = 0;
if (isset($_GET['pageNum_WADADynListtbl_division'])) {
$pageNum_WADADynListtbl_division = $_GET['pageNum_WADADynListtbl_division'];
}
$startRow_WADADynListtbl_division = $pageNum_WADADynListtbl_division * $maxRows_WADADynListtbl_division;
mysql_select_db($database_con_evo, $con_evo);
$query_WADADynListtbl_division = "SELECT fld_id, fld_division FROM tbl_division ORDER BY fld_division";
$query_limit_WADADynListtbl_division = sprintf("%s LIMIT %d, %d", $query_WADADynListtbl_division, $startRow_WADADynListtbl_division, $maxRows_WADADynListtbl_division);
$WADADynListtbl_division = mysql_query($query_limit_WADADynListtbl_division, $con_evo) or die(mysql_error());
$row_WADADynListtbl_division = mysql_fetch_assoc($WADADynListtbl_division);
if (isset($_GET['totalRows_WADADynListtbl_division'])) {
$totalRows_WADADynListtbl_division = $_GET['totalRows_WADADynListtbl_division'];
} else {
$all_WADADynListtbl_division = mysql_query($query_WADADynListtbl_division);
$totalRows_WADADynListtbl_division = mysql_num_rows($all_WADADynListtbl_division);
}
$totalPages_WADADynListtbl_division = ceil($totalRows_WADADynListtbl_division/$maxRows_WADADynListtbl_division)-1;?>
<?php
// WA_UploadResult1 Params Start
$WA_UploadResult1_Params = array();
// WA_UploadResult1_1 Start
$WA_UploadResult1_Params["WA_UploadResult1_1"] = array(
'UploadFolder' => "../../_dataimages/",
'FileName' => "[FileName]",
'DefaultFileName' => "".((isset($_POST["fld_image"]))?$_POST["fld_image"]:"") ."",
'ResizeType' => "0",
'ResizeWidth' => "0",
'ResizeHeight' => "0",
'ResizeFillColor' => "" );
// WA_UploadResult1_1 End
// WA_UploadResult1 Params End
?>
<?php?> <<<<<---------------------------------------------////////////
<?php
WA_DFP_SetupUploadStatusStruct("WA_UploadResult1");
if($_SERVER["REQUEST_METHOD"] == "POST"){
WA_DFP_UploadFiles("WA_UploadResult1", "fld_image2", "0", "", "false", $WA_UploadResult1_Params);
}
?>
<?php
// WA Application Builder Update
if (isset($_POST["Update"])) // Trigger
{
$WA_connection = $con_evo;
$WA_table = "tbl_news";
$WA_redirectURL = "tbl_news_Detail.php?fld_id=".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"") ."";
$WA_keepQueryString = false;
$WA_indexField = "fld_id";
$WA_fieldNamesStr = "fld_division|fld_image|fld_headline|fld_intro|fld_content|fld_show";
$WA_fieldValuesStr = "".((isset($_POST["fld_division"]))?$_POST["fld_division"]:"") ."" . "|" . "".$WA_DFP_UploadStatus["WA_UploadResult1"]["serverFileName"] ."" . "|" . "".((isset($_POST["fld_headline"]))?$_POST["fld_headline"]:"") ."" . "|" . "".((isset($_POST["fld_intro"]))?$_POST["fld_intro"]:"") ."" . "|" . "".((isset($_POST["fld_content"]))?$_POST["fld_content"]:"") ."" . "|" . "".((isset($_POST["fld_show"]))?$_POST["fld_show"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_comparisonStr = "=|=|=|=|=|=";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_where_fieldValuesStr = "".((isset($_POST["WADAUpdateRecordID"]))?$_POST["WADAUpdateRecordID"]:"") ."";
$WA_where_columnTypesStr = "none,none,NULL";
$WA_where_comparisonStr = "=";
$WA_where_fieldNames = explode("|", $WA_indexField);
$WA_where_fieldValues = explode("|", $WA_where_fieldValuesStr);
$WA_where_columns = explode("|", $WA_where_columnTypesStr);
$WA_where_comparisons = explode("|", $WA_where_comparisonStr);
$WA_connectionDB = $database_con_evo;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$updateParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WhereObj = WA_AB_generateWhereClause($WA_where_fieldNames, $WA_where_columns, $WA_where_fieldValues, $WA_where_comparisons );
$WA_Sql = "UPDATE `" . $WA_table . "` SET " . $updateParamsObj->WA_setValues . " WHERE " . $WhereObj->sqlWhereClause . "";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
What's going on here then?