Posts by Lucius • 424 points
20 posts
-
-1
votes2
answers293
viewsA: Slim framework is not directing the login route
I believe you should be with the directive magic_quotes_gpc disabled on your machine. You need to enable it on php.ini: ; Magic quotes para dados vindos via GET/POST/Cookie. magic_quotes_gpc = On ;…
-
0
votes1
answer38
viewsA: How to pick up images within a post in "the loop" (wordpress)?
The function the_post_thumbnail_url has as its first parameter the size that will be the image, you are passing the_post(). So you can omit the size (and then "post-thumbnail" will be used), or…
-
0
votes1
answer72
viewsA: Automatic calculation of buttons
You can assign the same class to all inputs, select them with querySelectorAll and then go through one by one foreach to make the calculation: const elements = document.querySelectorAll('.valor');…
-
0
votes1
answer122
viewsA: How to refresh a page after opening a new window
I do not believe it is the best way to do this, but it works using setInterval after opening the page: var timer = setInterval(function() { clearInterval(timer); location.reload(); }, 100); To make…
-
3
votes1
answer51
viewsA: Javascript, action on selected option
Using pure Javascript, you can do so: var lista = document.getElementById("lista"); lista.onchange = function (){ if(lista.selectedIndex == lista.options.length - 1){ // caso a opcao selecionada…
-
2
votes2
answers105
viewsA: Password_verify() problem in PHP
Your code is correct. The only thing is that to succeed, you need to finish it after the header("Location: acesso-negado.php");, otherwise it will continue until the next header normally and the…
-
1
votes1
answer143
viewsA: Create array to validate duplicate CPF in a PHP Loop
The way you thought, it won’t work, because it will never be possible to put two identical keys in an array, with different values. EDIT Since the idea is just "validate whether the same CPF exists…
-
0
votes1
answer49
viewsA: I want to know how to remove hyphens (-), and (|) from the table below to return a json from the table
I admit I found it interesting to create the code for this: const fs = require('fs'); const readline = require('readline'); const registroRegex = /(\|.*\|)+/g; const dados = []; let linhaAtual = 0;…
-
2
votes2
answers225
viewsA: Update the value of a variable for the result of its sum with +1
You need increase its variable. For this, there are some different forms: var n = 0; function crescer(){ n++; } crescer(); console.log(n); // mostra o valor de n var n = 0; function crescer(){ n +=…
-
0
votes1
answer32
viewsA: Swap site root directory with htaccess
Maybe you need this: Options +FollowSymLinks -MultiViews # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteCond %{DOCUMENT_ROOT}/site/$1 -f [OR] RewriteCond %{DOCUMENT_ROOT}/site/$1 -d…
-
7
votes2
answers78
viewsA: Understanding the content of array elements
The index actually starts on 0, but the point is that in the loop, you are assigning a function that will give a console.log in the current index, so anyone you call will be equal to its own index:…
-
0
votes1
answer68
viewsA: How to hide default browser error messages?
The mistake net::ERR_FILE_NOT_FOUND is from the browser itself, it is not possible to treat it with Javascript. It is set in Chromium/Chrome on net_error_list.h, on line 44: // The file or directory…
-
0
votes1
answer36
viewsA: bindValue error - php mysql connection
You’re trying to call the bindValue in the variable $sql, before it is even initiated, see: <?php public function logar($email, $senha) { global $pdo; global $msgErro; //verificar se o email e…
-
0
votes1
answer48
viewsA: How to compare dates?
I’m not sure I quite understood your question, but basically to compare a date you’d have to turn edtDataSelecionada for an object Date and then use the function compareTo. Example: SimpleDateFormat…
-
2
votes2
answers62
viewsA: Is it possible to call a PHP function through AJAX?
You need to make PHP understand that it is receiving a request and itself invokes the desired method. There are diverse ways to do this, I’ll give a very simple example, but I recommend you take a…
-
1
votes1
answer35
viewsA: How do I show the result of an account held in an iframe in the original document?
You can use parent to access functions that are on the Iframe parent page. For example: index.html <html> <head></head> <body> <iframe src="outro.html" frameborder="0"…
-
0
votes3
answers719
viewsA: Success: Function(data) in Ajax not working
Try to use the done, instead of success: $.ajax({ type: "POST", url: "includes/login.php", dataType: "json", data : form_data, headers: {'CsrfToken': $('meta[name="csrf-token"]').attr('content')},…
-
0
votes2
answers113
viewsA: Redirect to "Coming Soon" page on Wordpress site
There are several ways to do this in Wordpress using PHP, as shown here //redirecionar nao-administradores function pagina_em_breve() { global $pagenow; if((!is_user_logged_in() ||…
-
0
votes1
answer18
viewsA: Error adding wordpress admin button
See, since you are in a class, you should pass it, next to the function name as parameter in add_action: public function __construct(){ add_action('media_buttons', array($this,'add_media_button'));…
-
1
votes2
answers4175
viewsA: How to pass a variable to another page using IONIC?
Pass the variables like this: this.navCtrl.push('Pagina', { data: variavel, data2: valorQualquer, ... }); And then, on your Page that will open, you take the variables like this: variavel =…