Ver Mensaje Individual
  #6 (permalink)  
Antiguo 26/11/2014, 17:20
mblascog
 
Fecha de Ingreso: enero-2002
Ubicación: Sabadell
Mensajes: 565
Antigüedad: 22 años, 3 meses
Puntos: 4
Respuesta: Ejecutar código php según parámetros

Gracias por responder.
El código es exactamente el que antes he expuesto.
Al hacer click sobre la imagen, se ejecuta esta función de jquery:
Código Javascript:
Ver original
  1. $(".wowFoto").click(function() {
  2.             var data = [];
  3.             $.each($('.wowFoto'), function () {
  4.                 data.push(this.src);
  5.             });
  6.             $.post("<?php echo "inc_passe.php",{prmFotos:{fotos: data}}, function(data){$('.wowFoto').html(data);});
  7.         })
He comprobado, a través de alerts, el contenido de data, y es correcto.

inc_fotos.php es así:
Código PHP:
Ver original
  1. <!-- I: inc_passe -->
  2.     <?php
  3.         include "inc_config.php";
  4.         $fotos = $_POST["prmFotos"]['fotos'];
  5.     ?>
  6.     <script type="text/javascript">
  7.         alert("<?php echo 'fotos: '.$fotos[0]?>");
  8.     </script>
  9.  
  10.     <link rel="stylesheet" href="css/estils.css" type="text/css" media="all" />
  11.    
  12.     <!-- Start WOWSlider.com HEAD section --> <!-- add to the <head> of your page -->
  13.     <link rel="stylesheet" type="text/css" href="engineWow/style.css" />
  14.     <script type="text/javascript" src="engineWow/jquery.js"></script>
  15.     <!-- End WOWSlider.com HEAD section -->
  16.  
  17. <div id="passe">
  18.     <!-- Start WOWSlider.com BODY section --> <!-- add to the <body> of your page -->
  19.     <div id="wowslider-container1">
  20.         <div class="ws_images">
  21.             <ul>
  22. <?php               for ($i=0; $i<count($fotos); $i++) {
  23.                     echo "<li><img src=".$fotos[$i]." alt='' title='' id='wows1_0'/></li>";
  24.                 } ?>
  25.             </ul>
  26.         </div>
  27.         <div class="ws_bullets">
  28.             <div>
  29. <?php               for ($i=0; $i<count($fotos); $i++) {
  30.                     echo "<a href='#'>".$i."</a>";
  31.                 } ?>
  32.             </div>
  33.         </div>
  34.         <span class="wsl"><a href="http://wowslider.com/vu">image carousel</a> by WOWSlider.com v7.2</span>
  35.         <div class="ws_shadow"></div>
  36.     </div> 
  37.     <script type="text/javascript" src="engineWow/wowslider.js"></script>
  38.     <script type="text/javascript" src="engineWow/script.js"></script>
  39.     <!-- End WOWSlider.com BODY section -->
  40. </div>
  41. <!-- F: inc_passe -->
__________________
Qué fácil cuando lo sabes y qué difícil cuando no