Php fusion code

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
rkomen
Forum Newbie
Posts: 2
Joined: Thu Jan 17, 2008 10:15 am

Php fusion code

Post by rkomen »

Hello,

I'm working on some mod for php fusion. Here is the original code where I have a problem:

Code: Select all

else if ($_GET['search'] === "0" || $_GET['search'] === "1")
{
 
$tableString = ($_GET['search']== "1")?" ".$locale['sa130']." ":" ".$locale['sa131']." ";
if (isset($_GET['cat']) && $_GET['cat'] != "")
{
$tableString .= $_GET['cat_name'];
} 
 
opentable( $tableString );

In this code when the links are search=0 and search ="1" header text is .$locale['sa130'] and $locale['sa131']. That work ok. I want to make when search=3 text is $locale['sa174'] when the search=4 text is $locale['sa175'] and when the search=5 text is $locale['sa176']

I have do this:

Code: Select all

else if ($_GET['search'] === "0" || $_GET['search'] === "1" || $_GET['search'] === "3" || $_GET['search'] === "4" || $_GET['search'] === "5")
That is ok. But how to do similar here:

Code: Select all

$tableString = ($_GET['search']== "1")?" ".$locale['sa130']." ":" ".$locale['sa131']." ";
Is that possible? I'm not an expert for php.
Thanks
User avatar
Jade
Forum Regular
Posts: 908
Joined: Sun Dec 29, 2002 5:40 pm
Location: VA

Re: Php fusion code

Post by Jade »

I would think that would work. However, wouldn't it be easier to just check what search is and then set it to the appropriate value?

Code: Select all

if ($_GET['search'] == 1)
$tablestring = $locale['somenumber'];
 
rkomen
Forum Newbie
Posts: 2
Joined: Thu Jan 17, 2008 10:15 am

Re: Php fusion code

Post by rkomen »

Yes, that work. Thank you very much.
How do you mean easier? I'm not and expert for php.
But tlike this is also good because work.
Thanks.
Post Reply