Posts by Jader A. Wagner • 4,921 points
176 posts
-
3
votes2
answers148
viewsA: How to insert the ID in the database since it is the first field of the table?
No doubt it is better to declare the names of the fields according to the reply of wryel, even to not need to obey the exact order that is in the table. But for the sake of information, it would…
-
7
votes4
answers2028
viewsA: Identifying common snippets in two PHP strings
I created a function that compares segments of strings and returns the same words in an array: function palavras_iguais($string1, $string2, $minlen = 5) { $strlen1 = strlen($string1); $strlen2 =…
-
5
votes2
answers1160
viewsA: How to access JSON values from ajax in a PHP page?
The estate dataType refers to the type of data expected from the server, so only use 'application/json' if you want to return the answer as json... To access the POST directly without going through…
-
1
votes2
answers278
viewsA: Jquery is only appearing value of an input with . serialize()
Jquery is working correctly (see jsfiddle), but in PHP you’re only giving var_dump on $_POST['nome'], to see all do so: PHP: var_dump($_POST); or so: print_r($_POST);…
jqueryanswered Jader A. Wagner 4,921 -
2
votes5
answers5323
viewsA: How to center a div with position:Fixed?
If the width of the div is going to be dynamic, da to do only with CSS, just fix the container with 100% width, height 0 (so the leftovers are not over the links of the page) and align the centered…
-
3
votes3
answers95
viewsA: How to use this!
In these situations many forget that you can group multiple selectors in both CSS and Jquery: Jquery: $('#botao1, #botao2, #botao3, #botao4').click(function () { if ($(this).hasClass('botaoativo'))…
-
2
votes3
answers3702
viewsA: Auto-click when opening site
You can use the variable window.location.pathname to get the URI PATH and the selector A[href=...] to fire the right link. $('.menuFixoList A[href="' + window.location.pathname + '"]').click();…
-
1
votes3
answers9448
viewsA: Add and remove class
You can further simplify and use the elements' own indexes, without having to define Ids to identify them: HTML: <div id="banners"> <img…
-
0
votes4
answers787
viewsA: CSS transparency
You can simulate that the image is inside the background element, but when in reality it is outside and only positioned on it, so you can apply transparency in the "background" without affecting the…
cssanswered Jader A. Wagner 4,921 -
1
votes5
answers2514
viewsA: Secure API does not return purchase status
You didn’t fully understand the workings of the payback so you are having problems. At the end of the purchase the pagseguro sends to the return link but does not send any data as POST, just…
-
11
votes1
answer161
viewsA: Sessions in PHP
If you always set the value of $geral equal to $_GET['slcGeral'] when the GET comes empty will clear the Session... You must first check if the GET is set, then set the Session: session_start(); if…
-
1
votes2
answers856
viewsA: Remove duplicate lines in a Mysql query
You can search for the last messages when de or para are equal to the desired ID, sort by decreasing message ID (consider creating a date and time field) and do two left joins to pick up the names…
-
2
votes3
answers739
viewsA: __autoload PHP function does not open subfolders
To avoid bar type problems, you can use the preset constant DIRECTORY_SEPARATOR thus: foreach ($cDir as $dirName): if (!$iDir && file_exists($file = __DIR__ . DIRECTORY_SEPARATOR . $dirName…
phpanswered Jader A. Wagner 4,921 -
2
votes1
answer581
viewsA: How do I know if a resource is in the browser cache?
Although you might want to renege on solutions with Storage location, I think this would be the only alternative to check the cache without generating a request on the server. So below is an idea of…
-
1
votes1
answer164
viewsA: Explode or similar not break enclosed delimiters
I got a broader solution using a REGEX that replaces all ; who are enclosed within ( ) for: [ENCLOSED_DELIMITER], and after breaking with the explode, replaces it back to ; $teste = 'height: 100px;…
phpanswered Jader A. Wagner 4,921 -
1
votes1
answer44
viewsA: How do I search multiple Checkbox fields?
I had a search like this here and it was easy to adapt in your html: $("#search").bind("change keyup", function() { var search_str = $(this).val().toLowerCase(); if (search_str != "") {…
jqueryanswered Jader A. Wagner 4,921 -
1
votes1
answer164
viewsQ: Explode or similar not break enclosed delimiters
I’m developing a CSS parser, but when it arrives in a block like this: height: 100%; background-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); display:…
phpasked Jader A. Wagner 4,921 -
0
votes4
answers1051
viewsA: How to do if and Else of between 2 variables with output in a third?
From what I understand you will receive the 2 Ips, but at a certain time IP 1, even if it is filled correctly will not answer the call mysql connection, so you should try to connect with IP 1 and in…
-
4
votes2
answers1985
viewsA: Clone data insertion box from with jQuery
You can clone the existing element like this: Jquery: $('.clonador').click(function(e){ e.preventDefault(); $('.box_pergunta:first').clone().appendTo($('form')); // clona o primeiro elemento e…
-
2
votes2
answers841
viewsA: Problem with jQuery open/close Divs
You can use toggle on the clicked element and not to operate with others, thus: Jquery: var SC = jQuery.noConflict(); SC(document).ready(function() { SC('.FAQ-conteudo, .FAQ-fecha').hide(); //…
-
2
votes2
answers616
viewsA: "Convert" an HTML list to Mysql with PHP
I quickly made a parser for your case here: txt games. <h4>Jogo: Area 51 : teste de : no nome do jogo</h4> <li>Região: 2 - </li> <li>Sistema: 8 - Sony…
-
2
votes3
answers801
viewsA: How to change a <a> link according to a <select>?
I think they have complicated too much, select should provide you with the value you really need, which is the periodicity, and the price is that it should come as an attribute date, and only the…
jqueryanswered Jader A. Wagner 4,921 -
0
votes1
answer196
viewsA: What is the right way to use DNS wildcard?
The DNS part is correct, but the servername are in conflict, I think it should be something like this: ServerName dominio.com ServerAlias www.dominio.com DocumentRoot…
-
5
votes4
answers1688
viewsA: Fill fields of a multidimensional array with null
To get recursiveness on "infinite" levels, you need to create a function, and this function must verify that the value is an array and apply itself, thus: Note: I keep this form in the answer,…
-
6
votes2
answers161
viewsA: Height property of jQuery and Javascript, what’s the difference?
In jquery the $(window).height() is the size of the view window (viewport), already screen.height is the total screen size of the user. Keep in mind that jquery is javascript, and you can use…
-
2
votes1
answer296
viewsA: Droppable jQuery event does not work
You are using the attribute data wrong way, although it works that way, there is a specific method .data() which is easier and cleaner to use. And to use a variable between different functions, you…
-
0
votes6
answers1855
viewsA: How to create link with Hover showing strokes on the sides
You can do with spaces and line-through in the hover, thus: HTML: <ul> <li> <a href=""…
-
1
votes1
answer178
viewsA: jQuery slide, go to next element (number of elements is not fixed)
Use the attribute data to store data, the path and name of the images contains characters not allowed for the attribute id. Seen this, you can do something like this: HTML: <div…
-
6
votes4
answers2358
viewsA: How to count how many times a value appears in a table
You can create HTML elements to go saving/displaying the count: $('#table td').each(function (i, e) { if ($('[data-numero=' + $(this).text() + ']').length) { var numero = $('[data-numero=' +…
-
22
votes3
answers25430
viewsA: SQL command to display specific records from the "id" field
It would be something like: SELECT * FROM tabela WHERE id IN (22,23,25,27); The Operator IN: The operator IN allows you to specify several values in a clause WHERE. Syntax: SELECT column_name(s)…
-
0
votes4
answers405
viewsA: Hover does not work in div
Just include a small block <style> in the HTML containing the editable property, and the rest in the CSS, thus: HTML: <style>.produtos:hover { border-color: codigoSYS }</style>…
-
2
votes2
answers154
viewsA: Variable equal to itself if the logic result is false
It is easier to understand by assigning values to variables: $b = (2 * 4); // 8 $c = 6; $a = $b; if ($b > $c) $a = $c; // true, redefine o valor de $a = $c echo $a; // resulta 6…
phpanswered Jader A. Wagner 4,921 -
1
votes3
answers127
viewsA: jQuery, do not select 'Child' from the element
The easiest way is to listen to the image click and prevent the spread, like this: jquery: $(document).on('click', '.wrapperExtraImg', function () { $("#overlayFancy").append("<img src=" +…
-
1
votes1
answer1198
viewsA: Combobox ( select ) extended option
If you can’t leave the select without a defined width, I present three solutions: 1.) With jquery, set the title same as the text of selected by changing the option: $('#select1').change(function ()…
-
0
votes4
answers687
viewsA: include_once has no access to properties, variables or functions of the included file
You have to imagine that the include, nothing else does that include the contents of that file in that location, so if you are within a function, you will be under its scope. For example, if you…
phpanswered Jader A. Wagner 4,921 -
0
votes3
answers255
viewsA: Select with joins return last result per date
To get the result you want just group by the defender ID, and sort by the name followed by the expiry date decreasing: select d.nome, doc.vigencia from defenders d join drives dr on dr.defender_id =…
mysqlanswered Jader A. Wagner 4,921 -
3
votes3
answers1008
viewsA: Solution for <select> with many options
In these situations you can use the ternary operator ?:, directly on echo, thus: <select class="alterarperfilNomeInput2" name="sexo"> <option value="Masculino"<?php echo ($row[sexo] ==…
-
1
votes2
answers648
viewsA: How to increase the height in a lively way?
You can use the .animate, but as scroll does run multiple animates at the same time, it can still present some stops, the solution I found was to use the .clearQueue looks like it’s gotten more…
jqueryanswered Jader A. Wagner 4,921 -
0
votes3
answers65
viewsA: Go to jQuery
A cleaner way of doing without so many classes and ids: HTML: <div class="bloco"> <img class="imgBloco" src="" /> <p class="fraseBloco">AQUI É TIPO UM TITULO</p> <span…
jqueryanswered Jader A. Wagner 4,921 -
2
votes3
answers326
viewsA: How to make a function where every time a variable is called is increased by 1?
There are two simple ways to do this, and with slightly different results, see which one fits your need best: $num = 1; echo $num++ . '<br>'; // retorna o valor atual da variável (que é 1) e…
phpanswered Jader A. Wagner 4,921 -
5
votes2
answers15096
viewsA: How to count the number of characters of the word that came from the first line of a text file?
To get through all the words you need to do something like this: $texto = file_get_contents('teste.txt'); $palavras = preg_split('/[\s\r\n\t[:punct:]]+/', $texto, -1, PREG_SPLIT_NO_EMPTY); $tamanhos…
-
3
votes2
answers114
viewsA: Do not register in the time range if it already exists
To do this more easily you need to modify the fields to datetime and save the full date and time in them for example: 2014-08-23 18:00. And before entering a new appointment, you have to make a…
-
2
votes1
answer397
viewsA: Corrections in Fullcalendar
If you’re referring to that: fullcalendar. Just set the date format in the property columnFormat, as in the example below: $(document).ready(function () { $('#calendar').fullCalendar({ columnFormat:…
-
3
votes2
answers2042
viewsA: jQuery: Show/Hide DIV inside a specific element
The ID parameter is used to identify a specific element and cannot be repeated, to identify elements that must appear multiple times, use a class. And to identify the element that is triggering the…
jqueryanswered Jader A. Wagner 4,921 -
1
votes1
answer136
viewsA: CNAME configuration for Saas service
A CNAME is like a nickname, so based on your example, type servico.meudominio.com will resolve to subdomain IP username.servico.com, or is the subdomain username in servico.com must answer for an…
-
0
votes2
answers5179
viewsA: Return all data from the first to the last day of the month with mysql
Doing as you explained, you are with a one-hour window, and the records created in that period will never go through this process... I suggest you create the cronjob in the first minute of every…
mysqlanswered Jader A. Wagner 4,921 -
0
votes4
answers28473
viewsA: Align text after image
I pasted your HTML into jsfiddle and it came out working as you wanted it to be, but I noticed that it’s complicated a little beyond what it should be, it might be simpler, like this: <div>…
-
1
votes1
answer853
viewsA: Mount array with txt data
Based on your text file, I was able to split into an array as you need: $txt = ' Código: 808 Nome Abreviado: 091/0007756 Cliente Cobrança: 808 Nome: Nome da empresa Representante: 8 Endereço:…
-
0
votes2
answers1045
viewsA: Question with multiple school in Jquery
As you ask in the question and comments below it, something in pure HTML that simply shows the correct answer, and the reason why. I developed a script that is based only on the HTML structure of…
jqueryanswered Jader A. Wagner 4,921 -
3
votes4
answers685
viewsA: Effect with jQuery locking without reason
From what I understand you want to give a delay in the opening of .slideDown, you can achieve this effect by using the .delay as in the example below: jquery: var SemConflito = jQuery.noConflict();…