-
Posts
15,266 -
Joined
-
Last visited
-
Days Won
431
Everything posted by requinix
-
Why does yield result in error with doctrine collection?
requinix replied to NotionCommotion's topic in PHP Coding Help
You probably need root to change core_pattern, so echo '/tmp/coredump-%e.%p' | sudo tee /proc/sys/kernel/core_pattern You need root at the moment you try to open core_pattern for writing. echo> only works if you're running as root in the shell (since the shell is what tries to open the file), and sudo echo> will only run the echo as root (which won't do anything). If you can reproduce the crash with a CLI command then that's easier. If not, get the core dump and give it to gdb. -
And learn about $_SERVER.
-
How to add a bootstrap class to php echo in php in mysql query?
requinix replied to Max45's topic in MySQL Help
You should spend some time learning about... well, the basics. Then you should be able to see what's wrong with what you're trying and know what the correct syntax is. -
No.
-
PHP can recommend a Save dialog by using Content-Disposition: attachment. Which you're already doing. Otherwise it's up to the browser.
-
You cannot overwrite or delete a file from the client's computer. The user has to tell their browser that they want to overwrite, and that means a Save dialog.
-
cron to run your script at the designated times, mail() or some emailing library to send the emails.
-
CURL PHP Crawler Returns Access Denied Error
requinix replied to Geoffism00's topic in PHP Coding Help
An Access Denied message suggests they have some sort of system in place to prevent the sort of thing you're doing. Are you sure the website can't help you already? Does adding it to your favorites do anything special? Are the sales you're talking about the sort of thing that would be listed in their weekly ads? -
Messaging/Chat System - Directing messages to more than one recipient
requinix replied to mongoose00318's topic in MySQL Help
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. -
Okay, no documentation. What's the Java code on the other side of the socket?
-
Why does yield result in error with doctrine collection?
requinix replied to NotionCommotion's topic in PHP Coding Help
PHP should almost never segfault. Can you get a backtrace? -
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.
-
Not PHP documentation. I mean what documentation for the Java socket itself do you have? Is there a specification for sending and receiving messages?
-
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.
-
upload files from php server to c++ client using curl
requinix replied to jazz15's topic in PHP Coding Help
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... -
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?
-
upload files from php server to c++ client using curl
requinix replied to jazz15's topic in PHP Coding Help
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. -
upload files from php server to c++ client using curl
requinix replied to jazz15's topic in PHP Coding Help
How are the files getting onto the server in the first place? -
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.
-
What documentation do you have for using the connection?
-
Google cloud hosting: Error Establishing Database Connection
requinix replied to simona6's topic in MySQL Help
It says what? -
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.
-
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.
-
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.
-
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.