No me sale lo de editar con valor anterior Hola quiero hacer un editado con el valor de articulo anterior a editar, pero nose como hacerlo he hecho esto y me sale este error como lo podria areglar o hacer?? Código PHP:
<!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">
<!-- DW6 -->
<head>
<link rel="shortcut icon" href="../imagenes/favicon.ico" />
<!-- Copyright 2005 Macromedia, Inc. All rights reserved. -->
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<link rel="stylesheet" href="../3col_leftNav.css" type="text/css" />
<style type="text/css">
<!--
.Estilo1 {color: #000000;
font-weight: bold;
}
-->
</style>
</head>
<body>
<?php
$username = $_COOKIE['loggedin'];
if (!isset($_COOKIE['loggedin'])) die("Usted no esta conectado, <a href=index.php>click aquí</a> para conectarse.");
echo "Usted está conectado $usuario";
?>
<a href="logout.php">Cerrar sesion</a>
<div id="masthead">
<h1 id="siteName"><img src="../headerimg.jpg" width="1310" height="188" /></h1>
</div>
<div id="navBar">
<div id="search">
<div id="sectionLinks">
<h3 align="center">MENU</h3>
<ul>
<li><a href="../index.php">INICIO</a></li>
<li><a href="../documentos.php">DOCUMENTOS</a></li>
<li><a href="../fotos.php">FOTOS</a></li>
<li><a href="../videos.php">VIDEOS</a></li>
<li><a href="../contacto.php">CONTACTO</a></li>
<li><a href="../comentarios.php?pag=1">COMENTARIOS</a></li>
</ul>
</div>
<div id="sectionLinks">
<h3 align="center">MENU ADMINISTRACION</h3>
<ul>
<li><a href="moderacion.php">BORRADO COMENTARIOS</a></li>
<li><a href="articulos.php">NUEVO ARTICULO </a></li>
<li><a href="moderacion_articulo.php">ARTICULOS</a></li>
</ul>
</div>
</div>
</div>
<!--end navBar div -->
<div id="headlines">
<div id="advert">
<h3 align="center">ENLACES</h3>
<li><a href="">Ayuntamiento de Yuncos</a> </li>
<li><a href="#">B.O.P.</a></li>
<li><a href="#">Medico Yuncos </a></li>
</div>
<div id="advert">
<h3 align="center">PRENSA</h3>
<p align="center"><a href="http://eldiadigital.es/sec/toledo/"><img src="../imagenes/eldiaenclm.gif" width="242" height="56" border="0" /></a></p>
<p align="center"><img src="../imagenes/cabecera_logo.png" width="239" height="46" border="0" /></p>
</div>
</div>
<!--end headlines -->
<div id="content">
<div class="feature">
<div id="content"><img src="../imagenes/contacto.png" width="777" height="33" /></div>
<h3> </h3>
<h3>
<script type="text/javascript" src="jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
tinyMCE.init({
// General options
mode : "textareas",
theme : "advanced",
plugins : "pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave",
// Theme options
theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "left",
theme_advanced_statusbar_location : "bottom",
theme_advanced_resizing : true,
// Example content CSS (should be your site CSS)
// using false to ensure that the default browser settings are used for best Accessibility
// ACCESSIBILITY SETTINGS
content_css : false,
// Use browser preferred colors for dialogs.
browser_preferred_colors : true,
detect_highcontrast : true,
// Drop lists for link/image/media/template dialogs
template_external_list_url : "lists/template_list.js",
external_link_list_url : "lists/link_list.js",
external_image_list_url : "lists/image_list.js",
media_external_list_url : "lists/media_list.js",
// Style formats
style_formats : [
{title : 'Bold text', inline : 'b'},
{title : 'Red text', inline : 'span', styles : {color : '#ff0000'}},
{title : 'Red header', block : 'h1', styles : {color : '#ff0000'}},
{title : 'Example 1', inline : 'span', classes : 'example1'},
{title : 'Example 2', inline : 'span', classes : 'example2'},
{title : 'Table styles'},
{title : 'Table row 1', selector : 'tr', classes : 'tablerow1'}
],
// Replace values for the template plugin
template_replace_values : {
username : "Some User",
staffid : "991234"
}
});
</script>
<!-- /TinyMCE -->
</head>
<body>
<? $id = $_POST['id']?>
<form method="post" action="enviararticulo.php">
<div>
<br>Ubicación:</br>
<br>
<label>
<select name="select">
<option>inicio</option>
<option>documentos</option>
<option>fotos</option>
<option>videos</option>
<option>contacto</option>
<option>comentarios</option>
</select>
</label>
<h3>
<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
</h3>
<div>
<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%" ><?php echo $file['$id']; ?></textarea>
</div>
<br />
<input type="hidden" name="id" value="<?php echo $fila['id']; ?>"/>
<input type="submit" name="save" value="Enviar" />
<input type="reset" name="reset" value="Reset" />
</div>
</form>
<script type="text/javascript">
if (document.location.protocol == 'file:') {
alert("The examples might not work properly on the local file system due to security settings in your browser. Please use a real webserver.");
}
</script>
<?
$id = $_POST['id2'];
$conexion=mysql_connect("localhost","root","")
or die ("Algo hiciste mal");
mysql_select_db("iu",$conexion) or die ("algo paso en el select db");
$registros=mysql_query("select * from articulos
where id='$_POST[id2]'",$conexion) or
die("Problemas en el select:".mysql_error());
if ($reg=mysql_fetch_array($registros))
{
//en construccion
?>
<div id="siteInfo"><span class="Estilo1">[email protected]</span> | ©2011 I.U. DE YUNCOS </div>
<br />
</body>
</html> Este es el que manda el id del articulo Código PHP:
<form action="editar_articulo.php" method="post">
<input type="hidden" name="id" value="<?php echo $fila['id']; ?>"/>
<input type="submit" name="submit" value="editar" />
</form> y aqui el error:
Notice: Undefined variable: file in C:\wamp\www\iuyuncos\yuncos\admin\editar_articulo. php on line 147
Necesito su ayuda. gracias. |