DREAMWEAVER
DISCUSSION GROUP
old
post - new
thread - new
reply
28/05/12 01:57:33
RE: RE: Implode/Explode Multi Menu
It is.
Here is the code block:
// *** Implode multiple selection
if (isset($_POST["sr_profile_areas"]) && is_array($_POST["sr_profile_areas"])) {
$_POST["sr_profile_areas"] = implode(" | ", $_POST["sr_profile_areas"]);
$HTTP_POST_VARS["sr_profile_areas"] = $_POST["sr_profile_areas"];
}
// FELIXONE � 2002/2004 SB by Felice Di Stefano - www.felixone.it
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if (!isset($mm_abort_edit) || !$mm_abort_edit) {
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "new_reg")) {
$insertSQL = sprintf("INSERT INTO sr_users (usr_level, sr_profile_experience, sr_browse_experience, usr_id, sr_r, REMOTE_ADDR, HTTP_USER_AGENT, sr_usr_account_added, sr_company_name, sr_first_name, sr_last_name, sr_display_name, sr_email, sr_pw_temp, sr_zipcode, sr_phone, sr_city, sr_state, sr_country) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
Perhaps it's because $HTTP_POST_VARS is depreciated in PHP 5.3.
Any thought on how to re-code it to work in PHP 5.3?
Thanks for your help.
28/05/12 16:45:05
RE: RE: RE: Implode/Explode Multi Menu
Here's a more thorough copy of the code including how I have the select forms setup. It's really strange because the extension worked great many years ago. I certainly appreciate all of your help.
<?php require_once('Connections/db_1.php'); ?>
<?php require_once('Connections/db_2.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$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;
}
}
// *** Implode multiple selection
if (isset($_POST["sr_profile_areas"]) && is_array($_POST["sr_profile_areas"])) {
$_POST["sr_profile_areas"] = implode(" | ", $_POST["sr_profile_areas"]);
$HTTP_POST_VARS["sr_profile_areas"] = $_POST["sr_profile_areas"];
}
// FELIXONE � 2002/2004 SB by Felice Di Stefano - www.felixone.it
// *** Implode multiple selection
if (isset($_POST["sr_browse_areas"]) && is_array($_POST["sr_browse_areas"])) {
$_POST["sr_browse_areas"] = implode(" | ", $_POST["sr_browse_areas"]);
$HTTP_POST_VARS["sr_browse_areas"] = $_POST["sr_browse_areas"];
}
// FELIXONE � 2002/2004 SB by Felice Di Stefano - www.felixone.it
$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}
if (!isset($mm_abort_edit) || !$mm_abort_edit) {
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "new_reg")) {
$insertSQL = sprintf("INSERT INTO sr_users (usr_level, sr_profile_experience, sr_browse_experience, usr_id, sr_r, REMOTE_ADDR, HTTP_USER_AGENT, sr_usr_account_added, sr_company_name, sr_first_name, sr_last_name, sr_display_name, sr_email, sr_pw_temp, sr_zipcode, sr_phone, sr_city, sr_state, sr_country) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['usr_level'], "text"),
GetSQLValueString($_POST['sr_profile_areas'], "text"),
GetSQLValueString($_POST['sr_browse_areas'], "text"),
GetSQLValueString($_POST['usr_id'], "text"),
GetSQLValueString($_POST['sr_r'], "text"),
GetSQLValueString($_POST['REMOTE_ADDR'], "text"),
GetSQLValueString($_POST['HTTP_USER_AGENT'], "text"),
GetSQLValueString($_POST['sr_usr_account_added'], "text"),
GetSQLValueString($_POST['sr_company_name'], "text"),
GetSQLValueString($_POST['sr_first_name'], "text"),
GetSQLValueString($_POST['sr_last_name'], "text"),
GetSQLValueString($_POST['sr_display_name'], "text"),
GetSQLValueString($_POST['sr_email'], "text"),
GetSQLValueString($_POST['sr_pw_temp'], "text"),
GetSQLValueString($_POST['sr_zipcode'], "text"),
GetSQLValueString($_POST['sr_phone'], "text"),
GetSQLValueString($_POST['sr_city'], "text"),
GetSQLValueString($_POST['sr_state'], "text"),
GetSQLValueString($_POST['sr_country'], "text"));
mysql_select_db($database_ae_users, $ae_users);
$Result1 = mysql_query($insertSQL, $ae_users) or die(mysql_error());
}}
Forms:
<select name="sr_profile_areas[]" size="3" multiple="multiple" class="file_forms">
<option value="N/A" selected="selected">All That Apply</option>
<option value="Performer">Performer</option>
<option value="Designer">Designer</option>
<option value="Technician">Technician</option>
<option value="Management">Management</option>
<option value="Musician">Musician</option>
<option value="Directing">Directing</option>
<option value="Artisan">Artisan</option>
</select>
<select name="sr_browse_areas[]" size="3" multiple="multiple" class="file_forms">
<option value="N/A" selected="selected">All That Apply</option>
<option value="Casting">Casting</option>
<option value="Agent">Agent</option>
<option value="Producer">Producer</option>
<option value="Hiring">Hiring</option>
</select>