Jump to content
#StayAtHome ×

requinix

Administrators
  • Content Count

    12,017
  • Joined

  • Last visited

  • Days Won

    257

Everything posted by requinix

  1. If you want each message then you need to query for each message. Not each message per recipient. The simplest solution is a query in a loop. "A query in a loop" is almost always wrong, and is always the least efficient solution, but it is quick so you can optimize later. Query for the messages. Set up a prepared statement for the recipients. For each message, run the recipient query and deal with it as you see fit.
  2. Okay, no documentation. What's the Java code on the other side of the socket?
  3. PHP should almost never segfault. Can you get a backtrace?
  4. You account for trailing slashes in the request URI only. You'll test with and without the slash, but the map only has the one version. Which is fine as long as you think about which version... Your function does not account for two important things: the request URI starting with the path (and not being only the path), and a potential query string. Slash problem aside, /shop/foo and /shop?bar will both fail to redirect.
  5. Not PHP documentation. I mean what documentation for the Java socket itself do you have? Is there a specification for sending and receiving messages?
  6. The redirect is configured for /shop/. With the trailing slash. Do you really have to do this with PHP? Setting up the redirect with the web server is almost definitely going to be better, and faster, and more efficient, and even simpler. I say this not just because your redirect function there isn't quite correct.
  7. Side note: glob() returns the path to each file according to the pattern you gave it. So all those filenames will look like /path/to/directory/foo.txt. What the client (C++) needs to know is the URL to hit on the server; if every file is in the same directory (which it sounds like it is) then you can get just the file names with basename(). Since you're working from C++, and by the way this is all something doable scriptable a shell and without the use of a compiled program, you'll want to make this all as simple as possible. The server should return just a plaintext list of filenames. You can read each line, get the filename, then download the file. <?php header("Content-Type: text/plain"); foreach (glob("/path/to/directory/*.txt") as $path) { echo basename($path), "\n"; } You still have the problem of having to send an HTTP request to the server and reading the response...
  8. I think that was ginerjm is trying to say is that this may not be the easiest thing in the world for you, but even though there are some people here who don't know stuff like jQuery very well, I know we can help you out in one way or another. I'm sure he wasn't trying to gate-keep the world of software development and say that you had to give up. Right, ginerjm? What I mean is that we don't know anything about your code short of what you can post here and tell us about. As people who have never seen it before, you automatically know more about it (as a whole) than we do. It's not exactly like we can just jump right into the middle of all this and tell you exactly what needs to happen. It's good to know it works somewhere, but if you need help getting it to work someplace it does not then it'd be more helpful if we knew more about that, right? The PHP code is simple enough so any problem is likely to be with the Javascript side. Any errors in the browser console? And the general troubleshooting questions apply: what is it supposed to be doing and what is it actually doing?
  9. So they're... uploaded? Using the site or FTP? Or are created directly on the server? I'm looking for a specific answer here because your requirement to delete the file depends partly on the files and how they get there.
  10. How are the files getting onto the server in the first place?
  11. a) If they say it works but it doesn't function then it doesn't work b) How is it broken? This isn't our code, we can't see it on the site, we don't know anything other than the few bits you've posted.
  12. What documentation do you have for using the connection?
  13. No, you can't get those two either. The MAC address is only available at a very low level in the system and it only tells you the hardware on the other end of the ethernet cable. The computer name is not something that gets sent over the internet.
  14. Make sure there is no whitespace before the opening <?php. Absolutely nothing at all. If you're sure you've removed everything, make sure your editor is not saving files in UTF-8 with BOM format. UTF-8 is fine. BOM is not.
  15. Licensing in this sort of situation is often handled by restricting how many user accounts can be active at once. Assuming your application deals with user accounts, of course. Another scheme is to restrict or limit how much data can be read in the database. You don't stop storing information, you just don't let people access all of it. Like, only showing the most recent. Related to that, you can also limit access to a resource. A fixed number of page views per day, or a number of downloads per assets, or total downloads, or something like that. And of course there's the most obvious one: to limit what features are available to use. Especially suited to complex applications that have a lot to offer.
  16. You want to know if the server can download an EXE to the user's computer and run it, without them knowing? Think about what you're asking. I'm sure you can come up with the correct answer.
  17. It could be a settings problem, sure, but it could just as easily not be a settings problem. Add error_reporting(-1); ini_set("display_errors", true); at the top of the file and see what happens.
  18. Okay, that's what I thought. You cannot read registry settings from the client browsing the website. You can only access the registry from the server PHP is itself running on. And obviously only if it's a Windows machine.
  19. Okay, let's go back a step. Who will own the server that this code will be running on? The client? Is it their server? Or is the code hosted somewhere the client cannot control and they use their browser (or some other means) to access/use/whatever it?
  20. Keep in mind that PHP code is open-source, so if somebody wanted to circumvent your registry key licensing checks, they could do it really easily. Like, in the time it takes me to microwave last night's leftovers. win32std It looks pretty old, though, so you might have to find an alternative. Like a shell command.
  21. Go with the second code. So you have that code in a place that receives the form data and (tries to) output the file. What's the code for the entire script?
  22. And exactly who is the "client" here? Are they the one running this PHP code? Or are they browsing the website or whatever?
  23. Okay. Are you still getting the undefined index warning from that details.php?id=20597 page?
×
×
  • 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.