Posts by Paulo Martins • 771 points
22 posts
-
1
votes2
answers453
viewsA: Ways to use Curl with PHP?
Usually HTTP requests are performed via browser, which naturally provides several HTTP Headers within the request. The use of the word need It’s complicated, because it depends more on the…
-
9
votes2
answers6999
viewsA: What is generalization and specialization?
Nothing better to explain this as an example, see below: Veiculo { function locomover() function parar() function ligarLanternas() } Carro extends Veiculo { function travarPortas() function…
oopanswered Paulo Martins 771 -
0
votes1
answer280
viewsA: Change the status (online/offline) in the bank when closing the page
Probably the most viable alternative is to use some key bank/value for this, such as the Redis or memcache. In these banks, there is usually the option of timeout for the database registration, then…
-
0
votes3
answers590
viewsA: Image Border within Select Radio after choosing an option
It is possible to solve the problem only with CSS even if HTML has a tag label referencing radio Node. * { transition: all 0.5s ease; } input { visibility:hidden; } label { display: block; width:…
-
3
votes1
answer163
viewsA: GIT with multiple remotes in one project
I think it is not so interesting to work on two projects on 2 remotes. (And if I understood the case, the project To has only 1 remote, while the project B has both). It is possible to use only 1…
-
3
votes1
answer50
viewsA: Help with function organization
Some tips that can help you: Notice your problem, and break the solution abstracting roughly the data stream. Create a function responsible for handling and adapting to your system the variables…
-
4
votes2
answers3880
viewsA: What is the unless command for in Ruby
In a nutshell it is an otherwise if, where it executes the content within the conditional case the condition don’t be true. Example: #!/usr/bin/ruby x = 1 unless x == 2 puts "x é diferente de 2"…
-
18
votes1
answer10486
viewsA: What is the difference between the PUT method and the PATCH?
In a nutshell, the HTTP methods PUT and PATCH are used to indicate a data change request. Generally, when using the PUT, it is legible that the change of the data will be with reference to the…
-
0
votes2
answers1575
viewsA: how to place content from another blog (the posts) on my wordpress site (ex : last posts)?
There are some alternatives to solve your question, but some that will be listed may not be as effective, but may be useful, depending on the case. Alternatives: API’s: It is the most suitable…
-
1
votes2
answers148
viewsA: What does this line mean? --> $.ajaxSetup({ scriptCharset: "utf-8" ,contenttype: "application/x-www-form-urlencoded; charset=UTF-8" })
These are just ajax connection settings containing specifications on the type of charset and content that will be routed in HTTP request. To better understand the arguments defined in this function,…
-
0
votes1
answer96
viewsA: jquery - capture content from all Divs with a set class
From my understanding of the situation, the first step towards the solution will be to take all the elements with the class "agenda-day" and iterate them trying to individually obtain the status of…
-
7
votes1
answer4090
viewsA: What is a 3rd Party and what is its importance for traditional application development?
3rd party or third party is nothing more than the use of third party components, ie some software or lib that someone else created, and that can assist in its development.…
terminologyanswered Paulo Martins 771 -
2
votes2
answers4702
viewsA: Doubt about json_encode and json_decode
JSON is only a structured file writing format, that is, it is an equivalent alternative to xml or csv. Generally, the JSON format is used for information traffic between API’s restful,…
-
0
votes2
answers496
viewsA: Combobox with 5 minute interval with PHP
PHP natively already has a class called Datetime, and with it it is possible to perform several manipulations on the created date object. With the help of another resource called Dateinterval, it is…
phpanswered Paulo Martins 771 -
1
votes3
answers640
viewsA: How should an error page (404) behave?
On the 404: Well, let’s say the code 404 is just an HTTP protocol response code that notifies systems and API’s about an invalid search within that system. (TL; DR: Wrong URL address inside that…
-
0
votes2
answers365
viewsQ: How to change the format of a query result?
I would like to know if there is any argument in select that changes the format of result to be used as dump. Example: create table `table_name` (`id` int, `value` text); insert into `table_name`…
-
2
votes1
answer570
viewsA: How to feed real-time notifications while logged in?
When it comes to an application developed for the web, there is no way out. The only ways to create updates for the client are: Create business rules on the client’s own computer (Solution in case…
-
1
votes3
answers1230
viewsA: Return ajax data with php
Web frameworks usually load the site template by default. So to return a json you need to check the documentation for the framework version of your project, and add a rule in the class that renders…
-
1
votes3
answers222
viewsA: Check if there are equal fields in a form
I’d do it this way: Example: function validSelectsValues() { var domSelects = 'Seus selects aqui'; var selected = []; $(domSelect).each(function() { if($.inArray($(this).val(), selected)) {…
-
1
votes5
answers375
viewsA: Make <a> change href=" button on each new visitor ( IP ) on a given page
I strongly recommend that you follow the advice of the above comments and use a database, but only by science can you use scandir (http://php.net/manual/en/function.scandir.php) to get the last…
phpanswered Paulo Martins 771 -
1
votes2
answers220
viewsA: Jquery problem in handling ajax data coming as array
Do you have access to PHP code? The best (and simplest) way to handle this data is to prepare it for javascript using the function json_encode($array);. Now otherwise you will have to use regular…
-
1
votes1
answer362
viewsA: How to schedule time-based tasks (Cron) using PHP ?
So, PHP is a language that only collects and processes the data providing a result, so it doesn’t have native cron functions and you shouldn’t even try to cheat it out of it. (That is, it processes…