Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About papasmurf

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. papasmurf

    Uninitialized string offset

    Master Coder, From what I read on GitHub, there’s nothing FREE about it unless you’re a student (which I’m not). The only thing that’s free is if you sign up for the $21/mth package, you get a FREE TRIAL so I don’t know where you get your information. The only thing I’ve got to say to you is that if you reply to this post it’ll be TWENTY-THREE posts – now who’s counting? Maybe you're the one that wants to make it an endless thread?
  2. papasmurf

    Uninitialized string offset

    The code that displays the output is: echo $page->createPage(); ‘All that stuff’ that I posted prior explains the procedure. I hope this satisfies your hunger to see my code. As for your kind anecdote – that’s my point exactly, who cares what View Page Source reports? But mac_gyver mentioned 'browsers and other http clients can/do make extra requests to pages for different reasons and your code must deal with them.’. This is what prompted me to continue with this investigation. No-one has yet answered MY question as to whether saving my project to a GitHub repository is a mandatory requirement to communicate on this forum. If I am to pay a minimum of $84/annum to do that, I’d at least appreciate some justification that it’s money well spent. Thank you for your generous cooperation.
  3. papasmurf

    Uninitialized string offset

    Since I am essentially a PHP newbie, my application is heavy on methods. Efficiency was not necessarily considered a priority and if I were to make the code available via GitHub (or another similar site), I would welcome any advice that would enhance its performance but for now I’ll just stick to the problem at hand. I need to explain that the value (which happens to be an array), is taken from a CSV file that Excel exported. This CSV is imported to a phpMyAdmin table, then converted to an array using a third-party script. The main script for this page ‘taxi.php’ accepts _POST data from a previous page, then passes this and other data, including the MySql array, to a method setData(), which stores it all as a array class variable $data, which is used throughout the program. The script ‘taxi.php’ then calls a method createPage() which returns a long HTML string that displays the entire page. The HTML is derived from createPage() calling, in sequence, createHtml(), create(), setHtml() and finally getHtml(), which is returned to ‘taxi.php’ and echoed. The errors I am receiving begin in a method addDetail(), which is one of the methods used for processing this array. As you can see it doesn’t appear as though the errors are caused by code that displays the contents of the array but rather code that processes it prior to display. I would gladly provide you with code but my dilemma is which code do you want to see. The methods I have mentioned so far reside in six classes and thousands of lines of code.
  4. papasmurf

    Uninitialized string offset

    I'm not quite sure what you mean but each element is only displayed once in the table. What confuses me is that I only get these errors in Chrome. Do you know why that is and can it be disabled?
  5. papasmurf

    Uninitialized string offset

    To be honest I hadn't even thought about it. I don't have a GitHub account and would need to register and learn how to use it. Is this what is expected of me on this site?
  6. papasmurf

    Uninitialized string offset

    I am assigning the value in the _POST request to a variable only if it is set: if (isset($_POST["log_date"])) { // Get the log date $logDate = $_POST["log_date"]; // e.g. 18-Feb-18 } This is being done after some supporting scripts have been included and a session is started: session_start(); I’m not sure if that make a difference? All processing is done after this happens. As to your mention of a possible empty string, it sounds plausible but again, why would it display the arrays contents as a table if it was simply an empty string. Also, this only occurs in Chrome and not IE or Firefox. It’s mysterious to say the least.
  7. papasmurf

    Uninitialized string offset

    findArrValue() searches an array that contains arrays and strings for a value. The method is passed a string that is a key in one of the subarrays. When it finds that it will return the value, be it a string or an array. In this case it’s an array. I know it returns an array because the array is subsequently processed and displayed as a table on the console. As I mentioned in a previous post I used gettype() to confirm that an array is returned and the console displays ‘type: array’ but in View Page Source it reads ‘type: string’. I tried including: error_reporting(E_ALL); ini_set('display_errors', '1'); at the beginning of the script but the output is the same. Thanks for the suggestion though.
  8. papasmurf

    Uninitialized string offset

    Well I've narrowed the problem down to the Chrome browser. I get no errors in IE or Firefox. It appears that when data is sent to another page via _POST (as in a form), the HTML/data that is displayed in the forwarded pages' View Page Source does not reflect the same data that appears on the current page so as I see it, any errors that are displayed should be ignored. As a result I intend to use Firefox instead of Chrome for development. I can't find any recent posts about any fixes Google may have implemented regarding this issue so I'm assuming it's still not fixed. Perhaps they don't consider it important? Thank you all for trying to help me out with this. I think I can rest assured that it's not a coding issue.
  9. papasmurf

    Uninitialized string offset

    Its part of a method within a class that’s over 6000 lines but this is the part that causes the error… // Retrieve the MySql array $reportArr = $this->findArrValue(‘logArr’); echo 'type: '.gettype($reportArr); Its calling a method that looks up a value in another array. The value is the array I need. It finds it and returns it. Then like I said it displays it and everything’s fine on-screen. It’s just the HTML source code that shows it as a string and not an array.
  10. papasmurf

    Uninitialized string offset

    I’m new to this group so I’m not sure if I’m posting this in the right category but I’m having a problem with some error messages that appear in Chrome’s View Page Source. They are generated after running a script that displays correctly on a web page but not in View Page Source. They seem to be connected to an array that I’m using in one of the classes. Without getting into too much detail, gettype() calls the array ‘array’ on the page but in View Page Source it calls it ‘string’. Because of this it generates a number of ‘Notice: Uninitialized string offset’ messages in code that follows that statement. This occurs when xdebug is enabled or disabled. If I hard-code this array in a separate script, independent of the program I’ve written, and run a loop to display data I get no errors in View Page Source as it only occurs within the program. If anyone has some good advice as to why this is happening I’d appreciate it. Thanks.

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.