Jump to content
confused and dazed

conditional statements in html ?

Recommended Posts

Hello internet,

 

I have several blocks of code set up for images based in html but I am also using this page to process a previous form so the file is saved as a ".php"

 

I am using the following code to contain information:

 

<div class="block_1">

<This is where I have an image and two radio buttons>

</div>

<div class="block_2">

<This is where I have an image and two radio buttons>

</div>

…..…..

<div class="block_100">

<This is where I have an image and two radio buttons>

</div>

 

Based on how many images are available for the user to see, I would like to limit how many of these blocks appear. The page's capability is 100 of these blocks.

 

html does not accept if() statements so how could I set it up?

I can "$_POST" to a variable to use to have a count of how many images I want displayed - but how do I use that variable to display or hide blocks...

 

some background:I need to have 100 individual blocks set up so the user can select which ones they want to add to their favorite list. However I don’t want the user to see 20 image blocks with radio buttons of images AND 80 "x" images where there is no image to load.

Share this post


Link to post
Share on other sites

I would write it out pseudo code style, just trying to feel out the logic based on what your needs are, then try and start writing it in PHP. Post in the PHP forum if you need some help with the logic.

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...

×
×
  • Create New...