
05/10/2009, 16:13
|
| | Fecha de Ingreso: septiembre-2008
Mensajes: 19
Antigüedad: 16 años, 6 meses Puntos: 0 | |
Respuesta: problemas con mi codigo php HELP! de verdad muchas gracias efectivamente me hacia falta ese linea de comando, por otra parte espero me puedas tambien ayudar con lo siguiente en mi administrador de tipo php tengo las opciones de agregar, editar y eliminar me permite agregar cualquier noticia pero al quere editarla me muestra todas las noticias que tengo pero al seleccionar una ahi se queda. el archivo en el que se supone se debe editar las noticias es el siguiente
<?php require_once('Connections/dancesfitness.php'); ?>
<?php
//initialize the session
session_start();
// ** Logout the current user. **
$logoutAction = $_SERVER['PHP_SELF']."?doLogout=true";
if ((isset($_SERVER['QUERY_STRING'])) && ($_SERVER['QUERY_STRING'] != "")){
$logoutAction .="&". htmlentities($_SERVER['QUERY_STRING']);
}
if ((isset($_GET['doLogout'])) &&($_GET['doLogout']=="true")){
//to fully log out a visitor we need to clear the session varialbles
session_unregister('MM_Username');
session_unregister('MM_UserGroup');
$logoutGoTo = "administrar.php";
if ($logoutGoTo) {
header("Location: $logoutGoTo");
exit;
}
}
?>
<?php
session_start();
$MM_authorizedUsers = "";
$MM_donotCheckaccess = "true";
// *** Restrict Access To Page: Grant or deny access to this page
function isAuthorized($strUsers, $strGroups, $UserName, $UserGroup) {
// For security, start by assuming the visitor is NOT authorized.
$isValid = False;
// When a visitor has logged into this site, the Session variable MM_Username set equal to their username.
// Therefore, we know that a user is NOT logged in if that Session variable is blank.
if (!empty($UserName)) {
// Besides being logged in, you may restrict access to only certain users based on an ID established when they login.
// Parse the strings into arrays.
$arrUsers = Explode(",", $strUsers);
$arrGroups = Explode(",", $strGroups);
if (in_array($UserName, $arrUsers)) {
$isValid = true;
}
// Or, you may restrict access to only certain users based on their username.
if (in_array($UserGroup, $arrGroups)) {
$isValid = true;
}
if (($strUsers == "") && true) {
$isValid = true;
}
}
return $isValid;
}
$MM_restrictGoTo = "administrar.php";
if (!((isset($_SESSION['MM_Username'])) && (isAuthorized("",$MM_authorizedUsers, $_SESSION['MM_Username'], $_SESSION['MM_UserGroup'])))) {
$MM_qsChar = "?";
$MM_referrer = $_SERVER['PHP_SELF'];
if (strpos($MM_restrictGoTo, "?")) $MM_qsChar = "&";
if (isset($QUERY_STRING) && strlen($QUERY_STRING) > 0)
$MM_referrer .= "?" . $QUERY_STRING;
$MM_restrictGoTo = $MM_restrictGoTo. $MM_qsChar . "accesscheck=" . urlencode($MM_referrer);
header("Location: ". $MM_restrictGoTo);
exit;
}
mysql_select_db($database_dancesfitness, $dance);
$query_noti = "SELECT * FROM noticias";
$noti = mysql_query($query_noti, $dance) or die(mysql_error());
$row_noti = mysql_fetch_assoc($noti);
$totalRows_noti = mysql_num_rows($noti);
?>
<?
if($noti){
$query_actual = "SELECT * FROM noticias where id_noticia='$notic'";
$actual = mysql_query($query_actual, $dance) or die(mysql_error());
$row_actual = mysql_fetch_assoc($actual);
$totalRows_actual = mysql_num_rows($actual);
}
?>
<font color="#000000" face="Verdana, Arial, Helvetica, sans-serif"><strong>Elige
Noticia a modificar</strong></font></p>
<?php do { ?>
<table width="87%" border="1" align="center">
<tr onMouseOver="uno(this,'#0099CC');" onMouseOut="dos(this,'');" onClick="location.href('editnoti.php?notic=<?php echo $row_noti['id_noticia']; ?>')">
<td width="147" height="56"> <div align="center"><strong><font color="#000000"><?php echo $row_noti['Nombre']; ?></font></strong></div></td>
<td width="229" align="center"> <div align="center"><span class="Estilo9"><strong><font color="#000000"><?php echo $row_noti['Descripcion']; ?></font></strong></span><br />
<br />
</div></td>
<td width="73"><div align="center">
<? if($row_noti['Imagen']==''){ $imagen='images/nohay.JPG';} else { $imagen=$row_noti['Imagen'];} ?>
<img src="<?php echo $imagen; ?>" width="89" height="48" /></div></td>
</tr>
</table>
<div align="center"><br />
</div>
<?php } while ($row_noti = mysql_fetch_assoc($noti)); ?>
<p>
<? } else{ ?>
<br />
</p>
<form action="notieditado.php" method="post" enctype="multipart/form-data" name="form1" class="Estilo48" id="form1">
<input name="id_noticia" type="hidden" id="id2" value="<?php echo $row_actual['id_noticia']; ?>" />
<br />
<p><strong><font color="#000000">Nombre de la Noticia:</font></strong>
<br />
<input name="nombre" type="text" id="nombre" size="65" value="<?php echo $row_actual['Nombre']; ?>" />
</p>
<p><strong><font color="#000000">Descripción:</font></strong>
<br />
<textarea name="descripcion" cols="50" rows="6" id="descripcion"><?php echo $row_actual['Descripcion']; ?></textarea>
</p>
<table width="100%" border="0">
<tr>
<td width="33%"><div align="center"><strong><font color="#000000">Imagen1:</font></strong>
</div></td>
<td width="33%"><div align="center"><strong><font color="#000000">Imagen2:</font></strong>
</div></td>
<td width="34%"><div align="center"><strong><font color="#000000">Imagen3:</font></strong>
</div></td>
</tr>
<tr>
<td>
<? if($row_actual['Imagen']==''){ $imagen='images/nohay.JPG';} else { $imagen=$row_actual['Imagen'];} ?>
<div align="center"><img src="<?php echo $imagen; ?>" width="137" height="120" /></div></td>
<td>
<? if($row_actual['Imagen2']==''){ $imagen2='images/nohay.JPG';} else { $imagen2=$row_actual['Imagen2'];} ?>
<div align="center"><img src="<?php echo $imagen2; ?>" width="137" height="120" />
</div></td>
<td>
<? if($row_actual['Imagen3']==''){ $imagen3='images/nohay.JPG';} else { $imagen3=$row_actual['Imagen3'];} ?>
<div align="center"><img src="<?php echo $imagen3; ?>" width="137" height="120" />
</div></td>
</tr>
</table>
CREES QUE TENGA EL MISMO PROBLEMA, GRACIAS POR TU APOYO TE PROMETO QUE SI QUEDA TE PONDRE EN LA PARTE DE DESARROLLADORES COMO COLABORADOR GRACIAS |