php,codeigniter,browser-historyRelated issues-Collection of common programming errors


  • JerryAn Amos
    php recursion tree infinite-loop recursive-query
    I’m not sure what’s happening here, I tested this code on localhost but now that I’ve tried going live I’m getting this error message:Fatal error: Allowed memory size of 67108864 bytes exhausted (tried to allocate 261900 bytes) in …/functions/tree.php on line 24 I am guessing the code is causing some sort of infinite recursion but I’m a bit perplexed since it worked fine on localhost. I’ve spent a few days trying to get this to function the way I’d like and I’m reluctant to go changing things

  • user2637639
    php
    I got an Error Fatal error: Unsupported operand types in line12 while doing pagination in my page. Please help me how to solve this<?phprequire_once(“pagination.php”);$page=1;//Default page$limit=1;//Records per page$start=0;//starts displaying records from 0if(isset($_GET[‘page’]) && $_GET[‘page’]!=”){$page=$_GET[‘page’];}$start=($page-1)*$limit;?>

  • user007
    php wordpress class
    I have created a php class in my theme function.phpclass myWidgetSetting {function get_title(){//some blah blah code}}$setting = new myWidgetSetting();but when I call this class $setting->get_title() inside:class myWidget extends WP_Widget { function renderLayout(){global $setting;$setting->get_title();} }Then I get this error:Fatal error: Call to a member function get_title() on a non-object in D:\wamp\www\wp-content\themes\twentyten\widgets\myWidget.php on line 3Do i need to register cla

  • brasofilo
    php wordpress
    This might also be a wider issue with customized twentythirteen issues in 3.7.1Context A few days ago (Sun/Mon) I updated the WordPress SEO & Google Analytics plugins, changed some meta descriptions and the site was fine, live and working. However, it’s been down since Wednesday. White screen appears both for the url & the /wp-admin page-Don’t know if it updated to WP 3.7.1 automatically since I don’t know what it was before..must have? because it Is currently 3.7.1 -many plugins are out

  • Elizabeth
    php diff
    Wow I’ve got a lot of questions today… So I managed to fix the code I used for Paul Butler’s diff algorithm a bit. However, while there doesn’t seem to be a problem with the code itself, it’s not comparing the two text values I want it to compare from the database. I was wondering if there was a specific reason for that? Or maybe it has to do with the fact that it’s all in a table? Not sure, but either way, there’s just a blank space there… Also, when putting the code with different values f

  • SoldierCorp
    php function session shopping-cart
    Recently I start with php and not because it gives me this error. This code is onyl for show articles and total price of shopping cart when reload page, using PHPSESSID, if they have a better idea or an alternative for that function, they are appreciated!INDEX.PHP<?php require(“php/DB_Functionss.php”); ?> <!doctype html> <html lang=”es”> <head>…….. </head> <body><div id=”infoShopCart”><a href=”contShopping”><img src=”img/shopping_cart.png” w

  • Adda
    php .htaccess magento memory-management
    In Magento I got this error. I know this is a memory issue, but I know my code causing this. How can I solve such issue? The same code works for long time and suddenly it generates issue.Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 94115841 bytes) in /home/wwwcruk/public_html/cas/app/design/frontend/default/cas/template/brandproduct/brand-listcar.phtml on line 60I allocated 256M from htaccess. When I remove code from above file it works.This is the part of cod

  • halfer
    php
    First off, I’m very new to PHP and my English sometimes isn’t that great, so I already apologize for the guesswork you guys may have to do.The error I get is: Catchable fatal error: Object of class stdClass could not be converted to string”The code I have is:mysql_connect(“nope.com”,”nope”,”nope”) or die (“Verbindung zur Datenbank konnte nicht hergestellt werden”); mysql_select_db(“nope”) or die (“Datenbank konnte nicht verbunden werden”); $nnamenow = $_SESSION[‘username’]; echo(mysql_fetch_obj

  • Matt
    php mysql sql sqlite pdo
    I seem to be having an odd issue when trying to switch my code over to my live server. It works on my local WAMP server without fail, however on my live server, when I try to pull information from my database and put it into a table, I get the error in the question title in my error_log.This is the code that causes the error:<?php$query = ‘SELECT * FROM APPLICATIONS’;$stmt = $dbConnection->prepare($query);$stmt->execute();$result = $stmt->get_result()

  • mkn
    php fpdf
    This is a often discussed issue but so far no solution seems to fit for my problem. I’m generating a pdf with $pdf = new FPDF(); . This works fine. But now I want to have a footer with the page number. After trying a lot of things I found out, that if you want to set a footer, you need to create an instance with $pdf = new yourPDFclassName(); (which extends the parent FDF class).Running the whole thing again I receive the error: Allowed memory size of 33554432 bytes exhausted (tried to allocate

  • Michael Grigsby
    php mysql codeigniter
    Why am I getting the following error in my code?Fatal error: Can’t use function return value in write context in….I I had return statements inside the if…else when i first started working on this function, and the error seems like one that has to do with return statements. but i replaced them with echo statement’s and I’m still getting the error’s so I have no clue what’s going on. Any help or advise?public function wallPostComments() {// This function processes wall post comments// pull the

  • Kliklipse
    php codeigniter activerecord login-control
    Here my first question . I’m a newbie in PHP and CI but i want to learn :)First my model : class Login_model extends MY_Model {protected $table = ‘users’; protected $primary = ‘user_id’;function __construct() {parent::__construct(); }public function validate() {// Récupère le POST du login$user_mail = $this->input->post(‘user_mail’);$password = sha1($this->input->post(‘user_mail’) . $this->input->post(‘password’));//Execution de la requete$query = $this->users_m->get(a

  • Ashish Singh
    php codeigniter codeigniter-2
    Fatal error: Call to undefined function validation_errors() using codeIgniter here’s my comments.php view <?php echo validation_errors(); ?><?php echo form_open(‘news/comments’); ?>Name <input type=”text” name=”comment_name”></input><br />Email <input type=”text” name=”comment_email”></input><br />Comment<input type=”text” name=”comment_body”></input><br /><input type=”submit” name=”submit” value=”Comment it” ></input&

  • teresko
    php codeigniter
    This question already has an answer here:Call to a member function on a non-object4 answersSeems like a common occurance this error on here, Looking at the answers I still cant quite work out why I’m getting an error.I am getting the error Fatal error: Call to a member function result() on a non-object on line 83The line in question relates to this function in the Controller – This is what’s creating the error.$this->view_data[‘categories’] = $my_categories->result();The function is below..funct

  • Nanne
    codeigniter phpactiverecord
    I use CodeIgniter 2.1 and my production server was updated to PHP 5.4.3-1, and the pages that uses phpactiverecord don´t show nothing and don’t show any error.In my test servers with 5.3.6 works fine. I use the nightly build version of May 2012. I try with the older versions and stable version.Php-activerecord don´t work fine with php 5.4.3?EDIT: I found that my new server doesn´t have displays_errors = ON. After activate it, I see the error:Fatal error: Class ‘Category’ not found in /srv/www/fr

  • hakre
    php codeigniter phpexcel
    I’m trying to use PHPExcel with CodeIgniter.My problem is when i want to use this method below, I got PHP Fatal Error : Cannot redeclare class IOFactory If you’re uncertain of the filetype, you can use the IO Factory’s identify() method to identify the reader that you need, before using the createReader() method to instantiate the reader object.Below is my code:$this->load->library(‘PHPExcel’);$this->load->library(‘PHPExcel/IOFactory’);$path = $upload_data[‘full_path’];$inputFileType

  • Shankar Damodaran
    php codeigniter session
    As I have done codeigniter project, transferred the files from local server to live server, Here everything seems correct,http://royal.skylabsinc.in/Yet shows an error..Pls help me out in this… here an screen shot” Fatal error: Call to a member function num_rows() on a non-object in/home2/skylabsi/public_html/royal/system/libraries/Session.php on line215 “

  • geoidesic
    codeigniter phpunit
    I’m trying to write a PHPUnit test case for a CI model. The model makes use of a custom function in a CI_DB_active_record extension which is loaded via an extended CI_Loader. These extensions work fine when testing the site via a web browser. However, via phpunit, it is clear that the extended CI_Loader is not being included.Why would that be and how can I fix it?

  • Jared Farrish
    php mysql codeigniter
    I’m getting the error “Fatal error: Cannot use object of type stdClass as array in” on line 183 which happens to be$getvidids = $ci->db->query(“SELECT * FROM videogroupids WHERE videogroupid=’$videogroup’ AND used=’0′ LIMIT 10”); foreach ($getvidids->result() as $row){$vidid = $row[‘videoid’]; }Anyone know what’s wrong with the above code? Or what this error means?

  • GBD
    php database codeigniter fatal-error
    Now I am learning Codeigniter. I have more databases, so I choosed this time Anketa one. Why is error :**Fatal error: Call to a member function query() on a non-object in /var/www/domains/svastara/application/controllers/anketa.php on line 12** ???I chacked, the user and pass in database is ok, database is loaded in conf, and chacked the table name. So what more?$this->db = $this->load->database(‘anketa’);$q = $this->db->query(“SELECT * FROM anketaip”);if($q->num_rows()>0){f

  • Basel Shishani
    javascript html5 urlencode browser-history history.js
    In an OSS web app, we have JS code that performs some Ajax update (uses jQuery, not relevant). After the page update, a call is made to the html5 history interface History.pushState, in the following code:var updateHistory = function(url) {var context = { state:1, rand:Math.random() };/* —–> bedfore the problem call <——- */History.pushState( context, “Questions”, url );/* —–> after the problem call <——- */setTimeout(function (){/* HACK: For some weird reson, sometimes s

  • antonpug
    javascript dojo navigation browser-history hashchange
    So here’s the situation… We have two DoJo applications, A and B. On the last page of A, we launch a call that transitions to B – at that point in time, the unload event of A fires, we set some cookies and transition to B. Both applications currently listen to dojo/hashchange and whenever a hash change is detected, we reset it back to the old hash, effectively disabling browser navigation. Problem is, when we are transitioning from A to B, in the 2-3 seconds between the applications, there is

  • Willem Mulder
    javascript browser-history
    I have a webapp which is doing a weird, wrong, unexpected redirection through JavaScript (I checked that by disabling JavaScript in the browser. Redirection doesn’t happen). I’ve also checked all the JavaScript code for window.location being set and put breakpoints on it, but it still didn’t tell me who did the redirect.I don’t want to add processing before or after redirections, I need to know which code triggered the redirection so I can disabled it.

  • Angelo Silva
    javascript backbone.js browser-history
    I’m trying to use Backbone.js to handle the browser history. I’m not setting up Views / Models because I don’t want it to handle this, and probably because of this I’m not getting it to work properly.At this point my page is changing urls. Like:domain.com/services domain.com/products domain.com/contact domain.com/gallery domain.com/gallery/photo1The problem is: if I try to reload the page at domain.com/gallery/photo1. I get the error Uncaught SyntaxError: Unexpected token <All other pages wit

  • Rocket Hazmat
    javascript html html5 browser-history pushstate
    I was following along with Jeffery Way’s history.pushState tutorial on Tuts+, however I’m not able to get his results.Basically, here is my test page: http://leongaban.com/_tuts+/HTML5/With the script at the bottom of the page, the URL is suppose to look like http://leongaban.com/_tuts+/HTML5/page however nothing happens, also in Chrome and Firefox the developer tools are telling me there is no JavaScript on the page?My full markup (same as Jeffery’s):<!DOCTYPE html> <html lang=”en”>

  • ThiefMaster
    javascript ajax browser-history popstate html5-history
    I am creating a ‘portal’ type page a for a website whereby the initial ‘landing’ stage on the site contains a background image and very minimal content, but clicking a link entitled “about us” fires an AJAX command to load the page ‘about.php’ into a DIV called ‘MoreDiv’ – in addition, javascript commands are fired to set ‘MoreDiv’ to be visible, whilst also hiding the initial text div (called ‘phototext’) and an additional div called ‘bottomlinks’. The file ‘about.php’ then contains a list of l

  • And Finally
    javascript jquery html5 browser-history html5-history
    I’m trying out the HTML5 history API with ajax loading of content. I’ve got a bunch of test pages connected by relative links. I have this JS, which handles clicks on those links. When a link is clicked the handler grabs its href attribute and passes it to ajaxLoadPage(), which loads content from the requested page into the content area of the current page. (My PHP pages are set up to return a full HTML page if you request them normally, but only a chunk of content if ?fragment=true is appended

  • Ernie
    ember.js routing rendering browser-history
    I’m working on an exercises-application which shows questions to a user, one by one. When the users solves a question, he gets transitioned to the next question. The questions can be different types (e.g. multiple choice, connect matching, etc). Each question has a preferred view used to render it. When a question is anwsered it’s property finished is set to true. I observe that property finished from the question in its questionview, and when set to true the view automatically shows the correct

  • Dilip Kumar
    javascript jquery angularjs browser-history html5-history
    I am using jquery.history.js to support browser back support in my application which is developed using Angularjs and single page application. It is able to change the URL however on click on browser back button; it is changing the URL however it is not updating the page content. Following are details on the code used.Initialize State object:(function(window,undefined){// Establish Variablesvar History = window.History; // Note: We are using a capital H instead of a lower hvar State = History.ge

  • moskovich
    jquery html5 google-chrome state browser-history
    I’m trying to figure out how to use HTML5’s history functions. Here’s my basic code:$(document).ready(function () {var stateObj = { foo: “bar” };history.pushState(stateObj, “page 2”, “bar.html”);console.log(history.state);$(window).bind(‘popstate’, function(e) {console.log(e.originalEvent);}); });I’m using Jquery 1.5.1. Here’s the console output:undefinedPopStateEvent bubbles: false cancelBubble: false cancelable: true clipboardData: undefined currentTarget: DOMWindow defaultPrevented: false eve

Web site is in building