Jump to content

LLLLLLL

Members
  • Posts

    306
  • Joined

  • Last visited

Posts posted by LLLLLLL

  1. Well even the web host is unsure how they get this type of error to show a 500 error:

     

    The website encountered an error while retrieving http://somesite/intentionalbadpage. It may be down for maintenance or configured incorrectly. Here are some suggestions: Reload this web page later. HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request.

     

    I like this type of error handling, but don't know how to get it set up!

  2. OK, I thought I understood the error logging settings, but I don't quite understand. Trying to troubleshoot another friend's site, a page had a fatal error so it didn't load. The browser returned a "page not found" type of error. We enabled the log and found the issue and corrected it.

     

    However, on my own machine, I tried to attempt this same bad behavior and I always see the error:

     

    Fatal error: Call to undefined function foo() in /(path)/header.php on line 4
    

     

    Why would my server show the error, but his server treated the page as if it did not exist? For the record, the entire page had this content

     

    <?php
    include( 'includes/header.php' );
    ?>
    

     

    The error is caused because header.php calls a function that hasn't been defined. I'm just wondering why there is a difference of error handling.

  3. The chat session guy from this webhost is pretty much useless. Someone suggested that I cannot stream files from folders that don't have a URL. That's not right because there are no other sites that require this.

     

    Again, is there a possible server setting for something like this?

     

    Thanks again....

  4. I sell shopping cart software that allows digital downloads of files. It always works, for everyone. Until now.

     

    This guy has a 56MB file for customers to download. It fails on his server. But on my server, that same file is downloaded without issue. I think maybe there's some file size limit on his server or something. Any thoughts?

     

    This is the code that "downloads" the file to a customer's browser:

     

    // Set headers and stream the file to the client browser. the attachment
    // filename is only the filename, but readfile must be the full path.
    header( "Content-Description: File Transfer" );
    header( "Content-Type: application/force-download");
    header( "Content-Length: " . filesize( $filename ) );
    header( "Content-Disposition: attachment; filename=" . $dp->filename );
    readfile( $filename );
    

  5. I googled with only minimal confidence in the results, so I thought I'd post... is there a library anyone here has used that allows me to fill data into a PDF (a writable PDF form)?

     

    I'll be storing a bunch of data in a database, and there's a pre-configured PDF that I need to fill. I just don't know which library will help me with this.

     

    Thanks.

  6. I'm unclear about error_reprorting( level ): does this set the error level for the duration of the script, or does it persist until some other event (like calling it again)?

     

    The documentation seems to indicate that it lasts longer than the duration of the script, differing from, say, ini_set. I've had it work a couple different ways on different servers so I'm a bit confused.

  7. I understand what you're saying here, and I will take a look at making these changes. However, I am still unable to explain that third bullet point above, as it has nothing to do with the database. In short:

    1) I copied français into a text file and saved it.

    2) When I edited the text file again, it had the jibberish text.

     

    Wassup with that? I'm using cPanel to do these "saves", and its encoding is indeed utf-8

  8. Hi, I'm still looking for an answer to this. Here is more information:

    • I copied the text français into a database upgrade file (text file)
    • That text got inserted into the DB as Français. (When I view the data in phpMyAdmin)
    • The text must have saved that way in the text file, too (when did it change?)
    • This text DOES now display as français

     

    So should I be happy that it displays correctly? Should I not care how phpMyAdmin displays it?  Sigh, so complicated

     

  9. I have a MySQL DB table and DB column with utf8_unicode_ci collation. I'm getting two columns out of the DB, one with the name of a language in English, the other a name of the language in the native tongue. The values in the database store/display properly from PHP MyAdmin.

     

    However, the "native-tongue" text does not display properly on the site. (See attached image.)

     

    I tried htmlentities( $str, ENT_COMPAT, 'UTF-8' ) for displaying, but that seems to make things worse (French, Portuguese, Spanish, and Turkish all display as empty; something I have not seen before).

     

    I thought that the htmlentities function should cure this, but since it does not, I am stumped. Any help is appreciated.

     

    [attachment deleted by admin]

  10. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

    This works for simply displaying text. However, in the few places that my text is an attribute, I still need to call htmlentities( $str ), but I need to use all three parameters as explained above:

    htmlentities( $str, ENT_COMPAT, 'UTF-8' )

     

    So it looks like my solution is a combination of both. I guess that's the best PHP can do for me right now.

  11. QuickOldCar's solution didn't work for me (I had already tried that) but I will look into the idea from requinix.

     

    I noticed that when my string was called with htmlentities( $string) it showed the jibberish, but htmlentities( $string, ENT_COMPAT, 'UTF-8' ) worked as expected. Clearly I'd rather set the page to be UTF-8 than to call this html entities stuff every time.

     

    I hope what you're saying will work. I'll get back to you.

  12. I saw another thread here about utf8_encode, but that doesn't seem to help me, even though the issues seem about the same.

     

    My application has a configuration area where you create products, and the ordering area where customers order them. I'm confused about accent handling, and character sets in general.

     

    Some notes:

    * When é is added to a field (configuration area) that displays as a textbox, the user saves and then the character displays as nonsense.

    * When é is added to a textarea field in the configuration area, the user saves and then the character displays properly.

    * In either case, the é character does not appear correctly in HTML in the customer ordering area.

     

    Thoughts?

  13. Yes, I read the link on his first reply, but (obviously) I'm still unclear. The information is just too vague for me, mostly because:

    1) I don't know where to put that code. In a config file? Okay, then...

    2) What is this frontend controller stuff that knows how to find the config file?

     

    I'm not trying to offend anyone, but I truly don't feel any answer has been specific to these questions. Hence the back-and-forth.

     

    Thank you again for your time.

  14. I desperately want to pursue specific questions. If you prefer to email me (does this forum allow it?) please do so.

     

    My problem is simple: I have a bunch of files that are in a folder that must be in the include path. The only way I know to set the include path is to tell a customer to set their php.ini (or ask their web host for help determining how to set the path). I don't want to do that any more, and I want to know how to avoid it.

     

    I understand what the php.ini file is. I understand why I don't want to tell people to change it. I understand what include paths are. That's my whole point.

     

    I understand what __FILE__ is now, but you said The call to __FILE__ can be done in the config file; and I don't know what "the config file" is. Sounds to me like I'd need to alter every file to find this config file.

     

    Specifically, I have structure like this

    • Root
      • classes
      • some other folder
      • a bunch of files

     

    The "bunch of files" may include some class from the classes folder. Also a bunch of files in the other folders include classes from the classes folder. I call this by...

     

    include( 'someclass.php' );

     

    ... without a path. Because it's set in php.ini. How else can I set it. Where does the mythical config file go? What is the mechanism that reads it?

     

    Thank you.

×
×
  • 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.