Ver Mensaje Individual
  #12 (permalink)  
Antiguo 30/01/2012, 16:57
apadravya
 
Fecha de Ingreso: enero-2012
Mensajes: 56
Antigüedad: 12 años, 3 meses
Puntos: 1
Respuesta: ¿contador de clicks?

mas facil: paso por URL tanto la ID como la url... pero el header no funciona:

Código PHP:
Ver original
  1. <?php
  2. $conexion = mysql_connect("xxxxxx","xxxxxxx","xxxxxx");
  3. mysql_select_db ("xxxxxxx",$conexion);
  4. $link = $_GET['link'];
  5. $matricula = $_GET['matricula'];
  6. $sql = "SELECT * FROM peliculas WHERE matricula = '$matricula'";
  7. $update1 = "UPDATE peliculas SET visitas=visitas+1 WHERE matricula='$matricula'";
  8. $rst = mysql_query($sql, $conexion);
  9. $update = mysql_query($update1, $conexion);
  10. $rows = mysql_num_rows($rst);
  11. if ($rows)
  12. {
  13. $update;
  14. header("Location: $link");
  15. }
  16. else
  17. {
  18.   echo "Ups! No he encontrado la película.";
  19. }  
  20. ?>

respuesta: Warning: Cannot modify header information - headers already sent by (output started at /homepages/35/d400236901/htdocs/ver.php:7) in /homepages/35/d400236901/htdocs/ver.php on line 20 :(