Posts by Leonardo Negrão • 1,096 points
55 posts
-
4
votes1
answer30
viewsA: Select in Mysql sorted by the WHERE condition
Hello, you can use so, where it is very practical including adding values dynamically: SELECT id, nome FROM table WHERE id IN (2,1,4) ORDER BY FIELD(id, 2,1,4) I hope I’ve helped…
-
1
votes1
answer59
viewsA: Refresh page when an XML refreshes (Shout cast)
Good morning, all right? I see basically two ways to do this: Separate PHP from HTML and make the request by AJAX to update the information; for example, you can make the request every 30 seconds to…
-
1
votes2
answers1348
viewsA: How to close the menu by clicking on the links?
Congratulations on your success, but I invite you to improve your code with the suggestion below: //eventos do botão principal e mudar imagem ao fechar $(".btn-menu").click(function(e) { //como…
-
0
votes1
answer31
viewsA: Pick id dynamic value - Jquery
The problem there is related to the manipulation of the DOM; remember that the Id of an element can never repeat; so in that situation you can work with the classes to identify the elements. I made…
-
1
votes2
answers340
viewsA: Hide elements but display some child elements with Javascript or Jquery
Jquery is a good solution for this problem. In general, your problem is in manipulating the elements; I made an example below with manipulations through the identifier, class and attributes using…
-
-1
votes2
answers71
viewsA: position elements on a grid
Your problem is in relation to property padding CSS, below some guidelines: if you add only one value, so padding:25px; the value will be assigned to all sides of the element, ie: top, right,…
-
0
votes1
answer51
viewsA: Check a single item in the PHP database
Just read a line with fetch_assoc and use it later in what you want <?php $login_email; $login_senha; $sql = "SELECT idCliente FROM CLIENTES WHERE dsEmail='$login_email' and…
-
0
votes1
answer105
viewsA: Infinite preloader
You are using a code that needs the Jquery library and did not add it. Add it before this script you need it; you can use a CDN font <script…
-
2
votes1
answer82
viewsA: Select with different behavior on mobile
The phone may be processing the select element so the click is beyond the DOM, try Troquar $("#refriQuestion").click(function () { For $("#refriQuestion").change(function () { Thus, linking Event…
-
0
votes1
answer13
viewsA: Ajax updating another request
There are several ways to do this; one of them is using .append() This way the UI is processed all on the client without needing to data-driven , however, if the registration returns false, it is…
-
-1
votes1
answer107
viewsA: How do I upload a web application (html and css) to a local server?
the HTML, CSS and even JAVASCRIPT (used in front-end) are compiled by your browser (e.g.: Chrome, Firefox, Edge...); so you can simply drag your HTML file to the browser it will open and the…
-
0
votes1
answer180
viewsA: How do I dynamically return data from Mysql columns in each update form input?
To fill in the fields dynamically, that is, without reloading, you need to use javascript. And the first step is to better understand the DOM to correctly mark their respective fields, see the…
-
6
votes2
answers87
viewsA: Change attribute of an element without identification
Yes, in many ways, for example in your code: Using the find() jQuery to find one beaseado element in another: $( "#panelFormula" ).find( "span" ).css( "background-color", "red" ); <script…
-
1
votes0
answers28
viewsQ: What is the performance curve of the file that will consume an Xmlhttprequest via GET according to the date volume sent?
I wonder if there is a date volume with better performance in a Xmlhttprequest request via GET or if the performance is always directly proportional to the date amount var request = new…
-
0
votes2
answers36
viewsA: Select separate data from two tables excluding repeated ones
For repeated data, it is already the concept of GROUP BY , here is explanation and great examples:https://www.w3schools.com/sql/sql_groupby.asp in your SQL, to group everything by SKU, just use…
sqlanswered Leonardo Negrão 1,096 -
3
votes2
answers186
viewsA: How to make a video start and restart automatically?
Not beautiful but effective solution: document.getElementById('vid').play(); <video controls src="https://ia800701.us.archive.org/26/items/SampleVideo1280x7205mb/SampleVideo_1280x720_5mb.mp4"…
-
1
votes2
answers322
viewsA: Doubts regarding a large string bursting the table td tag
Amanda, add the CSS attribute overflow-wrap: break-word; in this specific field, look at an example of how it works below: div { width:50px; border:1px solid red; } a { overflow-wrap: break-word; }…
-
0
votes1
answer246
viewsA: mailto attribute does not open
good, first of all, there is nothing wrong with your code and it can be tested below: What I added and can help you is a "hack" to check the event "Blur window" as soon as triggered the event…
-
1
votes1
answer43
viewsA: Doubt about CDN(Content Delivery Network)
Before your answer specifically I suggest you read the related topics on CDN: Creating a CDN - content delivery network ; CDN vs. join JS/CSS among others, but here are very interesting…
cdnanswered Leonardo Negrão 1,096 -
1
votes1
answer87
viewsA: I’m trying to figure out the size of a downloadable file on an external server
Your url has a white space at the end, just switch to $url = 'http://200.152.38.155/CNPJ/DADOS_ABERTOS_CNPJ_01.zip'; that will work. I left an example test for you:…
-
1
votes1
answer189
viewsA: How to take the value of an sql record and store in PHP variable
the registration column, which is your primary key, is your primary key, is of the type varchar ; then your SQL needs to receive strings and not integer, as your example. The corrected code:…
-
2
votes2
answers164
viewsA: How do I create a theme for the same textarea as VS Code?
to transform your <textarea> in a code editor, you need a Text Editor, like these examples: https://codemirror.net/ https://ace.c9.io/ Each of them has their implementation guide, a basic…
-
1
votes2
answers146
viewsA: Return all checkboxes unchecked via jquery
Hello, the cleanest solution I got was this: $('#enviar').on('click', function(e){ e.preventDefault(); var arr = []; $.each($("input[name='sticker']:checked"), function(){ arr.push($(this).val());…
-
3
votes2
answers105
viewsA: How do I treat a jQuery array (remove duplicates and prevent an item from appearing in 2 arrays)?
I’d do something like this, I hope it helps //DEFINE ARRAYS like = new Array(); notlike = new Array(); opiniao = new Array(); //crie um novo array para guardar ambos $(".btn").on("click", function()…
-
0
votes1
answer282
viewsA: Change input color in HTML page
To change the color of the border again, you can use LSE and apply the same color or even paint green, for example, to show that it is correct. In the code below, I put in the name as an example…
-
1
votes1
answer37
viewsA: Starting with Javascript
Hello, it’s a matter of understanding how to find the error; if you use the Chrome browser, for example, you can Inspect Element by pressing Ctrl+Shift+I and access the Console tab to find…
javascriptanswered Leonardo Negrão 1,096 -
0
votes1
answer73
viewsA: Make image preview by changing the background-image of the div
function readURL(input) { if (input.files && input.files[0]) { var reader = new FileReader(); reader.onload = function(e) { $('#capa').css('background-image', 'url(' + e.target.result +…
-
0
votes1
answer60
viewsA: Post does not go up to php file (php + html - Can’t find the error)
no error on line 3, but I found 4 errors in your code: The name on line 62 does not print the value of the variable, but its name $nome The email, also on line 62, does not print the value of the…
-
3
votes1
answer246
viewsA: How to insert Html into XML?
Yes, it is possible, just use CDATA: https://en.wikipedia.org/wiki/CDATA Example: <xml> <title>Your HTML title</title> <htmlData><![CDATA[<html> <head>…
-
1
votes1
answer52
viewsA: Hide "PROFILE" in the Phpmyadmin view tab
You pressed the selection not to display?
-
-2
votes2
answers230
viewsA: What is the best tool to perform a Javascript integration with Mysql?
I will leave my opinion here as an answer, since it is not a specific question. Answer: PHP backend to work with Mysql I’ll give you four reasonable grounds: Mysql has a great tool for managing the…
-
1
votes3
answers292
viewsA: Set title with echo in PHP
The code needs to be .php , probably is .html and a semicolon is used at the end of the command as good practice, thus: <title><?php echo 'Rodrigo'; ?></title>…
-
1
votes2
answers33
viewsA: Number formatting
<script> var number = 12.0; var intnumber = Math.floor(number); alert(number); </script>
-
1
votes1
answer146
viewsA: dompdf does not display Georgia font
Buddy, how I fix this, maybe it’ll help you 1) I look for an equivalent when the source is paid, Georgia is registered by Microsoft, for example, but this free is very similar:…
-
-1
votes1
answer38
viewsA: button + link help and
I did the editing of your code (always ask with relevant snippets of code written) and just by rewriting your code has already worked: <div class="section"> <h2>Login</h2> <form…
htmlanswered Leonardo Negrão 1,096 -
0
votes1
answer63
viewsA: Status with jquery
$('.tag').hide(); // esconde todos os status var status = "SignatureCanceled" ; // adicione aqui o status desejado $('#div-status'+status).show(); //complete o id do div desejado com sua variável…
-
1
votes2
answers112
viewsA: How to update number of users online with PHP + jQuery
in the first place, what you really need is to have a reverse communication with the server, using for example Nodejs, in this way, the server warns by broadcast the "news", in your case, the amount…
-
1
votes1
answer346
viewsA: Check if there is a parameter in the URL by PHP
first check if it exists, so: if(isset($_GET['source'])) { //existe source? $param = $_GET['source']; } else { //se não existir source, $param terá outro valor $param = ""; }…
phpanswered Leonardo Negrão 1,096 -
1
votes2
answers74
viewsA: Doubt in Data Normalization
I believe that the best would be: table vehicles: remains identical table pieces: remains identical table Breakdowns: You need to build a relationship and the first questions are: 1) A vehicle may…
-
-1
votes1
answer562
viewsA: check if file is image or video with JS or JQUERY?
Good evening friend, I had a similar problem and this solution helped me: https://www.aspdotnet-suresh.com/2012/12/jquery-validate-file-upload-extension.html I adapted to your need below basically…
-
1
votes2
answers107
viewsA: Javascript + HTML return in a field
Just like that: /** * Botão Submit */ document.getElementById("btnSubmit").onclick = function() { var radios = document.getElementsByName("band-rock"); for (var i = 0; i < radios.length; i++) {…
-
1
votes1
answer39
viewsA: Editable table with Jquery and PHP problem
Hello, I believe your problem lies in the scope of the DOM tree. When you upload a website, a DOM tree is generated and the insertion of later HTML fragments will not be in this tree and will not be…
-
1
votes1
answer458
viewsA: Get $_GET value with friendly url
tried to manipulate the directories in . htaccess? I already needed the following situation: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^/?([A-Za-z0-9-]+)?$ arquivo.php?busca=$1…
-
0
votes2
answers170
viewsA: I can’t keep my footer down
Hello, as you are using only Divs with "position:Absolute", just you set the attribute "margin-top" with the total height value of the other contents, I did this example:…
-
4
votes2
answers571
viewsA: How to remove public from url
you are correct about the .htaccess ; because it is he who controls the distribution and directory names of apache, the server that will compile your php. To rewrite urls, you need to use htaccess’s…
-
1
votes1
answer32
viewsA: Blocking options when selecting link in mobile version
good afternoon, from what I understand from your question, you need to use JS to customize an event, in case, the longer "tap" event. With jquery it is very practical to "give Trigger" this type of…
-
0
votes3
answers6902
viewsA: Ajax request with Error Failed to load Resource: the server responded with a status of 500 (Internal Server Error)
Hi, I’ve answered something similar, this is the link and the answer below, I hope it helps: More specific error 500 Creating an asynchronous version and asking PHP to show errors: #início do…
-
0
votes1
answer49
viewsA: Capture action from a form on a button
Hello, the problem is that HTML is poorly formatted in general. Try to follow patterns by not mixing HTML with CSS and metatags always in the head. The button must always be contained in the ; it…
-
6
votes1
answer566
viewsA: More specific error 500
Hello, I always go through this and I usually solve like this: Creating an asynchronous version and asking PHP to show errors: #início do arquivo error_reporting(E_ALL); ini_set('display_errors',…
phpanswered Leonardo Negrão 1,096 -
-1
votes4
answers104
viewsA: Hover does not work
Exchange the to for div; I believe that to does not have characteristics that make it possible to do this as the div. I saw it here http://jsfiddle.net/zEJVK/6/ .cp-Thumb:Hover . cp-Hover {…