-
Posts
15,227 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Why use MATCH AGAINST when you could just use LIKE?
-
How you pass the user depends a lot on the architecture of the site code. Current user information is often a singleton/registry, which means not passing $users anywhere, but if you need to perform operations on any user (logged in or not) then yes, you'll be passing user objects around.
-
If your query is hard-coded without any variables then it should be trivial to verify the syntax. If you go with prepared statements then you can easily verify their syntax too. When you do that, the "only" reason any of these queries would create errors would be with larger problems: server is down, database doesn't exist, table has the wrong columns, etc.
-
You've spent "months" and "years" trying to understand Composer and never found out about composer require?
-
You may have made a mistake by requiring that $user. In fact I think you did because that's kinda weird to do. But it's quite possible you could reuse $user and just have it be null for anonymous sessions. Also, asking questions about specific code tends to go better when you post specific code.
-
Try removing the session_start() and see what happens. Also try reading the documentation for sessions and session_destroy() to see what PHP says you should be doing.
-
repositioning elements relative to the element in which they reside
requinix replied to TechnoDiver's topic in CSS Help
If you want the new DIV to be below the .comment-meta then (1) give that new element a class like how the others have classes, then (2) since you're using flex, apparently, tell CSS that you want the .comment-meta to take up the whole line it's on and the buttons will be forced onto the next one. -
Adding Code to enable CC/BCC in a Contact Form
requinix replied to chome4's topic in PHP Coding Help
See how all those new inputs are named "email"? That's not good. The name is how PHP knows which field's value to get so they all need to be different. Also the IDs, for that matter. IDs must be unique on a page. When those are fixed, post what you have (so we can see the new names) and then try adding some PHP code to get those values. It will be a couple lines that look very much like the lines to get the other fields' values. Give that a shot and post what you come up with so we can add them into the email message. -
Adding Code to enable CC/BCC in a Contact Form
requinix replied to chome4's topic in PHP Coding Help
Have you added those fields to the form yet? What does the HTML look like? -
Would be nice to know what answer you found. Can I assume it's JSON.stringify + json_decode?
-
Adding Code to enable CC/BCC in a Contact Form
requinix replied to chome4's topic in PHP Coding Help
And what email address are you trying to add as CC? Or is it BCC? -
You're only giving the barest description of this "added numerous times" deal. Does that sort of pattern happen for every other (different) line in the file too? In the same way? Are they repeated the same number of times? Is each distinct line repeated always consecutively or are they ever mixed? Any discernable pattern? Any breaks in that pattern?
-
"[object Object]" is something created by Javascript, not by PHP. It's what happens when you try to treat an object like a string. Are you sure conn.send can take any argument type? Or, perhaps, must it be a string value?
-
Do you see the same line multiple times sequentially? Or are the bunch of lines repeated as a group?
-
Adding Code to enable CC/BCC in a Contact Form
requinix replied to chome4's topic in PHP Coding Help
Would be nice to see some code... How will the code know what email address should be added in? -
Try to understand what the code is doing when it comes to sending API requests to MailChimp. It's sending a certain request body right now which is not entirely correct. You need to modify that body it's trying to send to be more correct. So some questions for you to answer include "how am I sending API requests?" and "what and where is the request body?".
-
You have an $operations array but there needs to be an "operations" in the request body too. As in the body looks like a PHP array of ["operations" => $operations]
-
There might be some fancy Javascript method, but barring that, you need to have some part of the page that does not change when clicking on links or whatever. For the most part, websites nowadays solve that with the majority of the site served through a Javascript frontend - rather than browsing to site1.php and site2.php and whatever like normal, the browser is told to request those files in the background and then Javascript places it into the page. It looks like regular navigation, to some degree, but the browser never actually "leaves" the first page. Frames can still work, though. There is a way to communicate between the different frames: https://developer.mozilla.org/en-US/docs/Web/API/Window/postMessage
-
array_map doesn't pass the array key. You could call it with two arrays (the first of values and second of keys) but that would reindex the array. array_walk with the value by-reference would work. As would a simple foreach loop.
-
PHP: How to read/ parse JSON so I can style the text in HTML
requinix replied to Zorglub's topic in PHP Coding Help
You already have a thread for this. -
Assign values from the range [.....N] to the vertices of the graph
requinix replied to RohanH's topic in PHP Coding Help
OP has requested that this thread be locked due to school policies regarding assignments. -
PHP: GET JSON from URL and structure it in HTML
requinix replied to Zorglub's topic in PHP Coding Help
The first step to putting it into HTML is describing what "put it into HTML" means to you. Or in other words, describe your problem in a way that someone who knows absolutely nothing about you or your application would be able to understand.