Posts by Luís Henrique Faria • 582 points
23 posts
-
0
votes1
answer614
viewsA: Block file download via PHP script
If I understand your question correctly, you are afraid that someone on your team is intentionally putting security loopholes in your application that allow outside access to sensitive information.…
-
1
votes1
answer173
viewsA: Application without Back-end
It is safe for multiple users to keep their tokens stored in cookies? It is important to look at security recommendations that involve keeping session identifiers - and similar data - in cookies. In…
-
0
votes1
answer173
viewsA: Detect Smartphone back button
What you can do is use the history API (https://developer.mozilla.org/en-US/docs/Web/API/History_API). When you open the modal would be like entering another page, then the back button of android…
-
0
votes1
answer579
viewsA: Google Maps API - Exceeded request quota
You must not have activated the billing in your account, only the "embed map" is free now (the one you use with an iframe). For more information, visit this help page, which gives information on how…
-
0
votes1
answer542
viewsA: Update status by observing the date change
I don’t think you have much of a choice when it comes to using an interval. What you can do to decrease the number of executions (even you don’t have as many features as this being used, so you…
reactanswered Luís Henrique Faria 582 -
0
votes1
answer36
viewsA: How to create a file if it doesn’t exist?
On Node, you can do the following: const fs = require("fs"); const file = "/home/user/Documents/foo.json"; if (!fs.existsSync(file)) { fs.writeFileSync(file, JSON.stringify({hello: "World")); } The…
-
0
votes1
answer183
viewsA: Problem catching Json in AJAX
What is happening is that you are holding a string in your hands and treating it as an object. Do it this way: data = JSON.parse(data); console.log(data.nome); // data["nome"] funciona também, mas a…
-
3
votes2
answers601
viewsA: What is the difference between map() and lenght()?
Then, the map function will scroll through the array and send as parameter to the callback you provide each element of this array. Its return is a new array with the callback return you defined. The…
-
2
votes2
answers584
viewsA: Doubt regarding the structure of the Docker-Compose.yml file
Usually you create networks in Docker when you want to better control how your containers will communicate with each other - which one you can chat with, use the host name instead of the IP etc.…
-
2
votes1
answer627
viewsA: Send POST file with php using file_get_contents
To make requests with POST method, you need to use the stream_context_create. See documentation of the file_get_contents. Note that in the comments there are examples of use. Let’s see an example of…
-
3
votes2
answers166
viewsA: Error trying to recover $_GET value in Submit
You need to remove "disabled". The value of a "disabled" field is not sent along with the form data. If you need to display it, try to leave readonly. If you do not need to display the field, you…
-
1
votes2
answers88
viewsA: Group a set of measures in PHP
You can concatenate the columns representing the dimensions and group the data: Table: create table test.pedidos ( id_pedido int auto_increment primary key, comprimento float null, largura float…
-
0
votes1
answer484
viewsA: How do I read and store response data from an API?
They returned a JSON to you, it seems. You read the data as a normal object. For example: <?php echo $objeto->MerchantOrderId; // output: 2014113245231706 To save, it depends on what you are…
-
1
votes1
answer50
viewsA: Automatic scroll on browser output
Because the data is in the client, you need to do this with Javascript. You have other options: Paging (show less records); Reverse ordering, this way the items that would be in the footer stay at…
-
3
votes1
answer197
viewsA: How to find out which folder the user uploaded?
I understood that you want to delete the file after the user uploaded it. Right? Assuming that yes, you you won’t be able to do this. When the user does upload, you get a copy of that file and do…
-
0
votes1
answer267
viewsA: Get multiple checkbox tag values
Let’s imagine that you have the data with the following structure (I will use json for being simpler to write): json [{ "id": 2, "name": "xpto", "date": "2014-11-11" }, { "id": 3, "name": "xpto2",…
-
1
votes1
answer356
viewsA: Configuring Vagrant for Small Teams
Item 1: I imagine you are using a version control mechanism, correct? You can place the configuration files inside your application’s repository. Whenever any team member clones the repository (or…
-
3
votes1
answer343
viewsQ: How to reference the original software in a modification?
I am creating a package for Laravel based on code that uses the BSD license (https://github.com/reactjs/react-php-v8js/blob/master/ReactJS.php). How exactly should I reference it? Should I keep the…
licenseasked Luís Henrique Faria 582 -
3
votes2
answers2174
viewsQ: Sort results by a relationship column in Laravel 4
Currently I have some methods that used together allow me to make requests to my application controlling the "withs", "Orders" and such via querystring. I can do, for example: GET…
-
3
votes1
answer93
viewsQ: Extender Resource Controllers
I’m doing what I want in a way and I’m looking for alternatives or better ways to do it. I am using Resource Controllers in my application. I am also using softdelete in several models, so my routes…
-
4
votes2
answers14385
viewsA: Payment in installments via Pagseguro
Pagseguro does not make installments in the ticket. What you can do is use PHP Boleto (http://boletophp.com.br/) and generate a billet for each parcel. This library is simple to use.…
phpanswered Luís Henrique Faria 582 -
1
votes3
answers633
viewsA: Problem to use Gulp
I managed to solve the problem. The nodejs in the Elementary OS repository (based on Ubuntu 12.04) is an older version, not compatible with Gulp. Hence I had upgraded Node, using the official PPA…
node.jsanswered Luís Henrique Faria 582 -
3
votes3
answers633
viewsQ: Problem to use Gulp
Look at this, I’m starting to use the Gulp started a project on my work computer and everything worked correctly (Elementary OS). Now at home the Gulp does not work well (also Elementary OS). When I…
node.jsasked Luís Henrique Faria 582