Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Why not create a separate row for each, but store their resident status in a field of it's own? You could link to the other partner with a "parent" record: ID | Surname | Firstname | Resident | Parent 1 | Smith | John | 1 | null 2 | Smith | Linda | 0 | 1 This would make such calculations a lot easier.
  2. Why not just pass the language in the URL? e.g. "example.com/index.php?lang=en" Then in the code you just need to check if the lang param has been passed, else use the cookie, else use the default: if (isset($_GET['lang'])) { // return lang (convert it to entities // to prevent any XSS attacks) $lang = htmlspecialchars($_GET['lang']); // store for next time setcookie('lang', htmlspecialchars($_GET['lang'])); } elseif (isset($_COOKIE['lang'])) { // set lang var $lang = $_COOKIE['lang']; } if (!isset($lang)) { // if no $lang var set, use default $lang = 'en'; }
  3. Okay, and what have you tried so far? Also you'll need to define the array within the constructor of your class.
  4. Because the manual is so clear and well-documented, there's little need?
  5. Unless the domains both point to the same server you won't be able to do that, as the session data is stored on the server.
  6. Rheves only added session_start() within the file in an effort to debug the code; he commented out the dbinfo.php file. Okay, the error says there is a problem on line 1 of FrenchTalkingDictionary.php, what is line 1?
  7. Okay. Well somehow there is output before that session_start() call. Try viewing the source, anything there before the doctype?
  8. Are you using a free host site, that are inserting adverts? If not, what does C:\Inetpub\WebSites\premierathome_com\products\FrenchTalkingDictionary.php have to do with things?
  9. Why go to so much trouble when you could simply just modify it locally though?
  10. If you have session_start() within a file that you include on every page, why would you use it again?
  11. As meltingpoint said, you cannot have any output before the session_start() call, even white-space. I'd check the problematic file for a line break or single space that could be triggering the error. Though I disagree about your other point meltingpoint, placing the session_start() call within the included file is the best idea. Since you're going to be using it on virtually every page it makes sense not to repeat it every time.
  12. Having the post before the comments makes sense to me?
  13. That will only change the default index page from index.html to whatever is specified.
  14. Why not develop them locally, then upload to your remote/production server once you're happy?
  15. How do you expect us to know? We have even less insight than you do. What happens when you run the code, blank page? Errors? Have you debugged the code to find the breaking point? etc.
  16. Well then I'm guessing it has something to do with the template engine. Which are you using?
  17. Are you using a template engine? Can you show the code where you actually output the data?
  18. With your code all you're doing is storing the first query within $query, then overwriting the same variable with the next query and then running that. You can't be trying to debug this much yourself as a quick var_dump() test on $query before you try to execute it, would have shown you that you only have the second query stored. Do you mean insert the same values into both tables? Different databases would require a very different approach. A good question is why do you want to store identical data within two identical tables? Seems a little redundant to me.
  19. SELECT * FROM sub_db ORDER BY timestampz DESC LIMIT 0,1
  20. I thought it may be that myself, but doesn't seem very slow to me.
  21. Not really sure how that relates to the problem at hand? Would have to be a very large XML file for the server to struggle with timeout issues.
  22. Adam

    Regex help

    Give this a go: $str = preg_replace('/(1\.(.*?)) = 0/', '$1 = replacement_value', $str);
  23. You need to wrap model_pictures.theme=1 OR model_pictures.theme=3 within parentheses, so that it will match all the rest and then either one of those two.
×
×
  • 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.