Still no joy
Hi Ray
Thanks for your help.
I have added that the the top of my second page and still can't get the 2 session variables to display. I've spent 3 days on this now and I'm sure I'm doing something simple wrong, but can't see the wood for the trees.
My code now looks like this
<?php
if (!session_id()) session_start();
?>
<?php require_once("../Connections/prop.php"); ?>
<?php require_once("../WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php require_once('../Connections/prop.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;
}
}
$colname_Recordset1 = "-1";
if (isset($_SESSION['prop_id'])) {
$colname_Recordset1 = (get_magic_quotes_gpc()) ? $_SESSION['prop_id'] : addslashes($_SESSION['prop_id']);
}
mysql_select_db($database_prop, $prop);
$query_Recordset1 = sprintf("SELECT prop_id, prop_ref FROM prop_details WHERE prop_id = %s", GetSQLValueString($colname_Recordset1, "int"));
$Recordset1 = mysql_query($query_Recordset1, $prop) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);?>
<?php
// WA Application Builder Insert
if (isset($_POST["Insert_x"])) // Trigger
{
$WA_connection = $prop;
$WA_table = "prop_images";
$WA_sessionName = "WADA_Insert_prop_images";
$WA_redirectURL = "prop_images_Results.php";
$WA_keepQueryString = false;
$WA_indexField = "img_id";
$WA_fieldNamesStr = "img_thumb|img_main|prop_id|prop_ref";
$WA_fieldValuesStr = "".((isset($_POST["img_thumb"]))?$_POST["img_thumb"]:"") ."" . "|" . "".((isset($_POST["img_main"]))?$_POST["img_main"]:"") ."" . "|" . "".$row_Recordset1['prop_id'] ."" . "|" . "".$row_Recordset1['prop_ref'] ."";
$WA_columnTypesStr = "',none,''|',none,''|none,none,NULL|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_prop;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
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);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Insert prop_images</title>
<link href="../WA_DataAssist/styles/Refined_Pacifica.css" rel="stylesheet" type="text/css" />
<link href="../WA_DataAssist/styles/Arial.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="WADAInsertContainer">
<form action="prop_images_Insert.php" method="post" name="WADAInsertForm" id="WADAInsertForm">
<div class="WADAHeader">Insert Record</div>
<div class="WADAHorizLine"><img src="../WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<table class="WADADataTable" cellpadding="0" cellspacing="0" border="0">
<tr>
<th class="WADADataTableHeader">img_id:</th>
<td class="WADADataTableCell"></td>
</tr>
<tr>
<th class="WADADataTableHeader">img_thumb:</th>
<td class="WADADataTableCell"><input type="text" name="img_thumb" id="img_thumb" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">img_main:</th>
<td class="WADADataTableCell"><input type="text" name="img_main" id="img_main" value="" size="32" /></td>
</tr>
<tr>
<th class="WADADataTableHeader">prop_id:</th>
<td class="WADADataTableCell"><?php echo $row_Recordset1['prop_id']; ?></td>
</tr>
<tr>
<th class="WADADataTableHeader">prop_ref:</th>
<td class="WADADataTableCell"><?php echo $row_Recordset1['prop_ref']; ?></td>
</tr>
</table>
<div class="WADAHorizLine"><img src="../WA_DataAssist/images/_tx_.gif" alt="" height="1" width="1" border="0" /></div>
<div class="WADAButtonRow">
<table class="WADADataNavButtons" border="0" cellpadding="0" cellspacing="0">
<tr>
<td class="WADADataNavButtonCell" nowrap="nowrap"><input type="image" name="Insert" id="Insert" value="Insert" alt="Insert" src="../WA_DataAssist/images/Pacifica/Refined_insert.gif" /></td>
<td class="WADADataNavButtonCell" nowrap="nowrap"><a href="prop_images_Results.php" title="Cancel"><img border="0" name="Cancel" id="Cancel" alt="Cancel" src="../WA_DataAssist/images/Pacifica/Refined_cancel.gif" /></a></td>
</tr>
</table>
<input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="" />
</div>
</form>
</div>
</body>
</html>
<?php
mysql_free_result($Recordset1);
?>