Jump to content

requinix

Administrators
  • Posts

    15,229
  • Joined

  • Last visited

  • Days Won

    427

Everything posted by requinix

  1. Don't print both? Seriously, you've given me a tiny bit of code way out of context. I can't do much with that. If you want to do some basic validation with just Javascript then that's fine, but if it fails validation you don't then submit that to the server.
  2. Still here. Still don't have anything to add other than you need a Docker container with PHP version 7.2.
  3. No. Validating on the user's computer means telling it what to do and hoping that it happens. You must validate on the server, and you may validate on the client too. That sounds like a good reason to not only do validation on the client. Because your code and/or design is flawed. Handle it in whatever way you want as long as it works the way you need it to work.
  4. What I was originally thinking turned out to not be possible (I was thinking of two concurrent iterators), so my answer is basically "whatever works" now. So, as long as you're not approaching your memory limit, I would stick all the string blobs from cURL into an array or ArrayObject, wait until cURL completes, then give that to JsonMachine. That's almost what you're doing now, except you're doing string concatenation and that can potentially hurt performance by a lot because every time you append a string PHP has to reallocate a new one in memory to hold everything and then copy the old value into it. An array/ArrayObject uses slightly more memory because of the overhead but doesn't come with the costly memory management.
  5. cURL doesn't expose its streams. JsonMachine accepts an iterator. Use CURLOPT_WRITEFUNCTION to receive some number of bytes from cURL, feed that into an iterator, and give the iterator to JsonMachine.
  6. I don't know. Can you?
  7. Undefined variable? Which variable? Is it $brand?
  8. <input type="checkbox" name="checkboxes[]" value="whatever you want">
  9. Correction: some upload to a server-side script that then places the file in a destination folder, and some upload to a server-side script that then places the file into a database. If you only have one server then store in a folder. It's just easier to work with. If you have multiple servers and a shared storage space then I personally would still store as a file, and if not then use the database.
  10. I'm sorry but as a policy we do not delete accounts or posts, with obvious exceptions like for spammers, and when required to by law (ie, for EU residents). If you're concerned about personal information, all we have is what you've provided - and it appears you haven't provided anything. We don't mind if you just, you know, not use your account.
  11. I've used jq when dealing with JSON files from the command line, yes. Relatively simple.
  12. One option is to dump the response to a temporary file and use something like jq (which I think operates on a stream, not a full document) to extract pieces of the JSON.
  13. I ignored everything in your post after the first few lines because it looked like unnecessary background information irrelevant to the question. $node is an object. You cannot simply echo it. Do something else.
  14. You cannot forward the user from example.net/com to example.com/net and still show the old site in the address bar.
  15. PHP requires that opening tags have at least one character of whitespace after them. Or be at the end of the file.
  16. Thank you for including code, but how about telling us why you're doing all this? What problem are you having? Why do you think this code is responsible?
  17. Look at what you call the element thing in the session according to the first bit of code, then look at what you call it in the second bit of code.
  18. Varies. You're venturing into the territory of frameworks like React and Angular: the tag is managed as an object in code, then rendered into the table as a row. You can meet it halfway by embedding the tags as objects separately, like {{ tags|json_encode() }} in a script. The modal code can read the data from those objects instead of pulling them from the source. (Remember to update the edited object too.) Then the problem is getting the objects to the modal, which should be easier to deal with. Otherwise you're basically stuck pulling the data from the source. Or else loading the modal through AJAX where the server can return the modal template.
  19. Well you're going to need to take a crash course in learning your site's PHP and server configuration. Because if you attempt this upgrade and aren't aware of something important the site needs, you'll crash it. You need to know what configuration changes have been made from the base and what extensions are enabled.
  20. If you're the admin then hopefully you remember when you first set up PHP, right?
  21. You should contact your site administrator to do this.
  22. Is that the question? How to make a particular one the default? Add the "selected" attribute to the default <option>. Which you have to determine on your own. <option value='(role_id)' selected>(role_name)</option>
×
×
  • 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.