SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Enthusiast cliffgs's Avatar
    Join Date
    Aug 2003
    Location
    West Coast, New Zealand
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Weired error message (I think)

    I was wondering if someone could tell me what is causing the warning message: "[30-Jun-2012 18:12:37] PHP Warning: Wrong parameter count for strstr() in /Users/cliffgs/Sites/artworks.dev/includes/sortSession.php on line 9"


    PHP Code:
    <?php
    if(!isset($_SESSION['country'])) {
        
    $_SESSION['country'] = '21*New Zealand';
    }
    if (isset(
    $_POST['country'])) {
        
    $_SESSION['country'] = $link -> real_escape_string($_POST['country']);
    }
    $regionCountry $_SESSION['country'];
    $foundRegion strstr($regionCountry'*'true);
    $foundCountry ltrim(strstr($regionCountry'*'), '*');
    ?>
    After a lifetime working in graphic design on computers, I have found that when a computer gives an error message, it usually turns out to be correct, not matter how many times I swear at it.

    But for the life of me I cannot see what is causing the above Warning. On the same topic, should I worry as it is only a warning?

    Many thanks

  2. #2
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,072
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    What version of PHP are you using? According to the change log in the manual for that function the third parameter was added to the function in php version 5.3.0, PHP versions prior to that only accept two parameters for that function, 1 being the "needle" being looked for the other being the "haystack" that is being searched for the the "needle".
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  3. #3
    SitePoint Enthusiast cliffgs's Avatar
    Join Date
    Aug 2003
    Location
    West Coast, New Zealand
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply SpacePhoenix.

    I am using MAMP on my local machine, and it says the version of PHP is 5.2.17.

    So that explains that. I would/could change to 5.3, but on my live server the php version is only 5.2.14, so that wouldn't work. I guess I have to do a rtrim as well.

    Where do I find this changelog?

  4. #4
    From space with love silver trophy
    SpacePhoenix's Avatar
    Join Date
    May 2007
    Location
    Poole, UK
    Posts
    5,072
    Mentioned
    103 Post(s)
    Tagged
    0 Thread(s)
    http://uk.php.net/manual/en/function.strstr.php

    Scroll down for it. You can download from the php.net site a CHTML version of the manual which you can search offline
    Community Team Advisor
    Forum Guidelines: Posting FAQ Signatures FAQ Self Promotion FAQ
    Help the Mods: What's Fluff? Report Fluff/Spam to a Moderator

  5. #5
    SitePoint Enthusiast cliffgs's Avatar
    Join Date
    Aug 2003
    Location
    West Coast, New Zealand
    Posts
    53
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by SpacePhoenix View Post
    http://uk.php.net/manual/en/function.strstr.php

    Scroll down for it. You can download from the php.net site a CHTML version of the manual which you can search offline
    Terrific! Thanks very much.

    Sitepoint Forums Rock!!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •