Posts by Valdeir Psr • 10,804 points
433 posts
-
0
votes2
answers813
viewsA: Start an app with a screen that isn’t Main?
To make this change it is necessary to change your manifest.xml Ex: <!-- Login --> <activity android:name=".LoginActivity" android:theme="@style/AppThemeLogin"> <intent-filter>…
-
1
votes1
answer46
viewsA: How to capture the last 5 characters of a URI
Just use the method substring. String.substring(tamanho da string - 5); Ex: String uri = "https://painel.iptvmove.com:25461/live/teste/1234/1224.m3u8"; System.out.print( uri.substring(uri.length() -…
-
1
votes2
answers384
viewsA: Change icon structure in javascript
You can use the method replaceWith. <!DOCTYPE hml> <html> <head> <title>Title of the document</title> </head> <body> <span>Span (Not…
javascriptanswered Valdeir Psr 10,804 -
2
votes1
answer16
viewsA: Return query generate Array
It is necessary to create an array before the foreach and then create a multidimensional array. <?php $resultado = [ ["lat" => 0.0,"lon" => 0.0,"horario" => "00:00",], ["lat" =>…
-
0
votes1
answer71
viewsA: Use while to show results from three columns
There are some ways to do this. The problem in this case seems to be data modeling. If possible post the structure of your database, so we can analyze and recommend a particular shape that is better…
phpanswered Valdeir Psr 10,804 -
1
votes1
answer156
viewsA: Something setInterval style for PHP
Other than a code on Js, the code in PHP "dies" after the request. That is, it is not possible/feasible to perform something like setTimeout or setInterval. The best solution for these cases is to…
-
1
votes1
answer176
viewsA: Delete.php file, along with deletion of record in the database, by getting the name of the.php file by a variable
The variable $_GET['encontro'] is the type null, so you are not finding the file and deleting it. You need to add it as a URL parameter. <td><a…
phpanswered Valdeir Psr 10,804 -
3
votes1
answer534
viewsA: Recover Input File to Pass as Date in AJAX
To send an image, you can use the Formdata. This is an API to store values that will be sent via POST. When you use this API, you are basically using the enctype: multipart/form-data But it is…
-
2
votes2
answers6673
viewsA: Receive data from a url (m3u) using php
The easiest way is by using the function preg_match_all with Regex. Capturing the list through Curl <?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL,…
-
0
votes1
answer280
viewsA: Grab hidden extension from Uri
Use of the ways to capture the link is by accessing the page with the class Urlconnection and then returning the Header Response: Location . Ex: import java.net.HttpURLConnection; import…
-
5
votes1
answer2816
viewsA: Using reCAPTCHA with jQuery (ajax) and PHP
To capture the value of reCaptcha, use the method getResponse. It will give you a code that should be used for validation. In Javascript: var dados = $(this).serialize(); post += "&recaptcha=" +…
-
3
votes2
answers827
viewsA: php error with mysql and mysqli
When you use the function mysqli_query, you must pass two attributes: O Resource and the query. if (!mysqli_query($conectar, "SELECT * FROM tabela")) { die(mysqli_error($conectar)); } Already in…
-
0
votes3
answers597
viewsA: How does the equals() method work in Java?
In java, every object extends from the class Object. Even when not explicitly using the extends Object, Java automatically does this process. Hierarchy of a class: This root class is defined in the…
-
0
votes1
answer549
viewsA: Android Application Consuming Webservice
This happens because the API returns a Json Array and the lib Gson is trying to convert this array, for a object. That is, for the code to work you must convert to List<Coins> using the…
-
2
votes1
answer614
viewsA: mkdir with problem in the permission of the created folder
When you use the function mkdir with the parameter $mode, you must pass this parameter as int. When you pass like string, the PHP automatically tries to convert to int. During this conversion, the…
-
3
votes1
answer58
viewsA: gettext() returns null when trying to read the typed value in an Edittext
It’s because you’re setting a new layout. Remove setContentView(R.layout.content_main_menu);
-
1
votes2
answers43
viewsA: See if any of the array value exists in a string?
You can also do with Regex /* Lista de Palavrões */ const curseWords = ["word1", "word2", "word3"]; /* Textarea */ const textarea = document.querySelector("textarea"); /* Captura a lista de…
jqueryanswered Valdeir Psr 10,804 -
1
votes1
answer1342
viewsA: Fatal error: Uncaught Error: Call to Undefined method Image::Display()
Solutions: For you to have access to a class, you have to include on the page where you want to call. For this you can use one of the 4 methods: 1. include and require With these functions you can…
phpanswered Valdeir Psr 10,804 -
0
votes3
answers65
viewsA: PHP - using isset and Gets
There is another way too, is to use the array_diff that will check exactly the fields <?php $obrigatorios = ["order", "preco", "comprador"]; if (!array_diff($obrigatorios, array_keys($_GET))) {…
phpanswered Valdeir Psr 10,804 -
1
votes2
answers1165
viewsA: Script to check if directory is empty
You can create alias. Find empty directories (Shellscript): alias searchDirEmpty='dirEmpty() { find $1 -type d -empty -print; }; dirEmpty' How to use: searchDirEmpty /path/to Checks if a given…
-
1
votes2
answers3112
viewsA: Include in previous folder
In the PHP the path of the files is defined based on, the main file, the index.php. So you should add the includes as if you were on index.php. File structure: Desktop │ index.php │ teste.php │…
phpanswered Valdeir Psr 10,804 -
1
votes1
answer32
viewsA: User feedback
You can use XMLHttpRequest to make a request without leaving the page and at the end of the page, display a message to the user; or you can use Sessions to save a message and return to index.php,…
-
4
votes2
answers3796
viewsA: "date(): It is not safe to rely on the system’s Timezone Settings..."
That one timezone does not exist. The Correct is: date_default_timezone_set('America/Sao_Paulo'); You can also get the list of timezones with the function Datetimezone::listIdentifiers…
-
4
votes1
answer1673
viewsA: single.php in wordpress
When you work with various types of posts and want to have a style for each, you can choose to use the Custom Post Type. With this you can create posts of various types, with various other elements…
-
0
votes1
answer99
viewsA: "Undefined index" and "Cannot access Empty Property"
The error is because the index encontra in $info['encontro']. The variable $info in the method montaEventos does not bring a value. To fix this, you must use a ternary operator. It works as follows:…
phpanswered Valdeir Psr 10,804 -
0
votes1
answer1481
viewsA: Recaptcha validation does not work
Lock send button and use attribute data-callback, this way when the user performs the check, the button will be released. function enableButton() {…
-
4
votes1
answer36
viewsA: xmlhttp is not defined
The problem is that you are creating a local variable in generateMessage, so she’s not assigning the value to the global variable. When you define a variable within the scope of the function or…
-
2
votes1
answer94
viewsA: Best way to capture an upload’s progress
When you work with upload and with api XMLHttpRequest, you have access to the object XMLHttpRequest.upload. With this object, just add the event progress to capture the total bytes that were sent…
javascriptanswered Valdeir Psr 10,804 -
1
votes1
answer258
viewsA: Areá de Clientes em html
Using the Owncarousel. To install the Owlcarousel2, you need to add the jQuery on your html page. That way: <script…
-
8
votes3
answers5980
viewsA: Customizing the Alert
Unable to customize the alert, but you can use the Sweetalert. Just add the jQuery and the SweetAlert in his HTML: <script…
-
5
votes1
answer1297
viewsA: How to upload an image through the clipboard (copy and paste)?
When something is pasted on a page, the js fires an event in function onpaste. When we paste an image, the js through function onpaste returns an object with the interface File (Only in the case of…
-
1
votes1
answer1542
viewsA: java.lang.Securityexception: Permission Denial: Tarting Intent
It turns out that the if is on the following condition: "If the app is not allowed to make calls, then make a call." if (ActivityCompat.checkSelfPermission( MainActivity.this,…
-
4
votes2
answers1807
viewsA: What is the use of cache = false in ajax?
The cache:false in the jQuery Ajax, serves to force requested pages not to be cached. (It’s as if you disabled the cache for that page you sent the request). You can use both in request of the kind…
-
2
votes1
answer896
viewsA: I need to format date for Brazil
To use this date pattern, you can use PHP’s native function, the Date or the Carbon (standard class that Laravel uses for date), which is already installed in Laravel. In the control use as example…
-
1
votes1
answer43
viewsA: How can I create a filter for unavailable urls? (javascript)
You can create an array on js and use the method indexOf. Ex: const subdomainDisabled = ["blog", "news", "cdn"]; const input = document.querySelector("input"); const btn =…
-
4
votes3
answers601
viewsA: Java method that returns difference in hours
The error in your code is in pattern of the date. No Java, hh:mm means: "Hours from 1 to 12 : minutes from 0 to 59". How come you don’t have the PM/AM to differentiate morning and afternoon, the…
javaanswered Valdeir Psr 10,804 -
0
votes2
answers129
viewsA: How to use 2 addresses in the if condition ( !strpos( $_SERVER['REQUEST_URI'] , '/') )
There are several ways to make this check: Example 1: Here we will use the if with the OR or simply ||. $request_uri = $_SERVER["REQUEST_URI"]; if( strpos($request_uri, "checkout/librepag") ===…
-
0
votes4
answers974
viewsA: Add Select Multiple values
It turns out that this way you’re not adding up, you’re just taking the value of select and adding to input. Here’s an example that might help. jQuery(document).ready(function() {…
-
3
votes1
answer1649
viewsA: How to call a method within another method?
The first error is that you are not passing the parameter view for the method ask6. Error: Do not compile Explanation: If you define a parameter in a method, you must pass a parameter when calling…
-
0
votes1
answer1546
viewsA: Login to Facebook - PHP
As I said in the comments of the question, you must utilise the same url (literally) of configuration Valid Oauth redirect uris when calling the method getLoginUrl If you use https at one URL, you…
-
1
votes3
answers1410
viewsA: Display more than one information in the same table with PHP and MYSQL
It is possible to bring the result as you want, using only the Mysql query. You can run the following query: SELECT a.`nome` AS aluno_nome, a.`telefone` AS aluno_telefone, GROUP_CONCAT(c.`curso`) AS…
-
1
votes2
answers93
viewsA: How to prevent deletion of an html snippet?
You can add this code to a hidden element, and then go checking, with each modification, if it is in the textarea. /* Captura o valor dos dados que NÃO podem ser apagados */ var elementoOculto =…
jqueryanswered Valdeir Psr 10,804 -
1
votes3
answers1909
viewsA: Protecting source code
If you have using the base64_decode, it is necessary to use the function val. Example: <?php $code =…
phpanswered Valdeir Psr 10,804 -
2
votes2
answers167
viewsA: Error with SQL and Mariadb (Current position is before the first Row)
Use the next or first before capturing the value. public String getBlockPermission(String blockstring){ String permission = ""; try{ ResultSet res = connection.createStatement().executeQuery("select…
-
2
votes1
answer135
viewsA: (javascript) function returning Undefined
The function parseJson returns nothing. The return [lat,lng]; that you added, is returning the value to the callback of the $.each and not for the function parseJson. The correct is: function…
-
0
votes1
answer40
viewsA: Active users on the site
using the date function how can I be comparing this recorded time with my bank to the current time and know if it has been 30 seconds ? Answer that question, come on. To do this you do not need to…
phpanswered Valdeir Psr 10,804 -
1
votes1
answer73
viewsA: I’m having a problem validating a contact form
The error is because you are capturing the variable value $mensagem, but it doesn’t exist. Substitute if (validaEmail($de) && $mensagem) { for if (validaEmail($de) && $msg) { and…
-
1
votes3
answers641
viewsA: Javascript or jQuery - Remove attribute pseudo elements
Like :after is not an object, you will not be able to modify its contents directly. What you can do is inject CSS into the page. Example: document.querySelector("button").addEventListener("click",…
-
0
votes1
answer192
viewsA: Password validation with jQuery in steps
There are 3 incorrect things in the code. That your condition num.test($("#password1").val()) == steps.length will always be fake, this is because you forgot to add the point when will capture the…
-
2
votes1
answer3486
viewsA: Make consultation with distinct in Laravel
Use the selectRaw in queryBuilder $db = \DB::table('timelines') ->selectRaw('COUNT(DISTINCT order_id) AS total') ->where('supplier_id', 2) ->first(); var_dump($db->total); But be careful…