Jump to content

requinix

Administrators
  • Posts

    15,266
  • Joined

  • Last visited

  • Days Won

    431

Everything posted by requinix

  1. I can't imagine that a browser extension framework would provide access to the sorts of things you need. They're just not meant to do that. So that means installing a program (as in a real software application) on the client that would allow your server to make remote connections and control the client. Which is a horrible idea. So... no. Not possible. As for shared memory, that's something completely different and not the least bit applicable to your situation.
  2. No. Such a thing would be a huge security risk for an operating system to allow. In fact they tend to go to great lengths to make sure that's not possible.
  3. Make sure the bundle has the certificates in the right order: nginx expects yours at the top and the rest of the chain after.
  4. Well, based on the syntax highlighting in your post, it appears you're missing a quote somewhere to end a string.
  5. Before you go making changes to it, how about looking in the server error log for more information about the error - like that message suggests?
  6. Then try writing the equivalent code. It uses a foreach loop and... well, that's it really. A single foreach loop.
  7. Try using array_column on $array["opportunity_items"].
  8. This forum works a lot better if you can ask specific questions. You've described the three database tables you need. Have you made them yet? Next step would be making the first page that shows the list of categories. Do you know how to do that? Have you ever used PHP to interact with a database? Have you done any research to see what you need to know and learn for it?
  9. Oh. Wait until bots become an issue, then use CAPTCHA. I say to wait because doing that is a bit of an annoyance to users, so if you can get away with not using it then great... but CAPTCHA (the real solutions, not the stuff you make up on your own) is very effective at stopping bots so it's the best solution when do you have the problem.
  10. You can't stop "bad bots" from getting to your site. They won't respect robots.txt. They'll crawl anything they can find. IP bans, at best, will just slow them down. You said they are "inserting rows into db". What does that mean? That sounds like the problem that should be fixed.
  11. heartbeat.png is a real PNG, however it's set up using a palette. So I need to clarify what I said earlier: a) Use a different file format - I suggest PNG, making sure you save in RGB or truecolor format (or whatever your image editor calls it) Attached is a PNG in RGB format. However you've moved away from GIF format, and that means you could improve the quality of the image. Do you still have the raw source available? You should recreate your base image using that as a source, rather than convert the inferior-quality GIF to a superior-quality PNG.
  12. GIF images have a maximum of 256 colors available. Your heartbeat.gif is using all 256 already, so imagecolorallocate will fail and return false. However false == 0 so when you try to write the text on the image it will use the color at palette index #0, which is light red. Either a) Use a different file format - I suggest PNG b) Save the image using fewer than 256 colors
  13. I must be misunderstanding something because it sounds like you're suggesting that search engine spiders are submitting data on your site and so you don't want them to index it at all.
  14. Nothing that would be better.
  15. [edit] Evidently yes, someone did say that.
  16. You can't get an arbitrary number of columns in MySQL, so you have to find a way to represent all that information in multiple rows instead. I'd just do that with two queries, one for the contents of each table. Fetch all that into your PHP and then process it from there. But I have a question: why does the second list not continue from Moore to de Mohrenschildt and Oswald like the first list did? Or does it and you just didn't show that much in your example? And another question: what happens if you have a circular association, like Philips > Barnes > Moore > Philips? And one more: should the relationships be bidirectional? Philips knows Barnes, but doesn't that also mean Barnes knows Philips?
  17. Ah. 1. You need to set the Content-Type in the request if you are passing any kind of data. If you don't then it seems PHP assumes application/x-www-form-urlencoded, which is why $_REQUEST gets that odd-looking value. If you set a Content-Type that PHP is not familiar with (basically neither that one or multipart/form-data) then PHP will take a different path of interpreting the body and not really do anything. However that path triggers code which deals with the $HTTP_RAW_POST_DATA stuff - not necessarily the variable itself but logic related to it. 2. $_REQUEST only works for application/x-www-form-urlencoded and multipart/form-data. Because those are key/value pairs that fit well into the $_REQUEST array. When you specify application/json content then $_REQUEST will not be filled and you need to use php://input to get the raw JSON. Your code should be like if ($_SERVER["REQUEST_METHOD"] == "POST") { if (stricmp($_SERVER["CONTENT_TYPE"], "application/json") == 0) { $json = @json_decode(file_get_contents("php://input")); } else { // maybe accept other formats } } else { // ? }
  18. At the very least errors attributed to Unknown:0 are often bugs in and of themselves for not giving accurate or usable information. Taking that mentality, the first step is reproducing the bug with a minimal test case. Is that possible? What kind of application are you using? Can you debug through it to at least find out when the error messages are being outputted?
  19. I split the quote thing into its own thread.
  20. I think the empty tag is being added by CKEditor. I can't find any settings for it in IPB, and I can't simply remove a because that's used for blank lines. So fixing that will probably require spelunking into CKEditor. IPB gives me a way to log in as people. As you, if I go into Coding Help, pick a thread, and go to the full editor, I see the options to attach files. I don't see it when trying to post to this thread. So are you not able to attach files in specific forums? Or at all? Do you see the attachment form?
  21. How are you using it? When I use that button the editor puts the cursor on a new line inside the quote, but if I click away then the empty line disappears.
  22. You say 10 articles but your query says 6... There's a general approach to take with this sort of problem. 1. Calculate a number that increases by 1 for every unit of time you care about. That's a month. Yes, you said you want every six months, but the unit you're using is a month. Include the year so that January 2017 = December 2016 + 1. year * 12 + month 2016 * 12 + 9 = 24201 2016 * 12 + 10 = 24202 2016 * 12 + 11 = 24203 2016 * 12 + 12 = 24204 2017 * 12 + 1 = 242052. Scale that number down according to how many intervals of that unit you want. Here is where the six months matters. floor((year * 12 + month) / 6) floor((2016 * 12 + 9 ) / 6) = 4033 floor((2016 * 12 + 10) / 6) = 4033 floor((2016 * 12 + 11) / 6) = 4033 floor((2016 * 12 + 12) / 6) = 4034 floor((2017 * 12 + 1 ) / 6) = 4034Note that it changes in December, and will again in June. If you want Jan-Jun and Jul-Dec then alter the formula from step 1 to offset by however much you need (ie, -1). 3. Use modulus to reduce that number to choose which group of articles you want. If you have 30 articles and want 10 at a time then that's 3 groups. floor((year * 12 + month - 1) / 6) % 3 floor((2016 * 12 + 9 - 1) / 6) % 3 = 1 floor((2016 * 12 + 10 - 1) / 6) % 3 = 1 floor((2016 * 12 + 11 - 1) / 6) % 3 = 1 floor((2016 * 12 + 12 - 1) / 6) % 3 = 1 floor((2017 * 12 + 1 - 1) / 6) % 3 = 24. For your query, you need to determine a starting offset given a group number. Since the first group will be 0 (0-2 not 1-3), the offset is just group * 10. use your imaginationSo you're left with $offset = (floor((date("Y") * 12 + date("m") - 1) / 6) % 3) * 10; $str = "SELECT * FROM tc_articals LIMIT {$offset}, 6";By the way, your idea won't work unless you have an exact multiple of 10 articles. Are you sure you will always have that?
  23. Set the value to -1 (as you did) and use file_get_contents("php://input") instead of $HTTP_RAW_POST_DATA.
  24. The best source of helpful information is Google. Seriously. I'm not sure what you're trying to find but what you actually need will be somewhere within the first couple pages of search results. Though I will say that if you're looking for a purely Javascript-based solution then you're not going to find one: there must be a server-side component for the whole idea to work.
×
×
  • 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.