Posts by NoobSaibot • 9,554 points
354 posts
-
1
votes1
answer614
viewsA: Update quantity in dynamic table with Ajax
You can do the following, return the variable {{ $product['qtd'] }} within a tag span and identifies this tag with a id, example: <td class="qtd"> <a onclick="remove({{…
-
1
votes2
answers93
viewsA: Error fetching database data
mysqli_query() returns an object resource for the variable $result, not a string. Soon you must make a loop while ($linha = $result->fetch_assoc()) { $_SESSION['id'] = $linha['id'];…
-
0
votes2
answers323
viewsA: Print div with appendchild
For this you must use the method insertAdjacentHTML() Example of use: elemento.insertAdjacentHTML(posição, texto); Positions: beforebegin Before the element. afterbegin Inside the element, before…
javascriptanswered NoobSaibot 9,554 -
4
votes1
answer55
viewsA: Detecting Keyword
You can use the function preg_match $String = "asdfghjlzzTESTEzzxcvbnm"; // Verifica se a variavél $String contém a palavra TESTE if (preg_match("/TESTE/i", $String)) { echo "Uma correspondência foi…
phpanswered NoobSaibot 9,554 -
1
votes3
answers5212
viewsA: How to call an html Function
Complementing Sergio’s comment, a small change should be made to his script. Within the method setTimeout call the function GetImage() again because doing this all made that finish the time set it…
-
3
votes3
answers2297
viewsA: Python 3 make the program find out how much of a given digit is in a string or a number
See working on repl Code in the github # coding: utf-8 # Informe uma frase frase = input("Informe uma frase: ") # Informe qual o caractere que deseja saber a quantidade contida na frase caracter =…
-
1
votes1
answer14539
viewsA: npm ERR! Missing script: start
npm ERR! Missing script: start This error occurs you did not set in the file package.json the script start, example: "scripts": { // Adicione essa linha, mas pode ser também ex = "start: "node…
-
8
votes1
answer2502
viewsQ: What are the differences between Flask and Django?
I recently started in the Python language and am currently working on a project using Flask, MariaDB and WebSockets. I see people talk a lot about Django and would like to know the differences…
-
1
votes2
answers6439
viewsA: How to make a regular expression that finds a name and then looks for a character?
Follow the steps: Go to Search-> Replace. Set the value of the Search/Find field: <span[ >]+>(.*?)</span> Set the value of the Replace field with: 1 or 2. Set the search mode to:…
-
0
votes2
answers1981
viewsA: Problem to redirect with javascript (window.location.href)
Beyond the window.location.href you can use window.location.replace If you want to simulate someone by clicking on a link, use location.href If you want to simulate an HTTP redirect, use…
javascriptanswered NoobSaibot 9,554 -
0
votes1
answer63
viewsA: Print dynamic query
You can use CSS to determine the areas you want to print, and create a button, which by clicking it calls the method print. See the example below. $("#print_page").on("click", function(){…
-
0
votes3
answers4737
viewsA: Capture text within a <td> via jQuery
I only need the text: "R$ 8,62 - Up to 8 business days" $(document).ready(function(){ var span = $("span").text(); var dados = span.split("Econômica - "); console.log(dados[1]); alert(dados[1]); });…
-
0
votes1
answer368
viewsA: Schedule grid with PHP
This is happening because you’re comparing in your for in your line 13, if $atu is less than $fim. for ($atu = $ini ; $atu < $end; $atu = strtotime('+30 minutes', $atu)) In order for him to do…
phpanswered NoobSaibot 9,554 -
1
votes1
answer378
viewsA: Changing Mask using Jquery Mask Plugin?
Instead of using the event keypress, you can use the event Blur: Blur event The Blur event is triggered when a given element loses focus, what may occur if the user presses TAB, for example, on the…
jquery-mask-pluginanswered NoobSaibot 9,554 -
2
votes1
answer451
viewsA: Object not found - Error 404 in htaccess
To create the redirect, you must use the Errordocument directive, add in your .htaccess, as you can see in the example: ## Redirecionar em caso de erros ## ErrorDocument 404 /404.php…
htaccessanswered NoobSaibot 9,554 -
0
votes1
answer79
viewsA: How to maintain a constant connection to the database for updating data without the need to refresh
For this use the function setTimeout javascript to call the request. Example // int t: difine o tempo que chamara a função novamente. function atualizaRank(t) { $.get( "rank.php", function( data ) {…
-
1
votes1
answer476
viewsA: Traverse a vector to a given number of indexes and form a list of values
An alternative, see working here. a = [10, 10, 10, 10, 10, 20, 20, 20, 20, 20] b = [] t =[] # Temporario i = 1 for numero in a: t.append(numero) if i == 5: i = 0 # Volta a contagem do zero…
-
0
votes2
answers398
viewsA: Session does not work as expected in Ajax and PHP request
Let us exemplify, that this code would be yours index php. session_start(); $_SESSION['TOKEN'] = md5(time()); // Gera o Token e salva na sessão echo "O TOKEN É: " . $_SESSION['TOKEN']; // imprime a…
-
0
votes1
answer228
viewsA: Searching user data for a Session
// Edita a função logaUsuario e adicione os campos que, // Você deseja salvar na SESSION function logaUsuario($ID, $Nome, $Email/*, $Campo1, $Campo2, etc.. */) { $_SESSION['user_id'] = $ID;…
-
4
votes3
answers868
viewsA: Catch string inside <a> tag without attributes
To recover the value of the attributes / recover the string within a tag, do the following: Example: //carregamento da url $dom = new DOMDocument(); libxml_use_internal_errors(true);…
-
1
votes3
answers50
viewsA: Determine the indices of a vector to be subtracted
See working here. a = [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 110, 120] b = [] # i = indice anterior i = 0 # p = proximo indice p = 1 # Divide o tamanho total por 2 total = len(a) / 2 for x in…
-
0
votes1
answer212
viewsA: Angular + requirejs Controller logging error
Missed you set the Controllers on App.js, you are calling him but he was not created. For more details, see the documentation. app.controller('DashboardCtrl', ['$scope', function ($scope) {…
-
2
votes1
answer67
viewsA: How to do a blur img when passing the mouse over it?
Can be seen here, Update: Thank you Diego Schmidt for the remark, as stated in microsoft documentation. Observing: Since Windows Internet Explorer 9, this feature has been deprecated. From Internet…
-
4
votes3
answers2526
viewsA: Download website with php
Download site is impossible, this would be due to a security breach, because it would give you access to internal data, such as database access configuration, etc... You can download only the files…
-
1
votes3
answers1667
viewsA: Prevent redirect after submitting the form
Add the jQuery <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> Form <form name="form_contato" method="post"> <input id="nome" name="nome"…
-
1
votes1
answer55
viewsA: How to decode values from javascript?
Following the PHP manual, you can use the function json_decode $json = '{"a":1,"b":2,"c":3,"d":4,"e":5}'; var_dump(json_decode($json)); var_dump(json_decode($json, true)); Solution: $dados =…
-
2
votes1
answer519
viewsA: IDE to the Django?
I also found a solution to the error WARNINGS: ?: (1_8.W001) The standalone TEMPLATE_* settings were deprecated in Django 1.8 and the TEMPLATES dictionary takes precedence. You must put the values…
-
4
votes2
answers276
viewsA: How to return a mysql query as a link?
check if in your table enterprise has the spine website / url, if not, create and place this line inside the while: echo "<strong>site: </strong>". $linha['site']."</br>"; Thus…
-
0
votes2
answers55
viewsA: Is it possible to intercept calls to class functions?
I recommend you to create a table in your data bank for example: tbl_permissions Table tbl_users +----------------------------+ | ID | USERNAME | PASSWORD | +----------------------------+ | 1 |…
phpanswered NoobSaibot 9,554 -
1
votes3
answers1633
viewsA: How to get the total and individual percentage per field in ASP Classico
ASP I’m a layman, but you’re on the right track, like in the PHP I don’t think there’s much difference. What you need to do is this, in your sql query do something like: $sql = 'SELECT COUNT(sexo)…
-
1
votes1
answer631
viewsA: Sending an Array by POST with JSON to PHP
First your javascript and php code contains mistakes, and possibly that’s why it’s not working. The option date of function ajax jquery, receives parameters between keys and not by asterisk Change…
-
1
votes2
answers51
viewsA: I cannot place element inside JSON
You converted clubs to array and used notation from object within the array_push. $str = '{ "clube":["Flamengo"] }'; $tempArray = json_decode($str, true); array_push($tempArray['clube'], 'Santos');…
-
0
votes3
answers331
viewsA: Jquery calculation of centimeters with coin result
var test = 'R$ 1.700,90'; function getMoney( str ) { return parseInt( str.replace(/[\D]+/g,'') ); } function formatReal( int ) { var tmp = int+''; tmp = tmp.replace(/([0-9]{2})$/g, ",$1"); if(…
-
1
votes1
answer43
viewsA: Error in file . js
Missing include (import) the jQuery <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
-
0
votes2
answers307
viewsA: How to create an exception in htaccess for locking folders
You must create a file .htaccess inside the desired folder and add this line: order deny, allow deny from all allow from 127.0.0.1 # IP DO SERVIDOR
-
1
votes1
answer435
viewsA: Function to dislodge through inactivity
function checkAtividade() { if(time() - $_SESSION['timestamp'] > 900) { // Subtrai timestamp atual com o armazenado em SESSION['timestamp'] echo"<script>alert('Deslogado por…
phpanswered NoobSaibot 9,554 -
2
votes1
answer505
viewsA: How to call a function within a PHP script from the command line
To do this just use the parameter -r Example: php -r "require 'teste.php'; imprimeNome('Thon');"…
-
1
votes1
answer49
viewsA: How do I change the order of the URL Friendly parameters in htaccess?
Let’s understand the order of the parameters. Before it was like this: guaraparivirtual.com.br/noticias-Guarapari/moqueca-capixaba-agua-na-boca/9/ Having in order: moqueca-capixaba-agua-na-boca 9…
htaccessanswered NoobSaibot 9,554 -
1
votes3
answers103
viewsA: How to treat the value field?
<?php // Troca 'fromPerson' pelo nome do seu campo html if( isset($_POST['fromPerson']) && $_POST['fromPerson'] === 'sao-gabriel-da-palha' ) { $fromPerson = 'São Gabriel da…
-
1
votes1
answer40
viewsA: How to insert a link to another pg in each image in this menu
$(".main.button").on('click',function(){ var $this = $(this); if($this.text() === 'Menu') { $(".menu").removeClass('closed'); …
-
1
votes1
answer72
viewsA: What’s wrong here ? I can’t understand
Possibly coding, before any code adds # -*- coding: utf-8 -*- You have the variable Action that on the line 103 is Action…
pythonanswered NoobSaibot 9,554 -
1
votes1
answer39
viewsA: Calculate using Math operations on LESS
The problem is that in Less you don’t have to add number with string Do the following, change your variables to: @screen-sm: 768px; @screen-md: 1024px; I believe you are making a subtraction when…
lessanswered NoobSaibot 9,554 -
2
votes1
answer3096
viewsA: How to extract specific data from a Python text file?
I’m still learning Python, but see if that’s what you need: #!/usr/bin/env python # -*- coding: utf-8 -*- arq = open('arquivo.txt', 'r') texto = arq.readlines() x = 0 Saida = "" for linha in texto:…
-
1
votes1
answer50
viewsA: How to fread() fetch data every 30 seconds without refreshing the page
Use ajax to learn more read this document of Mozilla in Portuguese var xmlhttp = new XMLHttpRequest(); // Mude o valor da variavel url. var url = "https://api.github.com/users?"; function get(url) {…
-
1
votes1
answer601
viewsA: How to do not allow to type repeated numbers with angular
Here a small function to check if a repeated letter/number has been typed, adapt as needed. var arr = []; function verificaDigitios(e) { var keynum; if (window.event) { // IE keynum = e.keyCode; }…
angularjsanswered NoobSaibot 9,554 -
2
votes3
answers85
viewsA: Jquery ischecked does not work
Alternative $("#responderam").change(function() { var respondeu = ""; var valor = $("#responderam").val(); if(this.checked) { respondeu = 1; alert(respondeu); } else { respondeu = 0;…
jqueryanswered NoobSaibot 9,554 -
2
votes1
answer760
viewsQ: Bash alias with parameters
I am creating a system that works online, the user logs in and will have access to a terminal that it can execute only the commands allowed on the server. That’s the thing about: The user will have…
-
0
votes1
answer155
viewsA: Function Mouse Screen
It’s as close as you can get $(document).mousemove(function(e) { // $("body").html("posição do mouse: " + (e.pageY - $(window).scrollTop())) if ((e.pageY - $(window).scrollTop()) == 0){ alert('Tem…
javascriptanswered NoobSaibot 9,554 -
0
votes1
answer41
viewsA: Upload php problem
Problem solving missing attribute: enctype, tag form <form action="#" method="POST" enctype="multipart/form-data">
-
1
votes1
answer21
viewsA: .position() giving error - Jquery
You did not set the variable: position See the example taken from the jquery site <script> var p = $( "p:first" ); var position = p.position(); $( "p:last" ).text( "left: " + position.left +…