web_master Posted April 13, 2008 Share Posted April 13, 2008 hi, I want to print if I GET "product1" or "product2" example if($_GET['c'] == "productgroups_2" (OR) "productgroups_3") { print $something; } what I need to take on place (OR)? thnx Link to comment https://forums.phpfreaks.com/topic/100935-php-or/ Share on other sites More sharing options...
dezkit Posted April 13, 2008 Share Posted April 13, 2008 if($_GET['c'] == "productgroups_2" || "productgroups_3") { print $something; } Link to comment https://forums.phpfreaks.com/topic/100935-php-or/#findComment-516139 Share on other sites More sharing options...
PFMaBiSmAd Posted April 13, 2008 Share Posted April 13, 2008 No programming language performs logical comparisons like that. That logically or's "productgroups_2" with "productgroups_3" and compares the result with $_GET['c']. web_master, you would need to do the following - if($_GET['c'] == "productgroups_2" OR $_GET['c'] == "productgroups_3") { print $something; } Link to comment https://forums.phpfreaks.com/topic/100935-php-or/#findComment-516147 Share on other sites More sharing options...
web_master Posted April 13, 2008 Author Share Posted April 13, 2008 well, PFMaBiSmAd You right, its work on Youre way. Ive got some bug... I hope that will found what is that... because the codeis: <?php if($c == "productgroups_2" OR $c == "productgroups_3") { $back = include("order_link_back.php"); } else { $back = ""; } print $back; ?> the included file is <script type="text/javascript" language="JavaScript1.2"> <!-- stm_bm(["menu5508",600,"order_js/","blank.gif",1,"stgcl()+954","stgct()+165",0,0,250,0,1000,1,0,0,"","",0,0,1,2,"hand","hand","order_js/"],this); stm_bp("p0",[1,4,0,0,2,3,22,0,100,"",-2,"",-2,50,0,0,"#999999","transparent","",3,0,0,"#000000"]); stm_ai("p0i0",[2,"","","",-1,-1,0,"order/index_alkatreszek.php?lang=hu","_blank","","","order_01.gif","order_01.gif",24,200,0,"","",0,0,0,1,1,"#cec17a",1,"#E2CF74",1,"","",3,3,0,0,"black","black","#000000","#000000","bold 8pt Verdana","bold 8pt Verdana",0,0],24,200); stm_ep(); stm_em(); //--> </script> When I test the dhtml code alone its work fine, but when icluded on this (above) way Ive get a nr "1" in a left up corner of a site that number 1 is on end of script - in source code of browser ... pt Verdana","bold 8pt Verdana",0,0],24,200); stm_ep(); stm_em(); //--> </script>1 Link to comment https://forums.phpfreaks.com/topic/100935-php-or/#findComment-516166 Share on other sites More sharing options...
PFMaBiSmAd Posted April 13, 2008 Share Posted April 13, 2008 The include() statement reads the contents of the file into the current script. It returns a true (1) or false (0) value, so setting $back to the value returned from an include() statement and then echoing that value will give you a 1 or 0 output to the browser. Just including the file (without the print $back; statement) is all you really need to do. Link to comment https://forums.phpfreaks.com/topic/100935-php-or/#findComment-516173 Share on other sites More sharing options...
web_master Posted April 13, 2008 Author Share Posted April 13, 2008 I like the PHP.... thhanx people thanx PFMaBiSmAd Link to comment https://forums.phpfreaks.com/topic/100935-php-or/#findComment-516183 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.