Jump to content

requinix

Administrators
  • Posts

    15,286
  • Joined

  • Last visited

  • Days Won

    436

Everything posted by requinix

  1. How much of the code there now did you write? Do you know any PHP? Have you used things like if statements?
  2. No. We're not going to fix it for you. Try making the changes I said yourself. If you have problems, post the code you have and a description of what's happening.
  3. It looks like it does show that "no data found" message: at the bottom of the form after the table. Problem is you aren't deciding whether to show the table or to show the message depending on the results. You do everything and hope that all the variables have values. You need something like that "if num_rows > 0" you had earlier but covering the rest of the code and output too.
  4. How does the service expect to receive multiple values of selectedFields? If it's not PHP style as "selectedFields[]=" then it's probably the more traditional style of using multiple "selectedFields=", which you'd have to build by-hand as PHP doesn't have a native function to do it for you. curl_setopt($ch, CURLOPT_POSTFIELDS, "task=download&selectedFields=1&selectedFields=2&selectedFields=3");
  5. I took a quick look through some a personal project to see if I could find any examples that match the sort of thing you're dealing with. Didn't quite find what I was hoping for, but here's some lines I found: return call_user_func(self::$instance->data["crypt"]->data[$decryptor], substr($value, $decryptorlen + 2)); info("kernel.cache", ["Cache provider '%s' already registered as %s", $provider, get_class(self::$providers[$provider]["object"])]); self::$routers[$name]["object"] = instance(self::$routers[$name]["class"], [$name, self::$routers[$name]["config"]]);It also helps to use an editor with syntax highlighting - makes it easy (easier) to spot arrays when the "array" or []s are colored differently than variables and strings.
  6. I wouldn't. It looks fine to me: even at a glance I see three distinct array keys being used at the top level, and the first and third only need another half-second to see they're using their own array keys.
  7. Alright folks, a little less sarcasm if you don't mind. The file has to be included. The variable has to be defined in that file (or some subsequently included file) and has to be done in the global scope. If either of those doesn't happen then $mysqli will be undefined and the code will not work.
  8. I've done the same for you.
  9. Okay, so maybe one organization does...
  10. You can get the IP address with $ipaddr = (isset($_SERVER["HTTP_X_FORWARDED_FOR"]) ? /* proxy */ $_SERVER["HTTP_X_FORWARDED_FOR"] : $_SERVER["REMOTE_ADDR"]);Put that into the body of the email however you want.
  11. What's $m->get/set? Caching? Is that working correctly? It doesn't look like the ->get is setting any sort of TTL or expiration time...
  12. Yeah, there's no real additional complexity being added: you make commits like normal (except you can do them offline), but now there's the added step of pushing changes to a remote server when you feel like it; I have a couple projects that have commits I haven't synced to GitHub in a long time, but I still get the benefits of source control. Another argument in favor: learning how to use Git. Subversion starts breaking down when you have multiple developers on the same project, so if you want a career doing software/web development in a company then you'll need to learn Git... or Mercurial, it exists too, but I've never actually seen anyone use it.
  13. Subversion? What year is this? Git is where it's at. Netbeans? The "uploads file" and "commit the changes" things are two separate mechanisms: you can save a file (and thus automatically upload it, if your project is set up correctly) without having to make a commit for it. The svn directory can go anywhere as long as you aren't uploading it to the site - because then you'd be constantly uploading lots of files that don't need to be.
  14. 1. You need a DirectoryIndex directive somewhere that instructs Apache to use index.php as the default "index" file when accessing a directory. I would have expected XAMPP to do that for you, but maybe you have to do it yourself in the virtualhost configuration. 2. You don't have the mbstring extension installed. Check the phpMyAdmin installation instructions to see if there's anything else you missed.
  15. The version of Imagick you have installed does not match with the version of PHP you have installed. Download and/or compile and install the correct one.
  16. The thread was originally posted to PHP Applications. I moved it here, so OP isn't technically looking for critiques... I just figured that was better than deleting it.
  17. Prepared statements mean the developer does not have to escape the data manually. The developer is already escaping the data manually. Therefore prepared statements are not required.
  18. Actually we were thinking more about the code that sends the email. The older code, I guess, that was running slowly. If you have cron and we can't figure out the email problem then it's not too hard to make a periodic emailing thing. But as benanamen said, you shouldn't really have to resort to that...
  19. Well, tthere's a typpo on that oone line there thhat will prevent any Javvascript from executinng at alll...
  20. As opposed to what? That is valid so there's nothing inherently wrong with it. The method you're using is fine.
  21. How much access do you have on the machine? Is it dedicated? Shared? You have access to cron?
  22. If you think about it and look around, sure you can tell that the username is somewhere else. But Jacques' title, for example, really looks like a username. And I've seen a few people get called "Newbie". Honestly, putting the username above seems odd to me. That blue bar looks like spacing between posts and it wouldn't be hard to visually skip past it and go right to the little label above the user's avatar. But I wouldn't mind IQ tests for... well, most parts of life. Programming. Voting. Buying a home. It's discriminatory but it would save lots of people lots of time and hassle.
  23. I moved the title: it used to be above the avatar, now it's below. Sometimes there's confusion about the title looking like the name (when it's actually in the bar above the post) so maybe this little change will help with that. For future reference: global templates > userInfoPane
  24. I'm going to ignore the SQL injection and go for the question itself. In a case like this I would do a GROUP BY + HAVING COUNT SELECT id FROM fruit WHERE fruit_name IN ("apple", "banana", "orange") GROUP BY id HAVING COUNT(1) = 3Make sure the id + fruit_name pair is unique, even if the two aren't individually.
  25. Another suggestion is to break the dates into separate date and time components. That makes matching up dates and reservations more efficient as you won't need to DATE() anything. The basic approach to the query is to start with the table you want data from (dates) then use a JOIN on another source (reservations) to filter out records you don't want. SELECT d.date, d.time, r.count FROM date table AS d JOIN ( SELECT date, COUNT(1) AS count FROM reservations GROUP BY date HAVING count < 80 ) AS r ON d.date = r.date ORDER BY d.date, d.time The filtering (count
×
×
  • 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.