Posts by Berriel • 578 points
16 posts
-
2
votes10
answers1739
viewsA: How to count the zeroes to the right of a number?
PHP version function contarZeros($n) { $count = 0; while ($n % 10 == 0) { $count++; $n /= 10; } return $count; } Version in C# public static int ContarZeros(int n) { int count = 0; while (n % 10 ==…
-
8
votes3
answers22145
viewsA: How do I check if a session ($_SESSION) exists or is active in PHP?
From what I understand, you want to know if a another session, other than the user in question, does exist, right? If yes: PHP stores session data in a temporary folder on the server, which you can…
-
1
votes1
answer431
viewsA: How to modify the image that appears on facebook when I put the link to my site?
Depending on the amount of hits, Facebook can cache the files for a long time. To force the update of the information, you must access https://developers.facebook.com/tools/debug and ask him to…
-
2
votes1
answer52
views -
1
votes1
answer179
viewsA: problem with hidden copy in phpmailer
This happens because all recipients are hidden. See the changelog v1.7 2003: Adds "To: undisclosed-Recipients:;" when all Recipients are Hidden (BCC) [en] Adds "To: undisclosed-Recipients:;" when…
-
1
votes2
answers47
viewsA: Show next value of an Array based on previously found value
Pay attention to time differences/timezones with the server or values stored in the database. Try this: $hora = date('Hi'); $os = array('1632','1635','1638','1654','1642'); // pega o próximo…
-
0
votes1
answer55
viewsA: Form validation
Change the event (onkeyup) as your need (onblur, onfocus, ...). Run the code below and start typing letter by letter to understand: var elementoValidar = document.getElementById('txtNome'); function…
-
0
votes1
answer341
viewsA: Error when placing wamp server online
I can’t tell you for sure, but I saw that you have Skype open. When I used WAMP, I had a port conflict problem with Skype, but I don’t know if there is one yet. This conflict prevented Apache from…
-
2
votes1
answer799
views -
2
votes1
answer42
viewsA: Validation remaining characters
You can do it like this: function contaCaracteresRestantes(idCampoTexto, idSpan) { var n = document.getElementById(idCampoTexto).value.length; document.getElementById(idSpan).innerHTML = 400 - n; }…
javascriptanswered Berriel 578 -
2
votes1
answer2610
viewsA: Disable previous datapicker dates with bootstrap
Try this: $('#sandbox-container input').datepicker({ minDate: 0}); See working here: http://jsfiddle.net/191c5apr/1/…
-
0
votes2
answers75
viewsA: Query is not running, inserts nothing
You can’t change to if (getenv("REQUEST_METHOD") == "GET") { ... } Because the normal request is also a GET. In this case, it will enter only from entering the page, but as the form has not yet been…
-
3
votes1
answer102
viewsA: Binary Search Tree - Printinorder();
What I said in my comment would be this: struct Node { Type m_data; Node *m_left, *m_right; Node(const Type& _data) : m_data(_data), m_left(nullptr), m_right(nullptr) {} }; Node* m_root; int…
-
1
votes1
answer65
viewsA: Dropdown Twitter Bootstrap, ignored in Ajax request
If I understand the goal, you can ignore those elements whose destination URL is equal to #: $(function() { $("#loading").hide(); $("ul.dropdown-menu a").click(function() { // ignora href="#" if…
-
1
votes1
answer38
views -
2
votes1
answer1683
viewsA: Calculate percentage between 2 numbers
Follows the calculation // exemplo $inicio = 1453248000; // 20 de janeiro de 2016 $fim = 1454112000; // 30 de janeiro de 2016 $atual = 1453507200; // 25 de janeiro de 2016 // no seu caso: // $inicio…