Jump to content


New Members
  • Posts

  • Joined

  • Last visited


Profile Information

  • Gender
    Not Telling

harryg123's Achievements


Newbie (1/5)



  1. See the graphic. There is an Internal Server Error on the top and bottom of every page I visit in the PHPFreaks forums. Is there something wrong with my setup? Firefox 6.0, Win XP SP3, 2GB RAM
  2. Thanks, scootstah, I inserted the suggested if () statement, and the error seems to have gone away. I guess my next questions are merely academic: [*]Why did the server report an array() error even though the variable was indeed an array? [*]Why did the error go away after the server executed the if (is-array()) statement? [*]Why did the server report a file not found, but load the file anyway? [*]Why did the file not found error go away when I replaced underscores with hyphens in the include filename? (This is the last gasp on this thread. I'll mark it solved in a few minutes...) Thanks to everybody. -Harry
  3. scootstah suggested I post the code that generates the error. I hope you all will forgive the code--it’s pretty unprofessional, being grabbed from tutorial pages and modified slightly (with lots of comments so I can remember how it worked later, when I have to update it). It’s a shopping cart page that uses GET rather than POST inputs. When the visitor clicks Add to Cart on a shopping page, the code executes a link to cart.php?cmd=add&id=<item no.> The cart-fuctions.php included file then parses the 'cmd' variable: Kind of backwards, but it works. At one time I thought I would need the $action variable elsewhere, but now I don't. I start with (!isset()) just so the little bit of code that clears the @action variable is up on top where I can see it! The cart page goes on to display the item no. and other info grabbed from a MySQL database. The item could not be displayed, nor can the quantity be updated, unless the $_SESSION;['cart'] array has been set. The index for the cart array is the [id] of the item to be sold. The offending line that generates the array index warning is in the update_qty function, which, as I mentioned before, cannot be called w/o something being loaded already into the $_SESSON['cart'] array: I know it is always tempting to blame someone else for problems in code. But in this case it seems justified. Remember that the server reported file "include(includes/cart_functions.php)" as missing, then went on to load and execute its contents--which incidentally contains the code block that started this whole thread)! Also, the server stopped reporting the not found error when I replaced the underscores with hyphens in the included file names. This certainly is not normal behaviour, is it? BTW I stuck in this statement for testing: print_r($_SESSION['cart']); It produced this response: Array ( [32] => Array ( [q] => 5 [d] => 0 ) ) I'm still scratching my head. Any other ideas before I open a trouble ticket?
  4. PFMaBiSmAd: You asked about phpinfo() report: BTW the errors/warnings reported in my original post are not recorded in mylocal php_error_log! Also, line 177 in my code seems to be correct: Also it is executing correctly on the server, because it produces a list of items the customer has added to the shopping cart. So why should the server generate the warning? Server versions: Apache: 2.2.19 MySQL: 5.0.92-community-log PHP: 5.2.17 ===== There was another error that I did not include above, but now seems relevant. The server was reporting a file as not found, but was using its contents just fine. It was an include file: include ("includes/cart_functions.php"); So I changed the file name to cart-functions.php (and changed the filename in all the pages that link to it). The server no longer reports the error! ManiacDan: I executed the test code you suggested and got the error reported by the server: I’m thinking I should put in a trouble ticket with the hosting company. Is there anything I should consider before I write the nastygram? Thanks to everyone for their great help! Harry
  5. In php.ini on my local development server, error_reporting is set to And I get no errors. However, on the remote web server I found a bunch of warnings in the error log. I fixed most of them, but this error/warning should have popped up on my development console: I can fix the code to eliminate the warning, no prob. But why am I NOT seeing this error on my development machine? --Thanks --HarryG
  6. Hi I'm Harry. Three guys are standing on the sidewalk. The guy on the right says, "The guy in the middle is Tom." The middle guy says, "No, I'm Dick." The guy on the left says, "No, the guy in the middle is Harry." Tom always lies. Dick sometimes lies. Harry never lies. Identify the guys. (I only bring this up because my login name is harryg123.) - (Actually I joined up because I need some help with PHP coding, and this looks like a nice place to find answers.)
  • 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.