![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Confirmed User
Industry Role:
Join Date: Mar 2004
Location: Great White North
Posts: 5,794
|
Quick PHP Question.
I've got a check to see if it's a certain producttype (dog), and if so, something fits. Question is, can I have it be 'dog' and 'cat' and still have it as a line and not going into a if/else?
<-- Total noob, just learning. Thanks in advance and Happy New Year. PHP Code:
Code:
<?php if($this->product->productType == 'dog') { ?> ruff ruff ruff <?php } ?>
__________________
LinkSpun - Premier Adult Link Trading Community - ICQ - 464/\281/\250 Be Seen By New Webmasters/Affiliates * Target out webmasters/affiliates based on niches your sites are for less than $20 a month. AmeriNOC - Proudly hosted @ AmeriNOC! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Industry Role:
Join Date: Oct 2010
Location: Portugal
Posts: 1,262
|
Sorry, but I havent understood ur question.
I have a lousy english. But you have a variable set to be "dog" how can it be "dog" and "cat" at the same time? <?php if($this->product->productType == 'dog' or $this->product->productType == 'cat') { ?>
__________________
StagCMS - Adult CMS - user friendly adult content management system - speed up your websites with no SQL connections ICQ: 63*23*43*113 ![]() |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#3 |
Confirmed User
Industry Role:
Join Date: Mar 2004
Location: Great White North
Posts: 5,794
|
Yes that is what I meant "OR".
If it is dog or cat. (could be both) I guess, bowls, toys, I don't know ![]() THANKS!
__________________
LinkSpun - Premier Adult Link Trading Community - ICQ - 464/\281/\250 Be Seen By New Webmasters/Affiliates * Target out webmasters/affiliates based on niches your sites are for less than $20 a month. AmeriNOC - Proudly hosted @ AmeriNOC! |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Too lazy to set a custom title
Join Date: Jan 2002
Location: Holland
Posts: 9,870
|
if( item==dog or item==cat ){ do stuff }
__________________
Don't let greediness blur your vision | You gotta let some shit slide icq - 441-456-888 |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Industry Role:
Join Date: Nov 2009
Location: Heaven
Posts: 4,306
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#6 | |
Registered User
Industry Role:
Join Date: Dec 2010
Posts: 85
|
I'd start by seperating your scripting layer from you presentation layer.
Perhaps using a ''switch" could help you as well. Quote:
|
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Confirmed User
Join Date: Jul 2006
Location: Philadelphia
Posts: 1,282
|
wtf ? am I missing something here
![]() Code:
if($this->product->productType == "dog" || $this->product->productType == "cat") { } || = OR && = AND I mean I wouldnt do it that way but that answer your question about and and or. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#8 |
Confirmed User
Join Date: Aug 2003
Location: Netherlands
Posts: 816
|
Check PHP.net its full of examples
|
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#9 |
Confirmed User
Industry Role:
Join Date: Sep 2010
Posts: 38
|
This is the correct way unless you are comparing more than a few product types (Cat, Dog, Horse, Pig) If so, use the switch statement.
|
![]() |
![]() ![]() ![]() ![]() ![]() |