Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

DuduKovalenko

Radio Button

Recommended Posts

Gostaria que alguem me disesse se tem como enviar o resultado de uma pesquisa usando o radiobutton de um form.Absos

poderia ser mais claro?? e exemplificar?

Compartilhar este post


Link para o post
Compartilhar em outros sites

fiz um rapidinho no dreamweaver para você dar uma olhada como funciona

 

<?php require_once('file:///W|/Connections/sistema.php'); ?><?phpfunction 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 cad_fornecedor (tipo_2) VALUES (%s)",					   GetSQLValueString($_POST['tipo_2'], "text"));  mysql_select_db($database_sistema, $sistema);  $Result1 = mysql_query($insertSQL, $sistema) or die(mysql_error());}?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><title>Untitled Document</title><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"></head><body><form method="post" name="form1" action="<?php echo $editFormAction; ?>">  <table align="center">	<tr valign="baseline">	  <td nowrap align="right">Tipo_2:</td>	  <td valign="baseline">		<table>		  <tr>			<td><input type="radio" name="tipo_2" value="" >			  button1</td>			<td> 		  </tr>		  <tr>			<td><input type="radio" name="tipo_2" value="" >			  button2</td>			<td> 		  </tr>		  <tr>			<td><input type="radio" name="tipo_2" value="" >			  button3</td>			<td> 		  </tr>		</table>	</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><p> </p></body></html>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.