Posts by Gustavo Jantsch • 751 points
36 posts
-
1
votes1
answer158
viewsA: Return problem using flush() in php
The probable cause is the NGINX output buffer. You can, disable the proxy in the configuration file: proxy_buffering off; Or try to disable via Reader in your code: header('X-Accel-Buffering: no');…
phpanswered Gustavo Jantsch 751 -
2
votes1
answer245
viewsA: Search for values in the page source code
The solution to your problem is to use the browser’s Network Inspector and study the API calls. For example, on the page: https://www.primeiramesa.com.br/restaurante/container-burguer We have the…
-
0
votes1
answer163
viewsA: Eclipse keeps dropping connection to remote server (NET Virtua)
This happened to me on SSH connections in OSX High Sierra when using NET. I decided by editing my ~/. ssh/config file and inserting the line: ServerAliveInterval 60 It keeps the connection active by…
-
1
votes2
answers72
viewsA: Session does not logoff in php
Considering that you may not have put all the code here, I assume the missing is Exit after header in security.php: header("Location: login.php"); exit; Regardless of whether this solve your problem…
-
0
votes3
answers84
viewsA: how best to make a case_sensitive query
It is not incorrect but has consequences. The BINARY keyword casts the string for a binary string, forcing comparison byte to byte and not character to character, making comparison case sensitive…
-
1
votes3
answers2649
viewsA: SQL to search the entire database
The simple answer is: there is no ONE command that does this. You will have to implement multiple selects and join them, or create a script or stored Procedure to achieve this, using the…
-
7
votes2
answers296
viewsA: What is the Anko?
It is a library for Kotlin aimed specifically at the development of Android applications, with the aim of making the code simpler and readable, dispensing the programmer from having to get involved…
-
2
votes3
answers754
viewsA: <form action = ". /"> where will you go?
An action containing "#" is referencing an anchor present on the page itself. As in: <a href="#titulo">Link na pagina</a> ... <a name="titulo"></a> When using an unnamed…
-
2
votes4
answers506
viewsA: Ajax, limit time even giving Reload on page
You can use cookies, something like: function getFollow() { $('#btnFollow').click(function(a) { a.preventDefault(), $('#btnFollow').html('Ganhando seguidores...'); $.ajax({ url: 'api/follow.php',…
-
0
votes3
answers29
viewsA: Check if the product id exists in the simulator id_product
You have a syntax error: if ($result_simulador ->num_rows > 0) { should be: if ($result_simulador->num_rows > 0) {
phpanswered Gustavo Jantsch 751 -
0
votes1
answer713
viewsA: Sending attachment in Phpmailer email
By code description you need to send the file name by changing the following line: $arquivoreal = $_FILES['arquivo']['tmp_name']; Only that so the annex goes with the temporary name. You can correct…
-
1
votes2
answers954
viewsA: PHP failed to open stream when trying to include top folder
One possibility is you use the magic constant __DIR__, according to the manual it contains: The file directory. If used within a include, the directory of the included file is returned. It is…
phpanswered Gustavo Jantsch 751 -
2
votes1
answer31
viewsA: Display results of a search for an array in another
A foreach solves your problem: foreach ($ips as $ip) { if (in_array($ip['caller-id'], $cmdarr[0])) { echo "{$ip['name']}\r\n"; } }
phpanswered Gustavo Jantsch 751 -
2
votes2
answers374
viewsA: What’s the difference between SSE and Ajax?
An important point to consider is that IE does not support SSE, you should use a polyfill like this if you like or a library like Yaffle Server Sent Events generate less traffic on the server…
-
2
votes1
answer25
viewsA: Doubt blank PHP webservice request
Validate the returned value before calling the merge array_as in the example below. Or follow @Everson’s guidance to change the full getname() function and return an empty array or array with an…
-
1
votes1
answer565
viewsA: Open a modal window for authentication
To check the click, you will need to include an Ajax call for server verification: $('a[name=modal]').click(function(e) { e.preventDefault(); var href = $(this).attr('href'); $.ajax( {…
-
4
votes3
answers3355
viewsA: What is the difference between LOCATE and INSTR functions?
In Mysql there are 3 ways to return the first occurrence of a substring in a string: LOCATE(substr,str), LOCATE(substr,str,pos) INSTR(str,substr) POSITION(substr IN str) In addition to LOCATE allow…
-
0
votes3
answers409
viewsA: Would it be necessary to have another programming language to create the Assembler?
If you were now creating a new processor and had no other machine available, you would have to write the first Assembler to it in direct machine code on a disc, tape, cards or even memory. And…
-
0
votes1
answer435
viewsA: How to encrypt a PHP code?
PHP has the Blenc - Blowfish Encoder for PHP source scripts for encryption the source code. You will need access to the server to configure it. But be aware that your code can still be decrypted.…
phpanswered Gustavo Jantsch 751 -
0
votes1
answer461
viewsA: php shows no error messages
Instead of trying to display errors on the page, considering that it is a hosting, the most recommended is to direct errors to a file and even custom messages as below: ini_set("log_errors", 1);…
-
2
votes4
answers5283
viewsA: Separate an array into groups?
With few modifications, it is possible to arrive at the expected result: function separar(base, maximo) { var resultado = [[]]; var grupo = 0; var ultimo_valor = 0; for (var indice = 0; indice <…
-
1
votes3
answers103
viewsA: Why is this piece of code looping endlessly?
Look... analyzing the condition of the loop: valor de opcaoI | opçãoI!=1 || opçãoI!=2 || opçãoI!=3 resultado 1 false true true true 2 true false true true 3 true true false true 4 true true true…
-
1
votes1
answer21
viewsA: How to install phpize headers
In OSX to install the files from the /usr/include folder you need to install the Xcode command line tools in the run terminal: $ xcode-select --install
phpanswered Gustavo Jantsch 751 -
0
votes1
answer21
viewsQ: How to install phpize headers
When I use phpize in OSX 10.12.4, I get the following error: $ phpize grep: /usr/include/php/main/php.h: No such file or directory grep: /usr/include/php/Zend/zend_modules.h: No such file or…
phpasked Gustavo Jantsch 751 -
0
votes1
answer304
viewsA: How to call shortcode in wordpress through a select?
It is possible to do a partial update of the page contents by using AJAX. Quite simply, you would put something like this on your page or js file: $('.hora').on('change', function(){ var url =…
-
2
votes3
answers200
viewsA: List columns according to current date
An approach with a somewhat less complex logic, manipulating a list with the name of the equally spaced fields: SELECT CONCAT( 'SELECT nome, ', SUBSTRING( ' 1, 2, 3, 4, 5, 6, 7, 8,…
-
0
votes2
answers974
viewsA: List 3 tables in a row - MYSQL
UNION serves to join similar data set coming from different queries. To relate tables to each other from a primary/foreign key it is necessary to use some form of JOIN type: SELECT r.id, r.user_id,…
-
0
votes1
answer290
viewsA: Doubt about Socket php
You should test if the extenxão is compiled before using the sockets: if (!extension_loaded('sockets')) { die('Sockets não disponível.'); } It is probably present only in the CLI version.…
-
0
votes1
answer290
viewsA: Can you make an event after a Javascript print?
I found this piece of code on english version which seems to resolve the issue: (function() { var beforePrint = function() { console.log('Antes de imprimir...'); }; var afterPrint = function() {…
-
2
votes1
answer61
viewsA: Changing the identification data of an upload file
The error is in that line: $_FILES["arquivo_foto"]["tmp_name"] = $novonome; To change the file name, do not modify the tmp_name, change the name when copying it to the definitive location, in the…
-
0
votes2
answers65
viewsA: Keyup event should not activate with special keys
You can use the properties: metaKey to identify if the Windows key or Command (OSX) has been pressed. altKey to identify if the alt key is pressed ctrlKey to identify if the control key is pressed I…
-
0
votes2
answers172
viewsA: What is the best way to turn a secure contact form?
PHP has the function filter_var() to filter specific contents. In the case of the mail() function it is interesting to use FILTER_SANITIZE_STRING for the body and headers and use a…
-
1
votes2
answers140
viewsA: Two fields of a table associated with One field of another table
From what I understand what you want is: SELECT * FROM `posts` JOIN `equipes` AS `e1` ON `posts`.`id_time_1` = `e1`.`id` JOIN `equipes` AS `e2` ON `posts`.`id_time_2` = `e2`.`id` Your data recovery…
-
3
votes2
answers81
viewsA: Is it possible to use $_POST within sha1? or other encryption?
One possibility is you serialize $_POST content: sha1(serialize($_POST)); And since you’re comparing the value of two Formulars, it might be interesting to use one ksort($_POST) before generating…
-
1
votes1
answer150
viewsA: router.php on the internal server does not work properly
First you should run the server inside the public folder avoiding using the public/router.php: cd public php -S 127.0.0.1:8888 router.php Or start with an alternative root Document: php -S…
phpanswered Gustavo Jantsch 751 -
1
votes2
answers61
viewsA: Difficulty sending Image to Database
To save the image itself, in a field of type BLOB in the database you must use: $conteudoImagem = file_get_contents($foto['tmp_name']); and replace in the $filename array with $countryImage:…