-
Posts
15,274 -
Joined
-
Last visited
-
Days Won
432
Everything posted by requinix
-
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. -
What kind of variables do you want? Where did they get their values?
-
I thought you said that you wanted to expand a node after filling in the tree. That isn't an event: you have code to fill in the tree so add a bit of code after that happens to expand the node.
-
It's weird you mention that because the very same documentation you couldn't find says that's exactly what you're supposed to do. Could it be that your question isn't so much "how" but rather "why does this method call not work"? Where are you putting that code? Where did "node" get defined? Any errors in the browser's console?
-
someone show me why this code doesn't submit data into my db table
requinix replied to simbae's topic in PHP Coding Help
You've fixed things but you haven't fixed things. Like these: if(isset($_POST['d_name'])){ } if(isset($_POST['manner_death'])){ } if(isset($_POST['place_death'])){ } if(isset($_POST['nok'])){ } if(isset($_POST['rel_nok'])){ } if(isset($_POST['morgue_att'])){ } What are those doing? Nothing. They don't do anything. Then you have if(isset($_POST['tag_num'])){ if(isset($_POST['treatment'])) The first line makes sense, but the second? Without a pair of { } then it will only run the very first line of code that comes after: the assignment for $d_name. Then in your query, $query = "insert into data ( d_name, manner_death, place_death ,nok, rel_nok, morgue_att, tag_num, treatment) values ( '$d_name'.'$manner_death','$place_death','$nok','$rel_nok','$morgue_att','$tag_num','$treatment')"; you managed to fix the one syntax error but you created a new one. You cannot create websites by putting code in your editor and hoping everything will work. You have to make actual, conscious, deliberate decisions about the code. You have to know what different pieces of code mean. You have to understand why code is what it is and then how you can use it to accomplish what you want. So before you try to write more code, stop and take a few days to learn what you can about PHP. Then come back to this file and put some thought into each line of code in it.