Posts by Everton Neri • 680 points
36 posts
-
-2
votes1
answer45
viewsA: Retrieve specific part of a javascript object in an AJAX function
You are making $.each incorrectly $.each(data.data, function(index, value){ $("#album"+cont+"").append('<img src="'+value.cover_medium+'"/>'); cont++; });
-
1
votes1
answer70
viewsA: Algorithm does not enter Catch (Try/catch)
The problem is you misspelled Exception catch(Expection $e) the correct would be catch(Exception $e)
-
1
votes3
answers385
viewsA: Calculate values in sub array [PHP]
This simple change solves your problem $valor = array(); //array items foreach($items as $key => $res) { //sub-array com valores do item foreach($res as $k => $val) { //retornar valor somado a…
-
1
votes1
answer287
viewsA: Handle Response Curl with PHP
As you did not put your code, I will briefly illustrate here a possible solution $response = curl_exec($ch); $retorno = json_decode($response, true) echo $response["id"];…
-
11
votes1
answer54
viewsA: Return only a part of the PHP variable
You can use the function explode along with end $imagem = "D:\Web\data\localweb\sites\site.com.br\crm\748064485.jpg"; $cut = explode("\\", $imagem); echo end($cut);…
phpanswered Everton Neri 680 -
0
votes2
answers109
viewsA: Extracting Infos from an external JSON by php
A simple solution is to use file_get_contents <?php $json =…
-
0
votes2
answers57
viewsA: how to consult by month?
A simple way to do this is by using only sql itself SELECT dia FROM caixa WHERE MONTH(data)= MONTH(NOW()) ORDER BY id DESC
-
2
votes1
answer35
viewsA: How to get a searched value in a PHP string?
Yes, it is possible. $pagina = "<!DOCTYPE html> <html lang='pt-BR'> <title>Pagina</title> <meta charset='UTF-8'> <div class='conteudo'> <div class='valor'>…
-
0
votes1
answer58
viewsA: How to group products by id and sum the total quantities of each product coming from a php json array?
Test the following code: $json = json_decode('[{"id_produto":"768","qtd":8,"valor_uni":"5.00","produto":"MODA COM CATUPIRY"}, {"id_produto":"750","qtd":2,"valor_uni":"4.00","produto":"COCA-COLA…
-
6
votes1
answer180
viewsA: Problem sending JSON by ajax to PHP
Your code has some errors if ($_POST) The ideal was to check if all the parameters you need have been filled in if(isset($_POST["usuario"], $_POST["senha"])) That part is also incorrect $user =…
-
0
votes1
answer411
viewsQ: Enable jQuery Validate (plugin) with the ajax response
I always found interesting this plugin, as it leaves the form simple with subtle messages to the visitor. I decided to implement and falls into the following dilemma: How do I get back my AJAX to…
-
-1
votes1
answer55
viewsA: Confirmation email with password_hash
The error is in your Query. using MD5(id) works because mysql has this function implemented. You can do the following: encrypt the value of the user id and then compare the generated hash to the…
-
1
votes1
answer963
viewsQ: Draw with different percentages
I have a "box open" system, which works as follows: The box can have X items (as much as you want) where each item will have Y% to be earned, being: # or #.1% (no more decimal places) That is: the…
-
1
votes1
answer188
viewsA: Maximum size of Qrcode
Not understood very well, you want to know how much storage a QRCODE can contain? if yes Numeric - max. 7089 characters Alphanumeric - max. 4296 characters Binary (8-bit) - max. 2953 bytes…
qrcodeanswered Everton Neri 680 -
0
votes1
answer22
viewsQ: Average mysql with multiple conditions
I am mounting a graph containing the amount of CHATS that were answered in a given time, example: 1-30s -> 20 chats answered 31-60s -> 66 chats answered 60-120s -> 4 chats answered I’m…
-
0
votes1
answer199
viewsA: How to concatenate two strings and save the result in a variable?
As per your example: $proxy = $json->ip; $porta = $json->port; $full = $json->ip.":".$json->port; echo $full; outworking: 127.0.0.1:80…
-
0
votes1
answer379
viewsQ: foreach in javascript for an error json return for a single registry
I’ve got a very boring problem and I don’t know why Through an ajax request, I get from the server the notifications that the user has not yet viewed (similar to facebook) For this, I use the…
-
1
votes2
answers579
viewsA: Ajax request from multiple Forms, with javascript function
You can also do this way // monitora todos os formularios que NÃO contenha a classe "noajax" (formularios com essa classe não são enviados fica ajax) $('form:not(.noajax)').on("submit",…
-
2
votes0
answers64
viewsQ: Correct way to work with Composer in php
Hello, I really like php and for some time I’m using the concept of MVC in my application, but without using Composer and its autoloader. In search to elevate my knowledge, I installed the same and…
-
1
votes3
answers1183
viewsQ: Ajax only returns if I put an "echo" instead of "Return" in php
I am building an application using ajax (jquery) and php, when returning a json by php, jquery only takes the value if I have given an ECHO, if I return json through Return (I am using a function in…
-
1
votes1
answer255
viewsQ: How to remove the project name from the Java Servlet URL
I have a question and I’ve searched all over the internet and I haven’t found it, how the hell do I get the name of the project from the url in java? ex: http://localhost:8084/MeuProjeto/login for…
-
2
votes2
answers103
viewsA: Simplify value comparison on an input
That should solve your problem: var nomes = ["Everton", "Joao", "Rodrigo"]; var campo = $("#nome"); if (nomes.indexOf(campo.val()) > -1) { alert("Encontrou"); } else { alert("Não encontrou"); }…
-
1
votes1
answer853
viewsA: Field 'data_log' doesn’t have a default value - Does not insert data into the database
This happens because mysql-Strict is configured on your server, so the data_log field cannot be empty when you are entering the data. You can disable mysql Strict this way: set @@global.sql_mode='';…
-
1
votes2
answers81
viewsQ: Search all records that exist in another table at least once
Hello, I’m having trouble making the following query: I have 3 tables: user_categories, main budget and orcamentos_new When a user creates a budget, the system creates a record in main budget with…
mysqlasked Everton Neri 680 -
-2
votes5
answers1258
viewsA: How to open a new background tab and redirect the current tab?
Something like: <a href="javascript:void(0)" class="meusSites" data-site1="http://google.com" data-site2="http://youtube.com">2 url</a> And you: $('.meusSites').click(function(e) {…
-
1
votes2
answers294
viewsA: Start function by Onclick
Change this <script> $(document).ready(function( ) { $.repeat(1000, function() { $.get('automacao_tela.php?ajax&s=<?=$randomSession;?>', function(data) { $('#tail').append(data); });…
-
0
votes1
answer53
viewsA: session comparison with a php database field
I don’t understand very well, do you want to take only the emails of the student in question? (What is logged in?) If it is, try to do something like: $consulta = "SELECT titulo, data, aluno FROM…
phpanswered Everton Neri 680 -
1
votes1
answer73
viewsQ: each of jquery does not find "TR" dynamically added to table
Hello, I have a table where the first TR of it is fixed containing some inputs to search Assunto | Data | Categoria input1 | input2 | input3 item1 | item 1 | item 1 Where this item 1 is added…
-
0
votes1
answer98
viewsQ: Ajax request parameter being a variable
Hello, I have a little doubt on how to do this: $(function(){ $("input").keyup(function(){ var tipo = $(this).attr("name"); var text = $(this).val(); $.ajax({ url: "minhaurl", data: {tipo: text},…
jqueryasked Everton Neri 680 -
0
votes1
answer43
viewsQ: Regrouping repeated items from an array
Good afternoon. Currently I have a dynamic form where the person can add the following values: Category | Title | Description What I do so far: I take each line ((int) Category/ (string) Title /…
phpasked Everton Neri 680 -
-3
votes4
answers874
viewsA: Manipulating JS odds when using Math.Random()?
I didn’t understand it very well, but if the goal is to be more conducive to a result, you can do it this way: if(valor > 7){ // 30% de chance de cair aqui }else{ // 70% de chance de cair aqui }…
-
0
votes1
answer309
viewsQ: Correct semantics to make an entire div become an anchor
Hello, I have a simple question (I believe). In the image below, I would like anywhere I click redirects itself to the X link preserving the semantic web, without putting the entire div inside a…
htmlasked Everton Neri 680 -
1
votes1
answer44
viewsQ: Group data from different tables and join in a modal those from the same group
Good afternoon! I’m having a problem on how to think of something effective. I have two tables: budget and budget: Soap Inks Bags All these records have the id_orcamento associated to the table…
-
0
votes2
answers196
viewsA: Field 'Hash' doesn’t have a default value
Try using the command set @@global.sql_mode=''; This will disable Strict mode. can also change through my.ini. search for sql-mode and delete what’s in quotes "" If you change in my.ini you will…
-
0
votes1
answer30
viewsA: Display data from a table summing a specific column
$q_soma= ('SELECT SUM(value) AS result FROM sales GROUP BY data'); Switch to: $q_soma= ('SELECT SUM(value) AS result, date FROM sales GROUP BY data'); With all the changes made, you get something…
-
0
votes1
answer676
viewsQ: Error while uploading files to Ubuntu with PHP
Hello, I’m using a simple file upload system with PHP and some problems will arise regarding the necessary permissions to use in Ubuntu It’s the first time I’m using the same, with the Webmin tool…
phpasked Everton Neri 680