-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
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.
-
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.
-
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.
-
I don't know. Can you?
-
capturing multiple checkboxes' names when submitting form
requinix replied to ajetrumpet's topic in PHP Coding Help
(coughitdoesnt) -
Undefined variable? Which variable? Is it $brand?
-
capturing multiple checkboxes' names when submitting form
requinix replied to ajetrumpet's topic in PHP Coding Help
<input type="checkbox" name="checkboxes[]" value="whatever you want"> -
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.
-
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.
-
I've used jq when dealing with JSON files from the command line, yes. Relatively simple.
-
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.
-
PHP DOM-Document and XPath : fetch class data
requinix replied to dil_bert's topic in PHP Coding Help
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. -
Forwarding, masking and aliasing with Apache-Webserver
requinix replied to dil_bert's topic in Miscellaneous
You cannot forward the user from example.net/com to example.com/net and still show the old site in the address bar. -
Need help with functions.php file on my wordpress site
requinix replied to kiko12122's topic in PHP Coding Help
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? -
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.
-
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.
-
Upgrading PHP from 7.2.7 to 7.2.24
requinix replied to jbeitler's topic in PHP Installation and Configuration
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. -
Upgrading PHP from 7.2.7 to 7.2.24
requinix replied to jbeitler's topic in PHP Installation and Configuration
If you're the admin then hopefully you remember when you first set up PHP, right? -
Upgrading PHP from 7.2.7 to 7.2.24
requinix replied to jbeitler's topic in PHP Installation and Configuration
You should contact your site administrator to do this. -
Setting option in a select dynamically with PHP
requinix replied to Adamhumbug's topic in PHP Coding Help
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>