Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/07/2008, 19:26
Zer0bg
 
Fecha de Ingreso: julio-2008
Mensajes: 20
Antigüedad: 15 años, 9 meses
Puntos: 0
Exclamación me gustaria modificar un form

hola gente..bueno estoy realizando un sitio y me gustaria incluir en un formulario de opinion... un captcha o algo que evite el spam.

aca les dejo el codigo del form por las dudas que necesiten corroborar algo..
espero que me ayuden por que estoy trabado y no se como hacerlo sin que me tire error..

Código:
<? If($opinar==1) { ?><table width="100%" border="1" cellspacing="0" cellpadding="5" bordercolor="#FFFFFF">
  <tr>
		<td bordercolor="#CCCCCC"><form name="form1" method="post" action="index.php">
		  <table width="100%"  border="0" cellspacing="0" cellpadding="3">
			<tr>
			  <td class="Estilo35">Nombre:
				  <input name="autor" type="text" class="Estilo35" id="autor" size="40" maxlength="100"></td>
			</tr>
			<tr>
			  <td class="Estilo35">Titulo:
				  <input name="titulo" type="text" class="Estilo35" id="titulo" size="40" maxlength="100"></td>
			</tr>
			<tr>
			  <td class="Estilo35">Opini&oacute;n:</td>
			</tr>
			<tr>
			  <td class="Estilo35"><textarea name="opinion" cols="50" class="Estilo35" id="opinion"></textarea></td>
			</tr>
			<tr>
			  <td class="Estilo35">Valoraci&oacute;n: 1
				  <input name="valoracion" type="radio" value="1">
		  2
		  <input name="valoracion" type="radio" value="2">
		  3
		  <input name="valoracion" type="radio" value="3">
		  4
		  <input name="valoracion" type="radio" value="4">
		  5
		  <input name="valoracion" type="radio" value="5" checked></td>
			</tr>
			<tr>
			  <td height="35" valign="bottom" class="Estilo35"><input type="submit" name="Submit" value="Enviar opini&oacute;n">
				  <input name="id_programa" type="hidden" id="id_programa" value="<? echo $id_programa; ?>">
				  <input name="mod" type="hidden" id="mod" value="ficha">
				  <input name="fecha" type="hidden" id="fecha" value="<? echo date("Y-m-d");  ?>">
				  <input name="accion" type="hidden" id="accion" value="1">
				  </td>
			</tr>
		  </table>
		</form></td>
  </tr>
</table> <? } ?>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="64%" height="34"><strong class="Estilo36">Opiniones:</strong></td>
            <td width="36%"><div align="center" class="Estilo35">            <?   $sql_t=mysql_query("SELECT valoracion FROM opiniones WHERE id_programa='$id_programa' ",$link);
$valoracion=0; $votos=0;
     If ($row_t=mysql_fetch_array($sql_t))
       { 
         Do 
          { 
           $valoracion=$valoracion+$row_t["valoracion"]; $votos=$votos+1;
          } 
         WHILE ($row_t=mysql_fetch_array($sql_t)); 
       } if($valoracion<>0) { ?>Valoraci&oacute;n media: <? echo $valoracion/$votos; ?> de 5 <? } ?></div></td>
          </tr>
          <tr>
            <td colspan="2"><table width="100%"  border="0" cellspacing="0" cellpadding="0">

<? $sql=mysql_query("SELECT *, DATE_FORMAT(fecha, '%d/%m/%Y') AS fecha FROM opiniones WHERE id_programa='$id_programa' ORDER BY id DESC LIMIT ".$n.", 3 ",$link);
     If ($row=mysql_fetch_array($sql))
       { 
         Do 
          {  ?>
             <tr valign="top">
                  <td width="77%" height="20" class="Estilo35"> <span class="Estilo36"><? echo"".$row["titulo"].""; ?> </span>- <? echo"".$row["fecha"].""; ?></td>
                  <td width="23%" class="Estilo35"><div align="right">Valoraci&oacute;n <span class="Estilo36"><? echo"".$row["valoracion"].""; ?></span></div></td>
             </tr>
                <tr valign="top" class="Estilo35">
                  <td class="Estilo35"><? echo"".$row["opinion"].""; ?></span><br></td>
                  <td class="Estilo35"><div align="right">Autor: <span class="Estilo36"><? echo"".$row["autor"].""; ?></span></div></td>
                </tr>
                <tr valign="bottom">
                  <td height="22" colspan="2" class="Estilo35"><div align="right"></div></td>
              </tr>      
                <? } 
         WHILE ($row=mysql_fetch_array($sql)); 
       } ?>
            </table>        
              <div align="center" class="Estilo35"><?php 
FOR ($i=0; $i< $quants; $i=$i+3) 
{    
    $a=$a+1; 
    IF ($n==$i)    
    { ?><A HREF=index.php?mod=ficha&id_programa=<?php echo $id_programa; ?>&n=<?php echo $i ; ?>><?php echo $a ; ?> </B></A>
              <? }    
    ELSE
    { ?>
              <A HREF=index.php?mod=ficha&id_programa=<?php echo $id_programa; ?>&n=<?php echo $i ; ?>><B><?php echo $a ; ?> </B></A>
              <? }    
} 
?> 
              </div></td>
          </tr>
      </table>
</td>
  </tr>
</table>
saludos y gracias