Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.