Jump to content

petattlebaum

Members
  • Posts

    8
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

petattlebaum's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks for the tip! It certainly minimizes the form code! Live and learn! Thanks again!
  2. true, and I have tested with dates in the past too. I should have mentioned that. If I have 12 different workshops then that would mean 12 different queries. I thought that queries were more load intensive than php if statements. If that's not the case, then queries are definitely the way to go!
  3. Darn, This code seems to work though. I am missing something obvious aren't I? <?php $cntLFALL = "query will count total database rows..."; $date = "2013-05-01"; $unix_date = strtotime ($date); if (($cntLFALL < 125) && ($unix_date > time())) { ?> <form> <?php $date = "2013-03-06"; $unix_date = strtotime ($date); if (($cntLF1 < 25) && ($unix_date > time())) { ?> <label for="xshort_field_001" class="radio"> <input type="radio" name="date1" value="2013-03-07" id="xshort_field_001" tabindex="7" />How Full is Your Bucket </label> <?php } $date = "2013-04-21"; $unix_date = strtotime ($date); if (($cntLF2 < 25) && ($unix_date > time())) { ?> <label for="xshort_field_003" class="radio"> <input type="radio" name="date1" value="2013-04-22" id="xshort_field_003" tabindex="9" />Resum&130; Leadership </label> <?php } $date = "2013-05-02"; $unix_date = strtotime ($date); if (($cntLFALL < 125) && ($unix_date > time())) { ?> <p>Registration for the Leadership Fundamentals Workshops has closed.</p> <?php } ?> </form>
  4. Thanks for all the help! I actually had the correct code on a form but forgot which one! The code below seems to work <?php $date = "2013-05-01"; $unix_date = strtotime ($date); if (($cntAll < 2) &&($unix_date > time())) { echo "form fields..."; } ?> I just had the count and time parts backwards! I definitely need to keep better notes!
  5. Hello, I have a form for the purpose of people signing up for workshops. Of the elements, a few are radio buttons for workshops on different dates. I would like these dates to remain visible if: the date is before the actual workshop date the total number of people signed up is less than 25 Where I have had trouble is if only one of the above is the case. The code below works. But if I change the && to an OR or XOR, it does not work. Is it possible to combine an if statement with based on whether a certain has passed OR the max person limit has been reached? <?php $cntAll = "100";//max person limit $date = "2013-05-01"; $unix_date = strtotime ($date); if ($unix_date > time() && $cntAll < 2) { echo "form fields..."; } ?> Thanks! Peter T
  6. My bad again. To calculate the lcd, I am only using 3 numbers; the highest and middle numbers.
  7. Yes, I got ahead of myself. I THOUGHT I knew what the least common denominator was. I do now but don't know how to calculate it.
  8. I'm a newbie taking a class working on this problem. Which I've got up until the last part. I've got a form with 3 fields; all numbers. So, I type in 3 numbers and then the form is sent to a php page. Here's where my issue comes in; using a loop, I need to calculate the least comon denominator between the middle number and largest number. I know how to get the largest number; $largestNum = (max($num1, $num2, $num3)); Where I'm stumped is how to get the middle number. I think I know the logic but can't figure out how to implement it. Here's what I think I need to do: Create a While loop that finds the largest and smallest variables, and then use the one that is NOT them. Then make it a variable and multiply it times the max value ($largestNUm from above). Am I on the right track? Thanks!
×
×
  • 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.