Ver Mensaje Individual
  #1 (permalink)  
Antiguo 20/01/2008, 02:02
Avatar de leskolpykos
leskolpykos
 
Fecha de Ingreso: junio-2007
Ubicación: Caracas
Mensajes: 96
Antigüedad: 16 años, 10 meses
Puntos: 0
Pregunta ¿libro de visitas con foto? ¿se puede?

amigos tengo un form de solo 3 campos: nombre, titulo y mensaje, para que el usuario envie comentarios, etc. El usuario lo envia y se actualiza la tabla dinamica y aparece lo q escribió. sencillo y funciona perfecto. Pero quisiera que el usuario pudiera enviar una foto en ese form y aparezca en tamaño pequeña al lado de su comentario. es ésto posible?

espero alguno pueda asesorarme si existe esta posibilidad. gracias de antemano

********** codigo php **********

<?php require_once('conex.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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 ambiente (id, nick, perfil, mensaje) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['id'], "int"),
GetSQLValueString($_POST['nick'], "text"),
GetSQLValueString($_POST['perfil'], "text"),
GetSQLValueString($_POST['mensaje'], "text"));

mysql_select_db($database_localhost);
$Result1 = mysql_query($insertSQL) or die(mysql_error());

$insertGoTo = "send.php";
if (isset($_SERVER['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $_SERVER['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}
?>


************ form *****************

<form method="post" name="form1" action="<?php echo $editFormAction; ?>">
<table align="center">
<tr valign="baseline">
<td nowrap align="right">Id:</td>
<td><input type="text" name="id" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Nick:</td>
<td><input type="text" name="nick" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right">Perfil:</td>
<td><input type="text" name="perfil" value="" size="32"></td>
</tr>
<tr valign="baseline">
<td nowrap align="right" valign="top">Mensaje:</td>
<td><textarea name="mensaje" cols="50" rows="5"></textarea>
</td>
</tr>
<tr valign="baseline">
<td nowrap align="right">&nbsp;</td>
<td><input type="submit" value="Insertar registro"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>

Última edición por leskolpykos; 20/01/2008 a las 02:08