// guardamos los parametros para el query string (ahora veo que quise decir .= pero funciona asi tambien) $con = db_open($d); // si es solo para los nombres de las columnas ... el SELECT los devuelve // luego podemos necesitar mas cosas $cols = db_getColumns($meta, $d, $t); // PC::db($cols, "getcols"); foreach ($cols[1] as $i) { $columnas[] = $i[0]; } // guardamos la clave primaria, debe estar exactamente una $pk = db_getPK($meta, $d, $t); // el index del PK en las columnas $pki = array_search($pk, $columnas); // esto no debe fallar porque siempre necesitamos seleccionar el PK // claves, etc mostrar_informacion($t); // comandos de momento - i insertar, b borrar, a actualizar, pasamos el ID en id if ($c) { if ($c == "i") { echo "Quiere insertar", br(); // cojemos los valores pasados foreach ($columnas as $col) { $valores[] = $_REQUEST[$col]; } $sql = "INSERT INTO {$t} (" . implode(",", $columnas) . ") VALUES (" . implode(",", array_map("comillas", $valores)) . ")"; echo $sql; db_query($con, $sql); } else { if ($c == "b") { // Borrar param("id", $id);
document.getElementById("contenedorabajo").style.margin="2% auto 2% auto"; } function mostrar(){ document.cookie = "lateral=ON; path=/"; document.getElementById("flechaizquierda").style.display="none"; document.getElementById("flechaderecha").style.display=""; document.getElementById("headoculto").style.right="0"; document.getElementById("contenedorgrande").style.margin="2% auto 2% 2%"; document.getElementById("contenedorabajo").style.margin="2% auto 2% 2%"; } </script> <img src="' . $rfiurl . 'w=img&imagen=derecha" alt="> >" id="flechaderecha" onclick="ocultar();"> <img src="' . $rfiurl . 'w=img&imagen=izquierda" style="display:none;" id="flechaizquierda" alt="< <" onclick="mostrar();"> </div> <div style="float:right; width: 90%; margin: auto 0 auto 0; overflow:auto;">' . mostrar_informacion() . ' </div> </div> <div class="contenedorgrande" id="contenedorgrande"> <div class="contenedor"> '; switch ($_GET['w']) { /* Mostramos las directivas mas importantes de php.ini y su explicación */ case 'directivas': /* Creamos un array con todas las directivas y su descripcion */ //safe mode http://ar2.php.net/manual/en/ini.sect.safe-mode.php $functions[] = array('<h2>Safe-Mode</h2>', '<a href="http://ar2.php.net/manual/en/ini.sect.safe-mode.php">http://ar2.php.net/manual/en/ini.sect.safe-mode.php</a>'); $functions[] = leerconfig('safe_mode', ' Whether to enable PHP's safe mode. If PHP is compiled with --enable-safe-mode then defaults to On, otherwise Off.'); $functions[] = leerconfig('safe_mode_gid', ' By default, Safe Mode does a UID compare check when opening files. If you want to relax this to a GID compare, then turn on safe_mode_gid. Whether to use UID (FALSE) or GID (TRUE) checking upon file access. '); $functions[] = leerconfig('safe_mode_include_dir', ' UID/GID checks are bypassed when including files from this directory and its subdirectories (directory must also be in include_path or full path must including). As of PHP 4.2.0, this directive can take a colon (semi-colon on Windows) separated path in a fashion similar to the include_path directive, rather than just a single directory. The restriction specified is actually a prefix, not a directory name. This means that "safe_mode_include_dir = /dir/incl" also allows access to "/dir/include" and "/dir/incls" if they exist. When you want to restrict access to only the specified directory, end with a slash. For example: "safe_mode_include_dir = /dir/incl/" If the value of this directive is empty, no files with different UID/GID can be included in PHP 4.2.3 and as of PHP 4.3.3. In earlier versions, all files could be included. '); $functions[] = leerconfig('safe_mode_exec_dir', ' If PHP is used in safe mode, system() and the other functions executing system programs refuse to start programs that are not in this directory. You have to use / as directory separator on all environments including Windows. ');