Posts by Bruno Rigolon • 3,282 points
130 posts
-
3
votes3
answers2287
viewsA: Remove created image-div spacing
Just add the positioning of the image: Use this css for .box-img > img: .box-img > img { width: 100%; height: 100%; vertical-align: middle; } Simply put, just add this line of code in .box-img…
-
1
votes1
answer267
viewsA: Automatic form search using data from a string
This would be an example to check if the number is filled, if you have, simulate the click on your button that queries the Webservice. The check is in 60 seconds, if you want to change to 4 seconds…
phpanswered Bruno Rigolon 3,282 -
4
votes3
answers438
viewsA: Build circular menu in css
I made this example below basing myself in this code. I believe I am very close to what you need. What you have to change is the menu 5 to have a background image and not color. ul.menu { margin:…
-
1
votes3
answers651
viewsA: sessionStorage with expiry time
Instead of working with visualizado, you will need to work with hora. So you can do the programming to validate how much time it should be displayed. I removed your variable "viewable" and added the…
-
1
votes1
answer100
viewsA: Use an array as a key for another associative array
Follows a way to create the structure you quoted, commented code: <?php // Item para ser o indíce no novo array $keys = array( "nome", "cargo", "email" ); // Valores... $values = array(…
-
2
votes2
answers5959
viewsA: Enable and disable fields by clicking checked
I put an example below your code with the correct logic. This way it works as you wish. The problem is that at the click of checkbox you always pass as "yes". onclick="desabilitar('sim'). Whether…
javascriptanswered Bruno Rigolon 3,282 -
3
votes1
answer3375
viewsA: Wordpress - defined limit
Search for the php.ini file and configure the upload_max_filesize. Possibly, he will be in /etc/php5/apache2/php.ini. If not, try to locate or find. Inside php.ini, configure the items below to…
-
1
votes2
answers463
viewsA: Separate string variables json
Hello. First of all you will use json_decode, after that you have an object with the desired properties. Once you have them in hand, you can access via object or externalize the variables as…
-
2
votes3
answers63
viewsA: Reorder variables by throwing the blanks to the end
uasort — Sorts an array using a user-defined comparison function and keeping associations between keys and values. See an example of how to use based on your question: <?php // Definição dos…
phpanswered Bruno Rigolon 3,282 -
5
votes2
answers42
viewsA: Create a name for a variable with php
The problem was occurring in the $$table[1], at this point PHP tries to define the index of an array that doesn’t exist yet, you need to put around the variable chaves for PHP to understand that…
phpanswered Bruno Rigolon 3,282 -
4
votes2
answers1804
viewsA: Sort list with Vue
As recommended by Vue documentation, use a computed property and library Lodash. Documentation link. In the example, I put according to the documentation, I left commented the code and also inserted…
-
2
votes3
answers45
viewsA: Click UL to A
Below I put the code and comments for the action you need. But I do not recommend to do this, because within ul you could have several "a". In this case, it could generate inconsistency in the…
jqueryanswered Bruno Rigolon 3,282 -
0
votes2
answers123
viewsA: Jquery does not run on the first page load!
Try to do it with pure javascript, see what happens: document.addEventListener('DOMContentLoaded', function(){ request_guides(); }, false); If it doesn’t work out, let me know to remove the answer.…
-
0
votes1
answer133
viewsA: Vuejs with Vuetable2
Bug fixed in version v1.6.5. Note, for those using version 1.6.3 you will be under this bug
-
1
votes2
answers152
viewsA: how do I delete a wordpress category from google results?
Another option, and I think it’s simpler, is to add a file called robots.txt to the root of the site. Inside this file put: User-agent: * Disallow: /nossos-clientes This tells all robots not to…
wordpressanswered Bruno Rigolon 3,282 -
3
votes3
answers36
viewsA: String handling at alternate positions
Follows regular expression and explanations: <?php /*...*/ // Busca pela linha onde tem o Service Id, está com ignore case, então pega maiúscula e minuscula. Depois, procura por um número que…
-
0
votes1
answer58
viewsA: Count True values in an Object
Just make a loop and count the items, with the foreach you can. See how it turned out: <?php $object = (object) array( 'data' => (object) array( 44 => (object) array( 'id' => 3.5795,…
-
2
votes2
answers324
viewsA: Query_post , pick up taxonomy by custom post field
If I understood your question, because it is very strange, it seems that you want to redeem the value of the meta field, for that, would be enough the following code. <!-- Quando está dentro do…
-
1
votes2
answers4656
viewsA: How to make a DIV disappear after a few seconds
Your code was missing the inclusion of jQuery. Your correct code would look like this: <?php include('server.php'); //se não estiver logado, não consegue aceder a esta página if…
-
5
votes3
answers370
viewsA: Sort phone numbers in a string
Hello, use the function usort, with it you define a function that validates the order, the return of this function should be -1 or 1. It is applied in arrays to perform comparison. See how it would…
-
2
votes2
answers485
viewsA: Find and remove words from multiple arrays
Hello! You can use the function str_ireplace, with it you do the substitution with ignore case. See an example of getting the expected result: <?php $bad_words =…
-
1
votes2
answers264
viewsA: I cannot enable GZIP cache and compression on my website. Why?
I strongly recommend to optimize the images, one of the items that gives the most punctuation is to have the images optimized. I recommend using the site Tinypng. In case you use Wordpress, you can…
-
3
votes2
answers925
viewsA: Using $this in POO PHP
Utilize $this to refer to the object itself. Another option would be self, but this makes reference to the class itself. Simply put, the $this->variavel is for non-static methods, the…
-
2
votes3
answers1036
viewsA: problem filling in form with uppercase letters
Before adding to your database, convert the string to lowercase. I put the short example of how to convert in PHP and Java Script to lowercase (minute letters). In PHP: $string = "TESTE"; echo…
-
2
votes3
answers165
viewsA: Do not echo an empty Row IS NOT NULL
Try to use the function empty. The function Empty returns FALSE for all items below: "" (an empty string) 0 (0 as an integer) 0.0 (0 as a floating point) "0" (0 as a string) NULL FALSE array() (an…
phpanswered Bruno Rigolon 3,282 -
4
votes3
answers691
viewsA: How to correctly format a monetary value?
Remove the stitch and R$. <?php $moeda = "R$ 1.500,95"; // Com str_replace (Remove a string 'R$ ' e '.' $valor = str_replace( array('R$ ', '.'), '', $moeda); echo $valor; //1550,95 // Com…
-
0
votes2
answers196
viewsA: modal appears when entering the page instead of waiting to be clicked
Put it like this: <div id="modal" style="display:none">. So the modal will not be displayed when the page loads and will be triggered only when there is the click on the button.…
javascriptanswered Bruno Rigolon 3,282 -
2
votes1
answer133
viewsQ: Vuejs with Vuetable2
I’m trying to use the Vuetable-2 sending the information via props data. I searched several sites, tested and nothing worked, including found this example in the format I need, but it doesn’t work…
-
1
votes2
answers1042
viewsA: Combobox and mask of Cpf and cnpj
Follow my collaboration. I usually use this way in my projects. In select, I put a data-target-id to reference where I want this item to affect and, I urge by the class the event change. When there…
-
1
votes1
answer18
viewsA: I have a problem with this slideshow
It turns out that the images are being downloaded at the moment when the CSS changes the frame. Add this code to the page just to ensure that the images are already loaded and thus avoid that when…
-
1
votes1
answer226
viewsA: Problem with namespace and include
The correct form would be: <?php namespace controllers; // Deve ser a primeira linha do arquivo e não se deve abrir chaves include "fpdf/fpdf.php"; class Control { /*...*/ public function…
-
1
votes1
answer762
viewsA: Generate thumbnail video in php
According to this reply in the English OS, you must install the FFMPEG. Once installed, just use the following code: <?php $frame = 10; $movie = 'test.mp4'; $thumbnail = 'thumbnail.png'; $mov =…
-
0
votes2
answers651
viewsA: pass js value to another page in the action form
One solution is to use localstorage, it’s very simple, just run the command below via javascript: // Na página do formulário localStorage.setItem("variavel_js", "Valor da sua variável"); // Na…
-
5
votes1
answer752
viewsA: perform sum of values codeiginiter
The simplest suggestion would be to generate the sum at the time of the loop: $total = 0; // Antes desta linha, adicione a variável acima foreach ( $orcamentos as $orcamento ) { // Adicione depois…
-
1
votes1
answer17
viewsA: Doubt: Google Analitycs JS runs on PHP file_get_contents?
No, because this happens on the server side. What happens with the PHP process, Google Analitycs will not be able to obtain any data. After finishing the PHP process, the output is sent to the…
-
6
votes2
answers66
viewsA: What is the purpose of & in PHP?
The difference between using and not using & is that with & a reference is made, you will be using the same variable in memory, even if the variable name is different, if you change one,…
phpanswered Bruno Rigolon 3,282 -
2
votes2
answers337
viewsA: How to treat error when deleting a BD record, which has a foreign key, PHP
It turns out that CI does not work very well with Try Catch, one way is to disable debug for queries, which returns this error on the screen and validate it with the tools themselves. A solution…
-
3
votes1
answer6157
viewsA: How to host website on my pc
Use the software NO-IP. Register on the site, choose an external host name, example my-home.sytes.net, install the software on your computer and access the software with your beliefs. Once accessed…
-
2
votes1
answer450
viewsA: Save visit cookie to page
You can work with cookies, set the time needed for it and when it expires, you add +1 to the counter. It would be the following code: // Define em horas quanto tempo vai durar cada cookie $hours =…
-
0
votes3
answers1394
viewsA: Several different carousel with owlCarousel
Hello, an important item, you must enter the class Owl-Carousel. Not necessarily need to work with ids, it can be with classes as well, but each class will have its configuration. Below, follow the…
-
3
votes4
answers8192
viewsA: How to exclude an item from an array by the attribute value?
I advise to use the lib Lodash to manipulate Java Script. This core-only compressed lib is 4kb. Has several features to handle items in javascript, always use in my projects, recommend. ;) With him…
javascriptanswered Bruno Rigolon 3,282 -
3
votes2
answers1161
viewsA: How to get the days of the current working week of Sunday/Monday
I did the following way, I take the current day, I go back to the date for the first day of the week and I make the loop until Sunday. There was the following code: <?php $translate = array( 0…
phpanswered Bruno Rigolon 3,282 -
6
votes4
answers1413
viewsA: Know what day falls next Monday
Follow the example code for next Monday from a date: $dia = new DateTime( '2017-06-01' ); $dia->modify( 'next monday' ); echo $dia->format('d/m/Y'); // 05/06/2017 Link to view the test Catch…
-
1
votes2
answers560
viewsA: accentuation problem when saved in the database
Set the charset utf8 on the PDO connection. Your connection string would look like this: "mysql:host=$host;dbname=$db;charset=utf8" If you are using an old PHP version, this command is ignored, then…
-
0
votes1
answer51
viewsA: Fixed error navigation bar when using Carousel
Add this css to force it not to be fixed on mobiles: @media (max-width:480px) { .navbar-fixed-top { position: initial !important; } }
-
0
votes2
answers31
viewsA: System does not add and edit, just view
Try to make this change, see if you will enter the records. // Arquivo # models>marcas_model.php // Altere isto (function adicionar) $data = array( 'nome' => set_value('nome'), 'descricao'…
phpanswered Bruno Rigolon 3,282 -
3
votes1
answer752
viewsA: Avoid unnecessary spaces in textarea with standard text
Via javascript, you could do it this way: $(function() { var textareas = $('textarea.clean'); $.each(textareas, function(key, value) { $(this).val($(this).val().replace(/[ ]+/g, ' ').replace(/^[…
htmlanswered Bruno Rigolon 3,282 -
2
votes2
answers173
viewsA: Simple XML Reader does not work properly
A very simple solution that returns your XML as a PHP array: <?php $xml = '<boutique><produto…
-
2
votes1
answer185
viewsA: Chat PHP How to Use?
Inside the Tawk.to panel you have the option to, display only in the domain (you must inform in the panel) or, leave open. Go to Dashboard as administrator, go to the Administrator -> Domain…
-
1
votes3
answers181
viewsA: Enable contenteditable="false" tag for "true" with javascript
Using jQuery, it would be in the following example: $(function() { $("#btn-editar").on('click', function(e) { $('.texto').attr('contenteditable', true); }); $(".editar").on('click', function(e) {…