Posts by Diego Vieira • 1,807 points
111 posts
-
1
votes2
answers45
viewsQ: Let div with height auto and with the bottom set
Is there any way to leave the div with the bottom set without it leaving the height: 100%? While there is little content (as in the example), the height should stay auto, but when there is enough…
-
1
votes2
answers28
viewsA: jQuery rereading in Select
When you use the append, will always add new results without affecting the previous. What you need to do is remove the previous ones before adding new results.…
phpanswered Diego Vieira 1,807 -
1
votes2
answers308
viewsQ: Sort by larger ID and group the similar
How can I list the records by ordering by the latter, but when you have the field related filled, bring the other records with that same value? The general idea is to make a order by id desc and…
-
3
votes1
answer173
viewsQ: Detect Smartphone back button
Is there any way to detect when the physical button comes back from smartphone is clicked? I need it to close one modal. I thought there might be a matching number like on the keyboard and use the…
-
1
votes0
answers21
viewsQ: Find file that generated CSRF TOKEN error
I set up the file handler for whenever any error occurs on the server, I receive an email with the details. So today I got an email with the following error: array(3) { ["message"]=> string(0) ""…
-
0
votes1
answer88
viewsQ: Images compressed with Imagick fail Pagespeed test
What parameters can I add to Imagick to improve image compression? Even with that code, PageSpeed of Google continues to accuse that images need reduction. $image = new…
-
1
votes1
answer119
viewsQ: Image upload with Imagemagick
Using the library Imagick, it is possible to load an image directly from the upload? That is, without first having to move it to a folder and specify the path in the Imagick. I’m trying this way,…
-
1
votes1
answer78
viewsA: Eloquent does not return the same results as SQL
In case someone also can not compare the columns of query main with those of the subquery, was resolved as follows: It is necessary to exchange the where for whereColumn. This is a method used…
-
1
votes1
answer78
viewsQ: Eloquent does not return the same results as SQL
I have that code SQL which when running straight into the bank works normal, but I had to convert it to the format of the Larable. It runs, but returns no results. Where am I wrong? It seems that…
-
2
votes3
answers121
viewsQ: Select the first result of each conversation
How can I select the first line of each conversation from a specific user where the to_id = 1. The big problem is when the first message exchanged from the conversation does not have the top_id = 1…
-
2
votes0
answers170
viewsQ: Convert sql into eloquent
How can I convert this code sql in the eloquent? SELECT CONCAT(FLOOR(sum(diferenca)/60),'h',MOD(sum(diferenca),60),'m') as tempo FROM (SELECT TIMESTAMPDIFF(MINUTE, m1.created_at, min(m2.created_at))…
-
0
votes2
answers131
viewsQ: Store array within Cookie
It is possible to store a array within a Cookie? I’m trying this way: $carrinho = array(array('frete' => '', 'mercados' => array())); Cookie::queue('carrinho', $carrinho, 525600); But the…
-
1
votes0
answers281
viewsQ: Laravel: Access Relationship Attributes
I have the tables products, images, products_images. The table products_images has a foreign table key products and images. When I will list the products and the names of the images that are in the…
-
1
votes0
answers337
viewsQ: SEO: the site description does not appear on google
When I search my site on google appears the message: There is no information available for this page. To get the description, I’ve already put the tag meta description in the header and my…
seoasked Diego Vieira 1,807 -
0
votes1
answer11006
viewsQ: JSON request: CORS Access-Control-Allow-Origin header error
I need to make a JSON request to Payu, but show me the message: Blocked cross-origin request: Same origin policy (Same Origin Policy) prevents reading the remote resource on…
-
2
votes1
answer487
viewsQ: Lock site vertically
How can I prevent the contents of website stay horizontal when the user turns the phone? Would you have any solution to viewport or Javascript?
-
0
votes5
answers349
viewsA: Event by pressing the button
Unfortunately none in the answers ended up working on mobile. The only thing he solved was using the plugin Jquery Finger, which is made especially for this. I’m leaving the link if someone goes…
-
0
votes5
answers349
viewsQ: Event by pressing the button
Would there be any way to detect the touch pressed on a button? The code works normally on desktop, but when will I test in mobile does not act. Use the Jquerymobile is not an option. var timeout =…
-
0
votes1
answer495
viewsQ: "<<<<<<< HEAD" in the middle of the code after merging
I went to make merge between the branch develop and master and some conflicts appeared, but I ended up solving it. The problem is that I saw two files in which have <<<<<<< HEAD…
gitasked Diego Vieira 1,807 -
0
votes3
answers96
viewsA: Compare inputs with the same class and no id
I check if the last typed field is in column 1 or 2 and depending on which one, I use the attribute next() or prev() to compare the entered value with the one in the opposite column.…
-
2
votes1
answer46
viewsA: I only get a checkbox in my database
To register all fields marked, you need to leave the inputs as arrays, and then go through the variable to insert each one. Follow the modifications made to your code: HTML <input type="checkbox"…
-
0
votes4
answers1294
viewsA: Hide or display HTML table line with Jquery
When selecting an item from select it will hide the table row that has the same data-uf. If I misunderstood your question, let me know that I change my answer. $(document).ready(function() {…
-
0
votes1
answer34
viewsA: Send form without the browser alert
In case someone goes through the same problem, I was able to solve by inserting before the redirect the following code: window.onbeforeunload = null;
-
1
votes5
answers6090
viewsA: Autofocus: position the cursor at the end of the value
You can store the value current in a temporary variable, then set the value to empty, and then set again to the temporary variable. Example: <input type="text" name="p" autofocus value="teste"…
htmlanswered Diego Vieira 1,807 -
0
votes2
answers155
viewsA: Reset Form after Upload
You can use the function reset of Javascript: function submitForm() { var form = document.getElementById('form'); form.reset(); return false; } <form id="form"> <input type="text" />…
-
0
votes1
answer108
viewsQ: Separate data from multiple forms with Formdata
It would have been possible to send some formularies at the same time with Formdata? For example, each product will have sizes and images. It would have to separate each product into an array and…
-
0
votes1
answer293
viewsQ: Input file as append in Formdata
How can I insert images like append in a Formdata? I’m trying this way, but when I use the console.log to verify the variable dados, the imagens is empty. var dados = new FormData();…
-
0
votes2
answers917
viewsA: Selecting previous CSS element
Only with CSS is it not possible to do this. With Jquery would look like this: Note: The name of your class exibir-detalhes was under a different name in your html and css, so I left both with the…
-
0
votes1
answer34
viewsQ: Send form without the browser alert
I’m submitting a form with JS and after everything goes well, I redirect the page as follows: window.location.href = '/admin/lojas/produtos'; The problem is that always appears the alert below and…
-
0
votes1
answer99
viewsA: how to compare two matrices and bring different values?
You can use the function in_array, where she will check if the value is not within the array (in your case, it would be the information coming from the bank). // Armazena os dados vindo do banco em…
phpanswered Diego Vieira 1,807 -
1
votes2
answers35
viewsA: Apply properties to an element only if it belongs to a class
Inform the element along with the class you want it to belong to. Example: li.teste { color: blue; } a.teste { color: red; } <li class="teste">Teste</li> <li>Teste</li>…
cssanswered Diego Vieira 1,807 -
0
votes2
answers81
viewsA: php - upload multi images to same field
I believe that the issue is not the code itself, so I will focus only on logic. When you go through the image variable with the foreach, you compare their position with the variable $key. Then in…
phpanswered Diego Vieira 1,807 -
1
votes1
answer524
viewsA: How to close a modal by pressing the "ENTER" key
That way, the event keypress will be monitoring whenever any key is pressed, and when it is the enter (code 13), will close the modal. $(document).ready(function() { $(document).on('keypress',…
-
0
votes1
answer667
viewsA: Popular select from countries and states with php mysql ajax
When selecting a country, you need to make an appointment with ajax in the file you make the select in the bank to list the states. In that file I left the id of the parents as $_POST['pais'], but…
-
1
votes1
answer1636
viewsA: Floating box with CSS and HTML
Basically two are created Divs, which is responsible for darkening the content and which is between the content of the page and the modal. And the other that will contain the information. function…
-
2
votes2
answers63
viewsA: How to apply two validations at the same time?
I put a each in your code, so it will go through the two inputs and place error messages at the same time. This makes code more dynamic and easier to maintain. $(document).ready(function() {…
-
1
votes1
answer261
viewsQ: CSS menu closing when clicking on the inside items
I made the following menu on css and opening/closing is working normal, but when I click on some item of the submenu, the menu closes before redirecting. Would have some way around that problem?…
-
0
votes2
answers1244
viewsA: Change the color of an image in css (jquery)
To change the image color, you can use the attribute filter. $(document).ready(function(){ $('img').css('filter', 'brightness(0.3)'); }); <script…
-
0
votes0
answers96
viewsQ: Laravel 5.2: DB:raw in relationship
I need to access the table avaliações and make a calculation to calculate the grade of each product. I tried that way, but the field nota raised in the DB:raw does not appear when I try to access…
-
3
votes3
answers99
viewsQ: Best practices for setting up the IF condition
It has been a while since I have the following doubt: would it have any difference of performance between declaring a IF in these two ways? Or even if there is no difference in the question of…
phpasked Diego Vieira 1,807 -
5
votes1
answer71
viewsA: How to prevent content from a div Edit together with the css Rotate effect?
Just put a negative spin on the div of the content, in your case would be -5deg. .minha-div { -webkit-transform:scale(1.5) rotate(5deg); width: 100px; height: 100px; border: 1px solid red; margin:…
-
1
votes1
answer76
viewsA: Load dynamic content in navbar
Yes, no need to use AJAX for that. The Laravel has a function called view composer, where it is possible to do exactly what you need. I will give a brief summary of the two files needed and leave…
-
0
votes2
answers41
viewsA: How do I display a new INPUT as per the user’s previous response?
You’re gonna need JS for this. Leave the questions hidden and show it according to the value of the field radio. function novaPergunta(value) { if(value == 'SIM') {…
-
0
votes3
answers51
viewsA: Check if phone field is equal
Take the value of each input and compare them as follows: HTML <form method="post" action="" id="form"> <input type="text" name="tel1" id="tel1" /> <input type="text" name="tel2"…
jqueryanswered Diego Vieira 1,807 -
0
votes2
answers113
viewsQ: Detect click on the same dynamic and non-dynamic item
When I click on the item, the function changes the class this item so it can be detected by the other function when clicking. The problem is that when I use the .click, the click is detected…
-
1
votes1
answer47
viewsQ: Use find field returned to add more results in the same query
In the code below I look for a product and take the field "related" it to make a search in the bank bringing all the products (including himself) that have the same value in this field. It is…
-
1
votes1
answer564
viewsQ: Pass image array in Formdata()
I need to add a array of images on FormData, but only the first image is passing. I know the problem is in the code JS why when I send the form directly to the page php, works normal. Javascript var…
-
3
votes1
answer75
viewsQ: Merge two arrays
I have the arrays: $tamanho = ['P', 'M', 'G']; $quantidade = [1, 3, 5]; The end result would have to stay that way: $final = [ ["tamanho" => 'P', "quantidade" => 1], ["tamanho" => 'M',…
-
2
votes1
answer203
viewsQ: Play gradient of the image
How can I generate a gradient as in this image? As she has more of a tone of the same color, I’m not able to leave equal. .box { background-image: linear-gradient( to right, #ff7a2d, #ff507b );…
cssasked Diego Vieira 1,807 -
1
votes2
answers4611
viewsQ: Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
A few days ago when I changed the version of PHP from the server and went to restart the apache, then showed me the error: (98)Address already in use: AH00072: make_sock: could not bind to address…