Foros del Web » Programando para Internet » PHP »

Añadir extension de fotos subidas en slider_lista.php

Estas en el tema de Añadir extension de fotos subidas en slider_lista.php en el foro de PHP en Foros del Web. Hola me gustaria añadir la extension de las fotos que suba al slider, ahora mismo solo sale el nombre de la foto os dejo el ...
  #1 (permalink)  
Antiguo 03/08/2013, 10:16
 
Fecha de Ingreso: agosto-2013
Mensajes: 13
Antigüedad: 10 años, 9 meses
Puntos: 0
Añadir extension de fotos subidas en slider_lista.php

Hola me gustaria añadir la extension de las fotos que suba al slider, ahora mismo solo sale el nombre de la foto

os dejo el link

Código:
http://reparotuordenador.com/_admin/slider_lista.php

El slider_add.php

Código:
<?php require_once('../Connections/conexionreparo1.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;
}
}

$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 tblslider (strImagenGrande, strImagenpequena, strMenu, strLink, intOrden, intEstado) VALUES (%s, %s, %s, %s, %s, %s)",
                       GetSQLValueString($_POST['strImagenGrande'], "text"),
                       GetSQLValueString($_POST['strImagenpequena'], "text"),
                       GetSQLValueString($_POST['strMenu'], "text"),
                       GetSQLValueString($_POST['strLink'], "int"),
                       GetSQLValueString($_POST['intOrden'], "int"),
                       GetSQLValueString($_POST['intEstado'], "int"));

  mysql_select_db($database_conexionreparo1, $conexionreparo1);
  $Result1 = mysql_query($insertSQL, $conexionreparo1) or die(mysql_error());

  $insertGoTo = "slider_lista.php";
  if (isset($_SERVER['QUERY_STRING'])) {
    $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
    $insertGoTo .= $_SERVER['QUERY_STRING'];
  }
  header(sprintf("Location: %s", $insertGoTo));
}
?>
<!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"><!-- InstanceBegin template="/Templates/plantilladmin.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Administraci&oacute;n Reparo</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<link href="../css/estiloadmin.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div class="container">
  <div class="header"><?php include("../includes/cabecera_admin.php"); ?></div>
  <div class="sidebar1"><?php include("../includes/menuizquierda_admin.php"); ?>

    <p>&nbsp;</p>
    <!-- end .sidebar1 --></div>
  <div class="content"><!-- InstanceBeginEditable name="Partederechaadmin" -->
  
 <script>
function subirimagen(nombrecampo)
{
self.name = 'opener';
remote = open('gestionimagen.php?campo='+nombrecampo, 'remote', 'with=400, height=150, location=no, scrollbars=yes, menubars=no, toolbars=no, resizable=yes, fullscreen=no, status=yes');
remote.focus();
}
</script>
    <h1>A&ntilde;adir Publicidad</h1>
    <p>&nbsp;</p>
    <form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1">
      <table align="center">
        <tr valign="baseline">
          <td width="197" height="40" align="right" nowrap="nowrap">Imagen Grande:</td>
          <td width="380"><input type="text" name="strImagenGrande" value="" size="32" />
          <input type= "button" name="button" id="button" value="Subir Imagen" onclick="javascript:subirimagen('strImagenGrande');"/>          (734x250)          </td><td width="75"></td>
        </tr>
        <tr valign="baseline">
          <td height="41" align="right" nowrap="nowrap">Imagen Pequena:</td>
          <td><input type="text" name="strImagenPequena" value="" size="32" />
            <input type= "button" name="button2" id="button2" value="Subir Imagen" onclick="javascript:subirimagen('strImagenPequena');"/>(80x50)          </td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Menu:</td>
          <td><input type="text" name="strMenu" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Link:</td>
          <td><input type="text" name="strLink" value="" size="32" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Orden:</td>
          <td><input type="text" name="intOrden" value="" size="5" /></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">Estado:</td>
          <td><label for="intEstado"></label>
            <select name="intEstado" id="intEstado">
              <option value="1">Activo</option>
              <option value="0">Desactivado</option>
          </select></td>
        </tr>
        <tr valign="baseline">
          <td nowrap="nowrap" align="right">&nbsp;</td>
          <td><input type="submit" value="Insertar registro" />
          </td>
        </tr>
      </table>
      <input type="hidden" name="MM_insert" value="form1" />
    </form>
    <p>&nbsp;</p>
  <!-- InstanceEndEditable -->
  
    <!-- end .content --></div>
  <div class="footer"><?php include("../includes/pie_admin.php"); ?>
    </div>
  <!-- end .container --></div>
</body>
<!-- InstanceEnd --></html>
y slider_lista.php

Código:
<?php require_once('../Connections/conexionreparo1.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;
}
}

mysql_select_db($database_conexionreparo1, $conexionreparo1);
$query_DatosSlider = "SELECT * FROM tblslider ORDER BY intOrden ASC";
$DatosSlider = mysql_query($query_DatosSlider, $conexionreparo1) or die(mysql_error());
$row_DatosSlider = mysql_fetch_assoc($DatosSlider);
$totalRows_DatosSlider = mysql_num_rows($DatosSlider);
?>
<!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"><!-- InstanceBegin template="/Templates/plantilladmin.dwt.php" codeOutsideHTMLIsLocked="false" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<!-- InstanceBeginEditable name="doctitle" -->
<title>Administraci&oacute;n Reparo</title>
<!-- InstanceEndEditable -->
<!-- InstanceBeginEditable name="head" -->
<!-- InstanceEndEditable -->
<link href="../css/estiloadmin.css" rel="stylesheet" type="text/css" />
</head>

<body>

<div class="container">
  <div class="header"><?php include("../includes/cabecera_admin.php"); ?></div>
  <div class="sidebar1"><?php include("../includes/menuizquierda_admin.php"); ?>

    <p>&nbsp;</p>
    <!-- end .sidebar1 --></div>
  <div class="content"><!-- InstanceBeginEditable name="Partederechaadmin" -->
    <h1>Lista de publicidades</h1>
    <p><a href="slider_add.php">A&ntilde;adir Publicidad</a></p>
    <table width="100%" border="0" cellpadding="2" cellspacing="2">
      <tr>
        <td width="36%">&nbsp;</td>
        <td width="25%">&nbsp;</td>
        <td width="28%">&nbsp;</td>
        <td width="9%">&nbsp;</td>
        <td width="2%">&nbsp;</td>
      </tr>
      <tr>
        <td>Titulo del Menu</td>
        <td>Imagen</td>
        <td>Orden</td>
        <td>Estado</td>
        <td>Acciones</td>
      </tr>
      <?php do { ?>
  <tr>
    <td><?php echo $row_DatosSlider['strMenu']; ?></td>
    <td><?php echo $row_DatosSlider['strImagenpequena']; ?></td>
    <td><?php echo $row_DatosSlider['intOrden']; ?></td>
    <td><?php echo $row_DatosSlider['intEstado']; ?></td>
    <td>&nbsp;</td>
  </tr>
  <?php } while ($row_DatosSlider = mysql_fetch_assoc($DatosSlider)); ?>
    </table>
    <p>&nbsp;</p>
  <!-- InstanceEndEditable -->
  
    <!-- end .content --></div>
  <div class="footer"><?php include("../includes/pie_admin.php"); ?>
    </div>
  <!-- end .container --></div>
</body>
<!-- InstanceEnd --></html>
<?php
mysql_free_result($DatosSlider);
?>

Etiquetas: extension, fotos, html, mysql, registro, select, sql, subidas
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 18:05.