Hola a todos: esta es mi primera consulta y espero explicarme bien, si no! pido disculpas.
Estoy creando un Administrador de sitio en PHP y necesito que luego de borrar, actualizar o insertar un registro me devuelva a la página donde estaba antes en realidad 2 páginas atrás ya que coloque una intermedia que pide confirmacion(antes de borrar un registro por ejemplo).
Ya probé con Javascript:history.back() y con Javascript:history.go(-1) .
Estoy Trabajando con DreamWeaverMX 2004 y aquí esta un ejemplo del código donde necesito colocar la URL...
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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"] == "form1")) {
$insertSQL = sprintf("INSERT INTO secciones (IdSeccion, NombreSeccion, UbicacionCol, Disponible, EnPortada, Orden, idioma) VALUES (%s, %s, %s, %s, %s, %s, %s)",
GetSQLValueString($_POST['IdSeccion'], "int"),
GetSQLValueString($_POST['NombreSeccion'], "text"),
GetSQLValueString($_POST['UbicacionCol'], "text"),
GetSQLValueString($_POST['disp'], "text"),
GetSQLValueString($_POST['EnPortada'], "text"),
GetSQLValueString($_POST['Orden'], "text"),
GetSQLValueString($_POST['idioma'], "text"));
mysql_select_db($database_click, $click);
$Result1 = mysql_query($insertSQL, $click) or die(mysql_error());
$insertGoTo = "Que puedo poner AQUÍ? ";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
$idi_RSseccionnueva = "esp";
if (isset($_GET['idioma'])) {
$idi_RSseccionnueva = (get_magic_quotes_gpc()) ? $_GET['idioma'] : addslashes($_GET['idioma']);
}
mysql_select_db($database_click, $click);
$query_RSseccionnueva = sprintf("SELECT * FROM secciones WHERE secciones.idioma = '%s'", $idi_RSseccionnueva);
$RSseccionnueva = mysql_query($query_RSseccionnueva, $click) or die(mysql_error());
$row_RSseccionnueva = mysql_fetch_assoc($RSseccionnueva);
$totalRows_RSseccionnueva = mysql_num_rows($RSseccionnueva);
?>