Jump to content

conditional statements in html ?


confused and dazed

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.

Link to comment
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.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...