espero alguno pueda asesorarme si existe esta posibilidad. gracias de antemano
![Neurótico](http://static.forosdelweb.com/fdwtheme/images/smilies/scared.png)
********** 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"> </td>
<td><input type="submit" value="Insertar registro"></td>
</tr>
</table>
<input type="hidden" name="MM_insert" value="form1">
</form>