Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. I don't know what that /P.P/ thing is supposed to be because it doesn't look like anything close to what you need to use. Be more specific about the membership number. What is the exact format? What are valid examples and why are they valid, then what are some invalid examples and why are they invalid?
  2. Showing us a screenshot of a broken image doesn't really accomplish anything. You've managed to post a small snippet of PHP code demonstrating your image swapping technique, and an example of what kind of BBCode you want to enter into a... whatever you're entering it into. How about posting the code involved in turning that BBCode into HTML markup? And while you're in there, how about giving more detail about that broken image; what URL it has for the src would be a great start.
  3. If you can read it as a CSV then you can get it as an array, with either fgetcsv or str_getcsv depending. Then all you need is a foreach loop.
  4. What have you tried and how did it not work?
  5. Turns out to be a user group restriction that applies to new users. I've moved you to the regular member group - check that one page again.
  6. Then what does it display? Comment out the header() - do you see any error messages?
  7. The best thing is for you to remove the information you don't like (or all of it) from your profile. The settings are over here.
  8. Use the query string: construct your URLs to look like specialprice.php?cardcode=CM000001-Mby doing In specialprice.php you can access the value with $_GET['cardcode']. But don't put it directly into your SQL because anyone could put whatever they wanted into the URL for the "cardcode" and mess up your SQL, your data, and your entire database if they wanted. Instead use prepared statements in place of sqlsrv_query.
  9. Fair point. Then instead $("#payment input:not(:hidden)").serialize()
  10. You can make things easier on yourself by just sending the entire .serialize()d form instead of picking and choosing which fields to include. If you do, make sure to update your PHP because the amount will be called "x_my_amount".
  11. It looks like you're using Javascript (that "prepareForm" bit) to process the form before it gets submitted. That's how the data is being passed to your PHP. So. What's the code for prepareForm? When it constructs the AJAX request to send to your code, does it include the new fields you added?
  12. What's the code that POSTs the data to this page? Because that's where the problem is.
  13. Does the browser show any requests to any pages that aren't HTTPS? Do you have any custom code in place for the upload form, the upload process, or logging in?
  14. Use your browser's "developer tools" or whatever to look at the HTTP request made when uploading the file. Does the browser include a Cookie header with the request that matches the session cookie?
  15. Is the upload page on an HTTPS URL? Is the action of the upload form using an HTTPS URL?
  16. There was a specific part of the docs I wanted you to see, but apparently it's in a user comment and not part of the official documentation:
  17. Hint: 153 + 212 = 365 And clarification: don't do subtraction to fix it (that's not quite accurate) but think about what "direction" the difference uses.
  18. By my math that's 1.6GB, not 8GB. If you don't need them all at once then generate them one at a time. function sampling($chars, $size) { $base = count($chars); $limit = pow($base, $size); for ($i = 0; $i < $limit; $i++) { $combination = ""; $n = $i; for ($j = 0; $j < $size; $j++) { $combination = $chars[fmod($n, $base)] . $combination; $n = floor($n / $base); } yield $combination; } } $chars = str_split('qwertyuiopasdfghjklzxcvbnm1234567890'); $generator = sampling($chars, 5); foreach ($generator as $combination) { // ... }You have to use a foreach on $generator because it will generate each combination as you need it. Not all at once.
  19. - Put vendor/ at the same level as your own directory for classes and such - probably at the top - "public" can be called whatever the hell you want it to be - IMO "src" doesn't make sense for PHP so call it something else - Ignore files that you don't want in source control - Putting public files in a "public" directory is reasonable; symbolic links are a hassle to deploy - If you want to know whether there's a PSR then you should check if there's a PSR - The industry is not consistent
  20. There will be more than 60 million strings of that length. As you generate them, multiple copies of arrays are being held in memory: $combinations and $new_combinations. Add to that PHP's own overhead and I could see you running out of memory... though 8GB seems a bit too much. What are you going to do with this array? Do you actually need all 60M combinations at once or will you work with them one at a time?
  21. What does "corrupt" mean? How are the files corrupted? What is wrong with them?
  22. Take a look at the array_diff_* functions.
  23. Check your firewall. I imagine the data is within $request. Again, not very familiar with React, but I wouldn't expect it to be truly asynchronous. Rather the code would be designed such that execution moves between different pieces of code quickly based on certain conditions - the same way Javascript isn't actually asynchronous but feels that way.
  24. Run it on another machine. Like POST? That's a cURL thing. Use the CURLOPT_POST and CURLOPT_POSTFIELDS options. Having all connections handled within one PHP process. It's all in one script - don't need databases or shared memory or whatever to "remember" data across requests. And you can run each instance on its own port. I don't use it myself so I'm kinda just guessing there.
  25. So you have a MySQL database that contains a copy of all the data stored in SQLite databases which are themselves spread across multiple servers? And you have control over all these servers? Why such a disjointed approach? Why not have just the one database, or perhaps one writable database and multiple read-only replicas? Anyway, this is basically replication so you can take a page from the MySQL playbook: a "version" identifier, such as a plain number. When master or slave has a change it increments the number locally and sends that number with the data to the other server. When the other server receives such a message, it verifies that the number is only one operation ahead of itself and then replays the data change. If the number doesn't match then the two servers are out of sync and you do a full sync (however you'd like to do that).
×
×
  • 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.