close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Passing Session Variables - Help?

Thread began 4/27/2009 4:23 am by phil.evans372967 | Last modified 4/28/2009 5:10 am by phil.evans372967 | 5048 views | 7 replies


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

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'); ?>
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";
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
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);?>
// 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" "">
<html xmlns="">
<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" />


<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">
<th class="WADADataTableHeader">img_id:</th>
<td class="WADADataTableCell"></td>
<th class="WADADataTableHeader">img_thumb:</th>
<td class="WADADataTableCell"><input type="text" name="img_thumb" id="img_thumb" value="" size="32" /></td>
<th class="WADADataTableHeader">img_main:</th>
<td class="WADADataTableCell"><input type="text" name="img_main" id="img_main" value="" size="32" /></td>
<th class="WADADataTableHeader">prop_id:</th>
<td class="WADADataTableCell"><?php echo $row_Recordset1['prop_id']; ?></td>
<th class="WADADataTableHeader">prop_ref:</th>
<td class="WADADataTableCell"><?php echo $row_Recordset1['prop_ref']; ?></td>
<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">
<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>
<input name="WADAInsertRecordID" type="hidden" id="WADAInsertRecordID" value="" />

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...