<?php require_once('file:///C|/www/Connections/booster.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 = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING']; } if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO playlist (nome, url) VALUES (%s, %s)", GetSQLValueString($HTTP_POST_VARS['nome'], "text"), GetSQLValueString($HTTP_POST_VARS['url'], "text")); mysql_select_db($database_booster, $booster); $Result1 = mysql_query($insertSQL, $booster) or die(mysql_error()); } ?> <form method="post" name="form1" action="<?php echo $editFormAction; ?>"> <table align="center"> <tr valign="baseline"> <td nowrap align="right">Nome:</td> <td><input type="text" name="nome" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right">Url:</td> <td><input type="text" name="url" value="" size="32"></td> </tr> <tr valign="baseline"> <td nowrap align="right"> </td> <td><input type="submit" value="Insert Record"></td> </tr> </table> <input type="hidden" name="MM_insert" value="form1"> </form>
em vez de enviar como form enviar um link ja existente na pagina....
EXEMPLO: NOME ------------------ <a href="www.link.com">LINK</a> ----X
NOME= enviar para o campo nome
www.link.com= enviar para o campo URL
X= ao clicar enviar informações
Edição feita por: STHELT, 13/08/2009, 02:22.