Posts by andre_luiss • 433 points
29 posts
-
-2
votes1
answer32
viewsA: How to Scrap a Table and insert the data into the database?
Oops, I advise you to use the library Simple HTML DOM Parser, then you can interact with html much easier, using css selectors, like javascript. In your case, you could use it this way: $html =…
-
0
votes1
answer34
viewsA: input type="time" delete value when checkbox is unchecked
Hello, you can clear the value of input with .val() every time you check the checkbox, it solves the problem $(document).ready(function () { $('input[name=checkmarcacao1]').change(function() {…
-
0
votes1
answer24
viewsA: My php code doesn’t let him log in, (I think it’s because of the $_POST method)
Opa, by the looks of it, in your file 'Login.php' in line 8, vc is doing a validation isset($_POST['submit']), and this condition will always be true, because your form will always send this field…
-
0
votes2
answers51
viewsA: Take json data from php with javascript
Hello, you can convert this data with json_encode() on the php side, move to a javascript object with JSON.parse() <?php $json = json_encode($seu_array); ?> <script> datasets: [{ data:…
-
0
votes1
answer71
viewsA: Assign value from a JS variable to an HTML element?
Opa, you did almost everything right, just need to change the way you’re trying to access the attribute data-var, would be with the method .attr(), q hence you pass the attribute name and…
-
0
votes1
answer48
viewsA: How to call menu inside another file
Opa, yes, with php would be a good one, you can create a reusable "component". Hence would have your file menu.php and would include him wherever he wanted to. But for this to work, it couldn’t be…
-
0
votes1
answer22
viewsQ: Debuggar with fwrite() in PHP
Guys, I came up with the need to consume an API with a very large volume of data, and I need to do this from a language because the API has limitations, and I go from PHP. The problem is that I need…
-
2
votes1
answer84
viewsA: Auto Close Alert after consultation in the Database
Opa, then, there is no way to do that you want, close this Alert that would be in the browser. As reference I took this link in the gringa’s OS:…
-
0
votes2
answers39
viewsA: Click to close all Faq questions, open the clicked question and with another click, close the open question
Opá, then, I think that your problem can be solved by storing the element display in a variable and then a simple if to see if it was open: $(".question").click(function(){ var display =…
-
-1
votes1
answer55
viewsA: Print json in php with titles?
Opa Runo, then, to do this you need to use the function json_decode. But your code is half incomplete, because for you to get the content of this json would be through a file_get_contents for…
-
0
votes1
answer39
viewsA: How do I do a 1-second while Sleep from a json value? PHP
Oops, for you to read a json in php is with the function json_decode, she will interpret the json and return you a object or array. To solve this example of yours, I will use the return of json as…
-
0
votes1
answer116
viewsA: Javascript and css popup window
Opa Nicholas, to solve the problem ai is very simple. As you are leaving static in the function that the popup that will be opened is the id="popup", it will always interact with this element. One…
-
0
votes1
answer39
viewsA: Read id clicked and store in a var to reuse
Oops, from what I saw, you’re going through the event to a function that did not detail what it does, perhaps misspelled. I think a much simpler solution is to reference all these elements by a…
javascriptanswered andre_luiss 433 -
0
votes2
answers29
viewsA: How to return the status "success" and other items in array in wordpress in admin-ajax.php
Opa, from what I saw there in the code you want to catch a json coming from php, it’s quite simple. function getItems(){ //sua lógica para pegar os dados talvez return $seus_dados; } echo…
-
0
votes1
answer126
viewsA: How to Send Data from localStorage via AJAX to PHP and save them to an HTML file
Opa, then, I do not know if I understood very well your need, but for you to send this data saved in localStorage, or any other data, it is very simple using AJAX. $.ajax({ method: 'POST', // seu…
-
-1
votes1
answer38
viewsA: Dropdown menu with two columns?
There’s no way to see the problem there, but a workable solution might be you leave this menu :hover with a hammered width, for example 300px and also display: flex; flex-wrap: wrap and put each…
-
1
votes1
answer37
viewsA: How to invoke the function in HTML
Opa Thiago, for you to display this in html, you need to give a innerHTML in the div you want to display the result. function product(x, y, z) { if (x !== undefined && y === undefined…
javascriptanswered andre_luiss 433 -
1
votes1
answer102
viewsA: Fill Select based on the value of another previous Select
opa Raphael, to solve this is quite simple, but you will need a file .php separate waiting for the first select filter. To do so, you will need to send a request using ajax even, let’s go to…
-
0
votes1
answer19
viewsA: Error in input autocomplete
Come on, you’re trying to pass the variable $valor to the value an input. This is the first error, because the variable will not be the value of the execution of that function, but the string that…
-
1
votes1
answer415
viewsA: Send form without refresh and bring results to the same page
Hello, yes you will have to use AJAX for such task. I saw that you set jquery, so I will use it in this example. Since you didn’t display your form page, I’ll tell you what I think should be done.…
-
0
votes1
answer58
viewsA: Datalist with return of multiple fields in PHP
So to do this you would have to make an asynchronous request through Ajax, passing his due filter. Remember that you are using the "name" field to filter users, and this is not good practice, since…
-
0
votes1
answer650
viewsA: Run python script by clicking html button
I do not know python, but to call a page in the backend without necessarily accessing it visibly, would be making an asynchronous request, through AJAX. I didn’t quite understand your need, but…
-
0
votes1
answer23
viewsA: <Option> inside <Select> selected by default based on variable passed by URL
Hello, to resolve this you can make a comparison function and give an echo in the HTML’s own Selected attribute, example: function selected($valor_variavel, $valor_fixo){ echo $valor_variavel ==…
-
1
votes1
answer31
viewsA: Add values in the field by pressing the 'enter' key and reset these values with the 'reset' button in Javascript
Hello, to reset 'select', you were doing it right but used the wrong variable. It should be: function zerar() { valores.item = '' campo.innerHTML = '' } To call the check function with enter, you…
-
0
votes2
answers50
viewsA: I created a navbar with a form on the side but when I add several inputs in the form the page loses the background
I believe that if you try to use the property min-height instead of 'height' no body can solve, as it will adapt to its maximum content if it exceeds the minimum. Comparison between the two(px will…
-
0
votes1
answer24
viewsA: input with jquery sends value, but php does not query in BD any dirty?
Hello, it seems you are passing the DOM element as a parameter of the post, and not its value itself, which is what we want. Pass it in the function with an object, to make sure that this value will…
-
0
votes2
answers104
viewsA: How to dynamically remove and add HTML class with Javascript
Hello, I don’t know if this is the best solution, but from what I understand about your need, it works. Instead of using class, I used an attribute, which we can easily style and disable via…
-
1
votes1
answer31
viewsA: Php and Javascript - Pass javascript array to Php function on the same page
Good afternoon, it is not possible to pass the javascript data to your php function on the same page without a refresh like this. To do this, you would have to make a request for some file, thus…
-
1
votes2
answers32
viewsA: Save table field to a php variable
If you’re using PDO, it would go something like this: $conn = funcao_de_conexao(); $sql = "SELECT ped_liberado FROM tb_pedido WHERE ped_id = 1267570"; $query = $conn->prepare($sql); $result =…