Jump to content

Search the Community

Showing results for tags 'snippet'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to PHP Freaks
    • Announcements
    • Introductions
  • PHP Coding
    • PHP Coding Help
    • Regex Help
    • Third Party Scripts
    • FAQ/Code Snippet Repository
  • SQL / Database
    • MySQL Help
    • PostgreSQL
    • Microsoft SQL - MSSQL
    • Other RDBMS and SQL dialects
  • Client Side
    • HTML Help
    • CSS Help
    • Javascript Help
    • Other
  • Applications and Frameworks
    • Applications
    • Frameworks
    • Other Libraries
  • Web Server Administration
    • PHP Installation and Configuration
    • Linux
    • Apache HTTP Server
    • Microsoft IIS
    • Other Web Server Software
  • Other
    • Application Design
    • Other Programming Languages
    • Editor Help (PhpStorm, VS Code, etc)
    • Website Critique
    • Beta Test Your Stuff!
  • Freelance, Contracts, Employment, etc.
    • Services Offered
    • Job Offerings
  • General Discussion
    • PHPFreaks.com Website Feedback
    • Miscellaneous

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Age


Donation Link

Found 1 result

  1. Hi ... I have the following code embedded in the main page of my website, <?php $seenSnippets = $this->session->userdata('seenSnippets'); if(!is_array($seenSnippets)) $seenSnippets = array(); $lastSeenSnippet = $this->session->userdata('lastSeenSnippet'); if(!strlen($lastSeenSnippet)) $lastSeenSnippet = -3; $snippets = array(); LIST OF SNIPPETS $unseenSnippets = array_keys($snippets); if(count($seenSnippets)) { if(count($seenSnippets) == count($snippets)) $seenSnippets = array($lastSeenSnippet); $unseenSnippets = array_diff($unseenSnippets,$seenSnippets); } // Pick a random one that has not been seen $snippetIDX = array_rand($unseenSnippets); $seenSnippets[] = $snippetIDX; $lastSeenSnippet = $snippetIDX; $snippet = $snippets[$snippetIDX]; $this->session->set_userdata('seenSnippets', $seenSnippets); $this->session->set_userdata('lastSeenSnippet', $lastSeenSnippet); echo $snippet; ?> Whenever I try to remove a snippet or two from the list, the most recent version of FireFox displays the following error (IE and Chrome work fine), A PHP Error was encounteredSeverity: Notice Message: Undefined index: Filename: views/vmain.php Line Number: 890 Line 890 contains the following code, $snippet = $snippets[$snippetIDX]; Although the code is embedded and there's no specific database for the snippets, I suspect codeignitor caches the snippets somewhere, as this problem is somewhat intermittent. I can't figure out or imagine where the snippets cache might reside. All browsers are up to date, as of today. My desktop uses Windows 7. Any ideas, advice or help much appreciated. dgp
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.