Ravens PHP Scripts: Forums
 

 

View next topic
View previous topic
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules
Author Message
selectric
Regular
Regular


Joined: Aug 06, 2008
Posts: 65

PostPosted: Thu May 14, 2009 7:05 am Reply with quote

Hello, thanks for your time! Can anyone tell me why this doesn't work, and what WOULD work?

Code:


 if ($module_name=='Module_One' OR 'Module_Two' OR 'Module_Three') {
echo 'Show content for Module 1, 2 or 3';

} else {
echo 'Show content for all other modules
}


Using this code
Code:
 

if ($module_name=='Module_One') {
echo 'content for module 1';
} else
if ($module_name=='Module_Two') {
echo 'content for module 2';
} else
if ($module_name=='Module_Three') {
echo 'content for module 3';
}

Works just fine, but I want to consolidate. Any ideas?
 
View user's profile Send private message
Palbin
Site Admin


Joined: Mar 30, 2006
Posts: 2583
Location: Pittsburgh, Pennsylvania

PostPosted: Thu May 14, 2009 7:36 am Reply with quote

Code:


if ($module_name=='Module_One' OR $module_name=='Module_Two' OR $module_name=='Module_Three') {

_________________
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan. 
View user's profile Send private message
selectric
PostPosted: Fri May 15, 2009 9:46 am Reply with quote

Thanks, I will try it out.
 
selectric
PostPosted: Thu May 21, 2009 2:26 pm Reply with quote

Thanks for your help, worked!
 
Display posts from previous:       
Post new topic   Reply to topic    Ravens PHP Scripts And Web Hosting Forum Index -> Modules

View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum


Powered by phpBB © 2001-2007 phpBB Group
All times are GMT - 6 Hours
 
Forums ©