Jump to content

pnj

Members
  • Posts

    64
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

pnj's Achievements

Member

Member (2/5)

0

Reputation

  1. I've just installed php 5.3.3 command line on windows 7 via the thread unsafe .msi installer. I can't get php to read the display_errors value in php.ini. When I run phpinfo(), the following lines reference php.ini: Configuration File (php.ini) Path => C:\Windows Loaded Configuration File => C:\Program Files\PHP\php.ini I've placed php.ini files in both those locations with the following lines (among others): display_errors = On display_startup_errors = On But phpinfo() tells me: display_errors => STDOUT => Off I can turn it on using ini_set('display_errors','On'); but scripts with syntax errors still die silently. Any suggestions? Thanks!
  2. Yes btherl, you are exactly correct. The page had seemingly finished loading, but was making an ajax request to a bad database query that was taking 20-30 seconds to run. The reloaded page wouldn't begin, I assume, until the database query had finished. I can't explain why it was happening every second time, but maybe it was just coincidence and timing of when i was hitting the refresh key. thanks! this was a challenging problem as the visible problem was quite far from the code causing the problem. -pnj
  3. No, I am only calling session_start() once in the application, and it is the very first thing I am doing. Ok, I've done some more debugging and identified some more features of the problem. On the problem pages, the 25 second delay happens every second time I reload the page only. On alternate reloads, the page loads quickly. Further, if instead of reloading the page when the delay is about to happen, if I move to another page in the application, there is the same delay associated with session start. So it sounds like there is something this page is doing with the session that is causing a problem the NEXT time that php tries to retrieve the session. But it only happens on alternating session retrievals. So does that say anything to anybody? Thanks, pnj
  4. I'm running a php/mysql database application that stores a database description structure in a session variable. The database schema is on the large side, so this structure can probably be as big as 500kb. Recently, I've begun having a problem where on some pages, the session_start() function call takes a really long time to return, as long as 25 seconds. This happens in both a single-user and multi-user environment, but it is inconsistent - on some pages it happens every second or third reload, on some pages it doesn't happen at all. I'm not sure that its related to the size of my structure in a session variable, because the structure has been this big for a long time, but the session_start() problem is relatively new. Does anyone have any suggestions for why this could be taking so long? Is it a bad idea to store a 500kb structure in a session variable? I really appreciate your help, I am at something of a loss here! -pnj
  5. I need my php application to run in a few languages. I'm wondering if anyone can advise on design, or point to an implementation so I don't reinvent the wheel. So there will be a config file that defines the language at the beginning of a user's session. I'll have to replace every English language string in my application with an identifier. Then there is a file somewhere that associates all those identifiers with strings in a given language. The question is, what kind of file? I'm thinking of using a set of files consisting entirely of define()s, associating identifiers with strings. The application can then read the language file, and include() the appropriate definition file. Bad idea? Good idea? Better ideas? -pnj
  6. Fair enough. I guess its either that or force the user to paste the label content into a word processor template with the margins set correctly. Thanks -pnj
  7. The negative margin is certainly a promising idea... no such luck though. Looks good on screen, but the print margin just cuts off the text. See attached... -pnj [attachment deleted by admin]
  8. I'm setting up a web application to print labels to a specialized label printer. The challenge is that Internet Explorer (among other browsers) wants to set top and bottom margins to 0.6", which is not so ideal when the label is only 2" wide to begin with. This is a browser setting that CSS can't affect, so I'm expecting to tell the user to change his Page Setup to minimal margins for printing. The problem is IE doesn't seem to save Page Setup. Even between Page Setup and Print, it seems to forget the changes you made - the only way to have it print is to go Print Preview, then Page Setup from the Preview screen, and THEN print from the preview screen. Looks like a browser bug, but I can't find any information on this online. Any ideas on how to make IE use a different default margin setting for printing? Unfortunately I have to use IE6 because that is what the client is using. Maybe the bug is already fixed in IE7... I realize its not really a "phpfreaks" question, but maybe you can direct me to an active IE forum where someone is likely to know? Cheers -pnj
  9. pnj

    php macros?

    fair enough, this is a good first step. but i was hoping for something more generic, that would work for a get, a post, or even a variable defined or not defined by myself. basically, a C-style macro in php, which from the silence on this post, I'm guessing doesn't exist... -pnj
  10. I don't see anything at a glance, but you could try storing the query in a string variable, printing the string, and then popping it into the MySQL command line, which would tell you pretty quickly if your query is wrong or if you're not getting the $content value set properly. If its a textarea, you might want to use mysql_real_escape_string ($content) as well. -pnj
  11. How about system ("mysqldump ..."); or would that be considered bad practice? -pnj
  12. I often find myself writing this to avoid a php warning: $x = (isset ($_GET['foo']) ? $_GET['foo'] : null); Because php triggers a warning on the following if foo is not in the http get: $x = $_GET['foo']; I'd like to put it in a function, something like function getval($val) { return (isset ($val) ? $val : null; } But of course this doesn't because the call to getval() triggers the warning. I could use eval() and pass a string, but that also seems inelegant. In C, I would use a #define macro. Is there any such thing in php? thanks
  13. javascript won't do, I need time/date on the server side. The '@' is interesting, never seen it before. Can you point me to a manual page? (search engines don't do so good with '@') -pnj
  14. I'm getting mktime() error 2048: It is not safe to rely on the system's timezone settings. I can get around this by using date_default_timezone_set ('Africa/Johannesburg') But I want to run my application on various local intranet servers that are not in the same time zones. So basically I don't want to manually set the timezone, I want to use the system's setting that php tells me is not safe to rely on. I want to run with display_errors on, no TZ environment variable, no timezone_set() and no timezone in php.ini, but I don't want the mktime() error message. Is it all too much to ask? -pnj
  15. How would you go about building an HTML page designed to be printed with a label printer? Would the user just have to set their page setup to remove page headers, and then a matter of getting the margin and padding right in the stylesheet so things print just right? Or will I have difficulty printing to a label printer with an ordinary IE print request? I'm thinking of an address label printer, that just prints one small label at a time. Sorry if the question is a bit vague, I just don't have a label printer to experiment with at this time :-) -pnj
×
×
  • 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.