public function logout() { foreach ($this->session->all_userdata() as $key => $value) { if ($key != 'session_id' && $key != 'ip_address' && $key != 'user_agent' && $key != 'last_activity') { $this->session->unset_userdata($key); } } $this->session->set_flashdata('message', success_message('And you are now logged out!')); redirect(base_url(), 'location'); }
<br /> define('IP_INSTALLED', true);<br /> <br /> ?> </td> </tr> </table> <br /><br /> <?php $ndbms = urlencode($new_dbms); $ndbh = urlencode($new_dbhost); $ndbn = urlencode($new_dbname); $ndbu = urlencode($new_dbuser); $ndbp = urlencode($new_dbpasswd); $ntp = urlencode($new_table_prefix); success_message(sprintf($lang['rcp_success'], '<a href="' . $_SERVER['SCRIPT_NAME'] . '?mode=download&ndbms=' . $ndbms . '&ndbh=' . $ndbh . '&ndbn=' . $ndbn . '&ndbu=' . $ndbu . '&ndbp=' . $ndbp . '&ntp=' . $ntp . '">', '</a>')); break; default: ?> <p><b>Invalid Option</b></p> </body> </html> <?php die; } break; default: ?> <p><b>Invalid Option</b></p> </body> </html>
/** * Purpose: guess a letter in this word * Preconditions: a game has started * Postconditions: the game data is updated **/ function guess_letter($letter) { if ($this->isOver()) { return; } if (!is_string($letter) || strlen($letter) != 1 || !$this->is_letter($letter)) { return error_message("Oops! Please enter a letter."); } //check if they've already guessed the letter if (in_array($letter, $this->letters)) { return error_message("Oops! You've already guessed this letter."); } //only allow lowercase letters $letter = strtolower($letter); //if the word contains this letter if (!(strpos($this->word_list[$this->word_index], $letter) === false)) { //increase their score based on how many guesses they've used so far if ($this->health > 100 / ceil($this->guesses / 5)) { $this->setScore(5); } else { if ($this->health > 100 / ceil($this->guesses / 4)) { $this->setScore(4); } else { if ($this->health > 100 / ceil($this->guesses / 3)) { $this->setScore(3); } else { if ($this->health > 100 / ceil($this->guesses / 2)) { $this->setScore(2); } else { $this->setScore(1); } } } } //add the letter to the letters array array_push($this->letters, $letter); //if they've found all the letters in this word if (implode(array_intersect($this->word_letters, $this->letters), "") == str_replace($this->punctuation, "", strtolower($this->word_list[$this->word_index]))) { $this->won = true; } else { return success_message("Good guess, that's correct!"); } } else { //reduce their health $this->setHealth(ceil(100 / $this->guesses) * -1); //add the letter to the letters array array_push($this->letters, $letter); if ($this->isOver()) { return; } else { return error_message("There are no letter {$letter}'s in this word."); } } }
';<br /> <br /> define('PHPBB_INSTALLED', true);<br /> <br /> ?> </td> </tr> </table> <?php $ndbms = urlencode($new_dbms); $ndbh = urlencode($new_dbhost); $ndbn = urlencode($new_dbname); $ndbu = urlencode($new_dbuser); $ndbp = urlencode($new_dbpasswd); $ntp = urlencode($new_table_prefix); success_message(sprintf($lang['rcp_success'], "<a href=\"" . $_SERVER['PHP_SELF'] . "?mode=download&ndbms={$ndbms}&ndbh={$ndbh}&ndbn={$ndbn}&ndbu={$ndbu}&ndbp={$ndbp}&ntp={$ntp}\">", '</a>')); break; default: ?> <p><b>Invalid Option</b></p> </body> </html> <?php die; } break; default: ?> <p><b>Invalid Option</b></p> </body> </html>