Ver Mensaje Individual
  #5 (permalink)  
Antiguo 18/06/2012, 02:28
helenp
 
Fecha de Ingreso: mayo-2009
Mensajes: 382
Antigüedad: 15 años
Puntos: 6
Respuesta: imprimir código para modificar en mysql

Este es el codio de la pagina editar:
Código:
<?php 
ob_start();
include("conex/conexionsales.php"); 
$hourdiff = "5"; // hours difference between server time and local time
$timeadjust = ($hourdiff * 60 * 60);
setlocale (LC_TIME,"spanish");
$long_date = str_replace("De","de",ucwords(strftime("%A, %d de %B de %Y %H:%M",time() + $timeadjust)));
echo "<p>$long_date</h2> \n";
$id = $_REQUEST['id'];
	  $zona = $_POST['zona'];
	  $tipo = $_POST['tipo'];
	  $bedrooms = $_POST['bedrooms'];
	  $text = $_POST['text'];
	  $text_esp = $_POST['text_esp'];
	  $text_sve = $_POST['text_sve'];
	  $image= $_POST['image'];
	  $price_eng = $_POST['price_eng'];
 $ganga = $_POST['ganga'];
  $fotos = $_POST['fotos'];
   $fotos_esp = $_POST['fotos_esp'];
    $fotos_sve = $_POST['fotos_sve'];
	 $title = $_POST['title'];
	  $title_esp = $_POST['title_esp'];
	   $title_sve = $_POST['title_sve'];
	    $descrip = $_POST['descrip'];
		 $descrip_esp = $_POST['descrip_esp'];
		  $descrip_sve = $_POST['descrip_sve'];
		  $carac = $_POST['carac'];
		  $carac_esp = $_POST['carac_esp'];
		  $carac_sve = $_POST['carac_sve'];
$query = "SELECT * FROM ventas_buscador WHERE id='$_GET[id]' ";  
$result = mysql_query ($query);

$row = mysql_fetch_array($result); 
if ($_REQUEST['enviar'])
 {
	 $id = $_POST['id'];
 $sql = mysql_query("UPDATE ventas_buscador SET 
  zona='$zona', tipo='$tipo', bedrooms='$bedrooms', 
   text='$text', text_esp='$text_esp', text_sve='$text_sve',
   image='$image', price_eng='$price_eng', ganga='$ganga', fotos='$fotos', fotos_esp='$fotos_esp', fotos_sve='$fotos_sve', title='$title', title_esp='$title_esp', title_sve='$title_sve', descrip='$descrip', descrip_esp='$descrip_esp', descrip_sve='$descrip_sve', carac='$carac', carac_esp='$carac_esp', carac_sve='$carac_sve'  WHERE id=$id");
 header ("Location: buscador_ventas.php");

 }

 ob_end_flush(); 
?> 
<html>
<head>
<title>Editar buscador ventas</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
h1 {font-size:20px; color:#000099; font-weight:bold}
A { font-size:14px; color:#0000CC; TEXT-DECORATION: underline; font-weight:bold; }
</style> 
</head>
<body>
<form method="post" action="<?php echo $_SERVER['SCRIPT_NAME'];?>">
<input type="text" name="id" value="<?php print($_GET['id']); ?>" /> 
<h1>Modificar</h1>
Zona: <input type="Text" name="zona" value="<?php print($row["zona"]); ?>"><br> 
tipo: <input type="Text" name="tipo" value="<?php print($row["tipo"]); ?>"><br> 
bedrooms: <input type="Text" name="bedrooms" value="<?php print($row["bedrooms"]); ?>"><br> 
imagen buscador: <input type="Text" name="image" size="40" value="<?php print($row["image"]); ?>"><br>
Precio: <input type="Text" name="price_eng" value="<?php print($row["price_eng"]);?>"> <br>
Ganga: <input type="Text" name="ganga" value="<?php print($row["ganga"]);?>"> 
text buscador ingles: <input type="Text" name="text" size="500" value="<?php print($row["text"]); ?>"><br> 
text buscadore spañol: <input type="Text" name="text_esp" size="500" value="<?php print($row["text_esp"]); ?>"><br> 
text buscador sueco: <input type="Text" name="text_sve" size="500" value="<?php print($row["text_sve"]); ?>"><br> 
Title página ingles: <input type="Text" name="title" size="500" value="<?php print($row["title"]); ?>"><br> 
Title página spañol: <input type="Text" name="title_esp" size="500" value="<?php print($row["title_esp"]); ?>"><br> 
Title página sueco: <input type="Text" name="title_sve" size="500" value="<?php print($row["title_sve"]); ?>"><br> 
Carácteristicas página ingles: <input type="Text" name="carac" size="500" value="<?php print($row["carac"]); ?>"><br> 
Carácteristicas página spañol: <input type="Text" name="carac_esp" size="500" value="<?php print($row["carac_esp"]); ?>"><br> 
Carácteristicas página sueco: <input type="Text" name="carac_sve" size="500" value="<?php print($row["carac_sve"]); ?>"><br>
Descripción página ingles: <input type="Text" name="descrip" size="500" value="<?php print($row["descrip"]); ?>"><br> 
Descripción página spañol: <input type="Text" name="descrip_esp" size="500" value="<?php print($row["descrip_esp"]); ?>"><br> 
Descripción página sueco: <input type="Text" name="descrip_sve" size="500" value="<?php print($row["descrip_sve"]); ?>"><br>
Fotos página ingles: <textarea cols="150" rows="15" name="fotos" value="<?php print($row["fotos"]); ?>"></textarea><br>
Fotos página spañol: <input type="Text" name="fotos_esp" value="<?php print($row["fotos_esp"]); ?>"><br> 
Fotos página sueco: <input type="Text" name="fotos_sve" value="<?php print($row["fotos_sve"]); ?>"><br>
<br>  
<input type="Submit" name="enviar" value="Enviar"> 
</form> 
<?
mysql_close($dbh);
?>
</body>
</html>