Author

Topic: PHP question... yes it's crypto related. (Read 465 times)

legendary
Activity: 1064
Merit: 1001
June 12, 2015, 10:26:02 PM
#5
Code:
             
  • if ($page == 'lotteries' || preg_match("/(.*)_lottery/"$page)) { echo 'class="active"'; } ?>>
                    echo $lotto_button?>
                 


  • Problem solved.
    member
    Activity: 84
    Merit: 10
    ۩۞۩ secondstrade.com ★
    You have to pass parameters to bind_param() by reference, which means you have to pass a single variable (not a concatenated string). There's no reason you can't construct such a variable specifically to pass in, though:

    Code:
    $className = '%' . $this->className . '%';
    $query->bind_param('s', $className);
    copper member
    Activity: 3948
    Merit: 2201
    Verified awesomeness ✔
    legendary
    Activity: 1064
    Merit: 1001
    Question...

    Code:
                 
  • if ($page == 'lotteries' || $page == '*_lottery') { echo 'class="active"'; } ?>>
                    echo $lotto_button?>
                 


  • I know the above will never work but it helps me get my question asked, how can I have it so the * is wildcard for any possible combination ?

    ex. hi_lottery, how_lottery, are_lottery, you_lottery

    Basically as I add pages that are *_lottery, the class should always be active.

    Ty.

    This is for the site in my sig.
    Jump to: