Jump to content

Close button added to the loop


kaosjon

Recommended Posts

Hi, i have added a section to my website where it loops each record, and it does this pretty well, however i want to add a button that if pressed closes the record, like an ignore button, would this require a database where it stores the record closed so that it never opens it to the user again. Any ideas you have about this i could use.

 

Heres my code for the loop.

 

<?php while($row = mysql_fetch_assoc($sql_cpa)) : ?>
<?php extract($row);?>
  <div class="offers">
  <div class="picture"><img src="images/images.jpg" width="125" height="125" /></div><!----end picture---->
  
  <div class="offer_content">
  <div class="offer_info">
    <h6><?php print "$name";?></h6><p><?php print "$description";?></p>
    <p><?php print "$requirements";?></p>
  </div><!----end offer_info---->
  
  <div class="offer_tools">
  <h6><?php print "$penny_value";?></h6>
  <p>Pennies</p>
  
  <h6><a href="<?php print "$url";?>user_id=<?php print "$id";?>&offer_id=<?php print "$offerid";?>">Begin</a></h6>

<h6>CLOSE</h6>
  
  </div><!----end offer_tools---->
  
  </div><!----end offer_content---->
  
  <div class="cpa_footer">
  <p>Payout: <?php print "$payout";?> || Difficulty: <?php print "$difficulty";?> || <?php print "$free";?></p>
  </div><!----end cpa_footer---->
  
  
  </div><!----end offers---->   
<?php endwhile ?>

 

The close button is located in the offer_tools div.

 

Thanks for your help

Link to comment
https://forums.phpfreaks.com/topic/248845-close-button-added-to-the-loop/
Share on other sites

Your doing this in php which is on the server. Can't be controlled via a browser button. (yeah AJAX I know).

 

Do this in javascript. add a string that the button can control it's value.

Have the loop check this string at the end of each loop and if set to death value break; out of loop.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.