Search the Community
Showing results for tags 'or'.
-
Trying to simplify my code to something like: if($_SESSION['url'] != 'http://www.golden-wand.com/Pages/admin.php'||'http://www.golden-wand.com/Pages/admin-test.php') This is what works that I would like simplified: <!---------------------------------- ADMIN FUNCTIONS START -------------------------------> <?php if($_SESSION['admin']=='1'){ if($_SESSION['url'] != 'http://www.golden-wand.com/Pages/admin.php'){ if($_SESSION['url'] != 'http://www.golden-wand.com/Pages/admin-test.php'){ ?> <input type="button" value="Admin Page" class="button hvr-wobble-skew" onclick="location.href='http://www.golden-wand.com/Pages/admin.php'"> <?php }}} ?> <!----------------------------------- ADMIN FUNCTIONS END -------------------------------->
-
If ($Hoff == 'Nelspruit') || ($Hoff == 'Hoedspruit') || ($Hoff == 'Klaserie') || ($Hoff == 'Bushbuck Ridge') || ($Hoff == 'Hazyview') || ($Hoff == 'Graskop') OR ($Hoff == 'Sabie') || ($Hoff == 'Lydenburg') || ($Hoff == 'Pilgrims Rest') || ($Hoff == 'Barberton') || ($Hoff == 'Waterval Boven') || ($Hoff == 'Komatipoort') || ($Hoff == 'Malelane') { $addon = $addon +2; } else { $addon = $addon -100; } PHP Parse error: syntax error, unexpected '||' (T_BOOLEAN_OR) in /home/lowveldn/public_html/control/publish.php on line 84 Can someone tell me what is wrong here please.
-
I am creating a search page with php and codeigniter. I created the query which is; "SELECT * FROM my_account WHERE inex='$inex' AND type='$type' AND date BETWEEN '$date1' AND '$date2' " $date1 and $date2 values comes from form input and I have no problem here. On the other hand $inex value is also coming from form dropdown. $options = array( 'Income' =>'Income', 'Expense' =>'Expense', ); echo "<td>" . form_dropdown('inex',$options) ."</td>"; Now, if i do a search between two dates, i have to use Income or Expense values. But, I need the third option in the options array so that i can also choose both so that i can see both income and expenses between these two dates. I think there is a simple answer for that but somehow i cant figure it out. helps are appreciated. thanks in advance.