Project / Support Center
Welcome, Guest. Please login or register. August 13, 2022, 01:59: PM
Home Help Search Login Register
D-Web Web Site Creator D - Web Web Site Creator On-line HTML Editor No Programming knowledge required. Web Global Net PayPal-Cart Shopping Cart System PayPal - Kart Shopping Cart System for E-Commerce over the internet, that's easy to use. Web Global Net Newsletter Manager Newsletter Manager On-line Newsletter Creator with Email Subscriber Management.
Ring Central Discount
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  php related  |  Topic: 3 what if conditions for show If based on dynamic data 0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: 3 what if conditions for show If based on dynamic data  (Read 5065 times)
admin
Administrator
******
Offline Offline

Posts: 234


« on: August 07, 2017, 10:33: PM »

This is a Show if based on 3 conditions of a variable.

One of the difficulties we had was echoing dynamic data into the link in this case the year

<a href=classregs_year_military.php?reunion_year='.$year.'>

So what we did was create a variable $year

<?php $year=$row_rsreunionreg['reunion_year']; ?>

Then we had no issues using it in the If statements


The first condition evaluates the @$row_rsreunionreg['use_reason']
to see if its either for Military or Family use, if neither of these conditions are true then it displays the Record Icon and its link.

The 2 and 3rd condition show what to display based on weather or not its a Military or Family use and displays the appropriate Menu icon and link

For some reason if there is any space between each condition then the icon will not display

<?php
 if (@$row_rsreunionreg['use_reason'] != "Military" AND @$row_rsreunionreg['use_reason'] != "Family"){
echo '<a href=classregs_year.php?reunion_year='.$year.'><img name="list_regs" src="a_registration_report_icon_sm.png" width="28" height="36" border="0" vspace="5" id="list_regs" alt="" />[/url]
                        

                      Registrations';
   }
   if (@$row_rsreunionreg['use_reason'] == "Military") {
      echo '<a href=classregs_year_military.php?reunion_year='.$year.'><img name="list_regs" src="a_registration_report_icon_sm.png" width="28" height="36" border="0" vspace="5" id="list_regs" alt="" />[/url]
                        

                      Registrations';
   }
if (@$row_rsreunionreg['use_reason'] == "Family") {
echo '<a href=classregs_year_family.php?reunion_year='.$year.'><img name="list_regs" src="a_registration_report_icon_sm.png" width="28" height="36" border="0" vspace="5" id="list_regs" alt="" />[/url]
                        

                      Registrations';
   }     
?>
« Last Edit: August 08, 2017, 02:01: PM by admin » Report to moderator   Logged

The Unknown Webmaster
Pages: [1] Go Up Send this topic Print 
Web Global Net Web Application & Web Development Project Center  |  Technical Issues  |  php related  |  Topic: 3 what if conditions for show If based on dynamic data « previous next »
Jump to:  


Login with username, password and session length
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!