Posts by Ivan Ferrer • 12,096 points
772 posts
-
1
votes2
answers1931
viewsA: Insert value in Input Value with JS
Try it this way and tell me if it worked out what you wanted: $('#my_modal').on('show.bs.modal', function(event) { var $target = []; $target['fornecedor-id'] =…
-
-2
votes1
answer105
viewsQ: File does not open or is not recognized on the Fedora Linux localhost?
On the terminal screen, permissions are correct: But on my localhost, the page is opening with error: But on the IDE screen, it’s there too, see: The question is, how do I make my localhost…
-
0
votes1
answer2759
viewsA: Return database records using jquery ajax, php and mysql
Here’s an example I made, I can understand if you look: JAVASCRIPT: <script src="https://code.jquery.com/jquery-latest.min.js">/script> <script type="text/javascript"> function…
-
3
votes4
answers9913
viewsA: Difference between prepare() and query()?
Query() With the function $stmt->query() the queries are executed together with the values passed in it, without any internal treatments, and the part dealing with these values so as to make them…
-
0
votes2
answers713
viewsA: Question about data loading via Modal Bootstrap
The solution to your problem is to make the z-index for each of the modals: Javascript: $(document).ready(function () { $('.modal') .on({ 'show.bs.modal': function() { var idx =…
-
1
votes4
answers2449
viewsA: HTML 5 Bootstrap google maps
Click on your URL iframe, in the side menu, click the share link with blue icon in the box that opens, navigate to the "embed map" tab, grab the link from Google’s iframe and edit as below: <div…
-
6
votes2
answers1131
viewsQ: How does the (anti-)EAV (Entity Attribute Value) standard work?
I would like a functional example, because I do not understand very well this dynamic relationship of creating table of types, with table of data, a dynamic relationship, that many consider…
-
0
votes2
answers323
viewsA: Consume file . mdb and write to Mysql with PHP
One way to do this is to make a connection directly to the file: $db = 'uploads/arquivo.mdb'; $conn_mdb = new COM('ADODB.Connection'); $conn_mdb->Open("DRIVER={Driver do Microsoft Access…
-
0
votes2
answers1243
viewsA: Pop up with jquery before closing the browser
You can use the fancybox, see below: $(function() { var content = '<div id="conteudo" class="col-xs-12 col-md-12">Sua propaganda aqui!</div>'; $.fancybox.open([{ type: 'inline',…
-
0
votes2
answers156
viewsA: Add Woocommerce Hook to add target attribute
One way to solve your problem without having to change the function is by using javascript this way, in case I used jQuery: $(function() { $('body a').each(function(i, el){ var linksParents =…
-
1
votes3
answers1164
viewsA: Calculate Value Present in Javascript
The function works, I believe it’s just to suit your purpose: function PV(rate, nper, pmt) { rate = parseFloat(rate) / 100.0; return pmt / rate * (1 - Math.pow(1 + rate, -nper)); } var saida =…
-
0
votes2
answers59
viewsA: While does not validate last php array
Your problem can be solved this way, put together the jquery library: <?php $url_editar = '../php/editar_usuario.php'; $url_excluir = '../php/excluir_usuario.php'; while ($dados_tabela =…
-
1
votes1
answer76
viewsQ: What is the compatibility with the browsers of using the tag template?
Reference: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/template Example of use: Javascript: window.onload = function() { var contentHTML = document.getElementById("teste").content; var…
-
1
votes1
answer3098
viewsA: PHP/Mysql search with Javascript returning data to HTML
I transformed the logic to Ajax, this way, it will be better in performance and visualization, I have not tested, but by the structure, I believe it will work: Edit your javascript like this:…
-
0
votes3
answers194
viewsA: How do you animate an anchor call?
I made an example method to animate the anchor, see: HTML: <a href="#tela1" class="btn">Tela 1</a> <a href="#tela2" class="btn">Tela 2</a> <a href="#tela3"…
-
0
votes2
answers47
viewsA: html Javascript does not accept empty data
Although there are far better ways to validate. I’ll put your corrected example. Remembering: The first one you are doing, the script does not find the form situations, because javascript and…
-
2
votes3
answers982
viewsA: GIT, display of branchs in bitbucket tree
That’s how you work. In this case, when you work on the same branch (master), it follows a current line. To work in parallel, you have to create a new branch from the master. seuprojeto (master):…
gitanswered Ivan Ferrer 12,096 -
2
votes3
answers1509
viewsA: How do I resolve this conflict in php?
An alternative is to check the server: if (stripos(php_uname('s'), 'win') === 0) { $html->NOMEARQ = utf8_encode($file); } else { $html->NOMEARQ = $file; } Another alternative is to force…
-
0
votes2
answers2002
viewsA: How can I position a tree-shaped image in html and css?
Here’s an example of how to structure this: <style> body { padding:0; margin:0; } .arvore { width:788px; height:776px; border:1px solid #000; } .pessoa { position: relative; width: 378px;…
-
1
votes1
answer191
viewsA: Change column of txt
What you can do in Javascript is a method that changes the content: var content = '1|1|1|1| |1|1|1|1|1|'; alterContent(content, '123'); function alterContent(content, val) { var add = [];…
javascriptanswered Ivan Ferrer 12,096 -
1
votes1
answer23
viewsA: Friends, how do I view only one user with this rule
You don’t have to while when you only want to bring a record, but to facilitate your rule, just use "limit" in the query. Instead of using a loop, bring only the first record:…
-
1
votes3
answers6169
viewsA: lock enter inside an input
if it’s just to lock enter, just do this: $(function() { $('form').submit(function(event){ return checkFocus(); }); }); function checkFocus() { if ($('#auto').is(':focus')) { return false; } return…
-
1
votes1
answer45
viewsA: Problem with Dynamic Input
I think that’s what you need (Obs: made up to 24, correct?)... $horas_hidden = array(); while ($ln = mysql_fetch_assoc($qr)) { $horas_hidden[] = $ln['Hora']; } echo montarOptions($horas_hidden, 24);…
-
0
votes2
answers185
viewsA: Javascript not working in HTML
Another suggestion is to do this with a list event, example: window.onload = function() { var el = document.getElementById("elementoAlvo"); el.addEventListener("click", escopoProjeto, false); } var…
-
1
votes3
answers347
viewsA: Favorite facebook style button
There’s "n" ways to do this, but a simple way to get this by using jQuery is like this: <a href="javascript:void(0);" class="btn_nornal">Favoritar</a> In the example below it makes a…
-
1
votes1
answer73
viewsA: Why does Pdo not recognize id?
To solve the problem, you can do the following: $insereMsgLogra->bindValue(2, (int) $idUsuario, PDO::PARAM_INT); This will make a cast in its parameter, forcing it to always be an integer value.…
phpanswered Ivan Ferrer 12,096 -
0
votes1
answer180
viewsA: Why is the TXT file having problems using file_put_contents?
See if this solves your problem: <?php $dados = "Olá mundo!"; $copy_utf16 = iconv("UTF-8", "UTF-16LE", $dados); file_put_contents("arquivo.txt", $copy_utf16, FILE_APPEND); ?> Look at Soen’s…
-
0
votes2
answers112
viewsA: How to lock commit via an ajax request by a bind() event on button
The problem is that the value that was coming in the log console was: ' "1"' or ' "0"'. So I solved the problem as follows: self.checkUsedTimeSlot = function() { var ddw_order_date =…
-
2
votes2
answers241
viewsQ: Ordering of all elements of a multidimensional array (array)
I need to sort the array below in alphabetical order using the numeric key: Array ( [AM] => Array ( [1] => Array ( [localidade] => Arena da Amazonia [cidade] => MANAUS [estado] =>…
-
1
votes3
answers2968
viewsA: How to install Android Studio on Linux distributions?
Before installing it is necessary to have the JDK. To install the JDK: download the app: https://developer.android.com/studio/index.html save it to your download folder: ~/Downloads/ and extract,…
-
7
votes4
answers3142
viewsA: How to protect an AJAX request?
There is a simple solution that is set through the Apache server, for this you need to activate the Cross-Site XMLHttpRequests in the mod_headers: Read more here on how to activate Cors What the…
-
1
votes2
answers112
viewsQ: How to lock commit via an ajax request by a bind() event on button
The ajax request, returns me "1" or "0". Every time I click the next button, but it is not blocking the commit. As I should do to validate the values, if I have a "0" answer, it should lock the…
-
8
votes3
answers24766
viewsA: Is it possible to use if Else in Mysql queries?
In the type of query you intend to do, you can resolve with a subquery: set @nome:='MATILDE'; SELECT CONCAT(' É MÃE DE ', f.nome) as filha, CONCAT(' É FILHA DE ', p.nome) as mae, CONCAT(' É AVÓ DE…
-
0
votes5
answers2964
viewsA: How to display a confirmation message when clicking delete from the grid option?
Within the class, include this method, and see if it will give the result you expect: protected void Page_Load(object sender, EventArgs e) { if (this.IsPostBack) { string eventTarget =…
vb.netanswered Ivan Ferrer 12,096 -
1
votes2
answers64
viewsA: Return Attribute group of a specific category
First I ran this query to bring up your full list and analyze your request: SELECT DISTINCT prd.id_prod as ID_PRODUTO, att.id as ID_ATRIBUTO, att.id_pai, att.nome_atributo, prd.id AS ID_TAB_PRD FROM…
-
1
votes3
answers109
viewsA: How to display the excerpt from the script where the exception was released in PHP
I think you could do something similar to this, I didn’t test it, I don’t know if it fits, but try it there: function myFetchContents($fileError, $errorMessage, $errorLine) { $fError =…
-
1
votes2
answers4580
viewsA: PHP - How to compare a date that comes from the Mysql database to the current day?
One way to do this is by using the object Datetime, and check the number in "timestamp" format, just resetting the milliseconds: $dataAtual = new DateTime(); function formatDateObj($dateString) {…
-
1
votes2
answers594
viewsA: How to detect a bot
One way to do this is to create rules in the .htaccess, that prevent some known agents who are robots, hence you would have to have a complete list or search for a complex list of these agents:…
-
0
votes0
answers77
viewsQ: How to ignore a subdirectory that is not being represented at the current address?
Obs: The links are fictitious, but they represent my problem. I have a project done in pre-store that in the production environment, is within a subsdirectory: www.site.com/rio/index But in my…
-
0
votes2
answers697
viewsA: Do SQL query in 3 tables and return the value to another table?
You can create a view for this: DROP VIEW IF EXISTS view_D; CREATE VIEW view_D AS SELECT descricao FROM tab_A union SELECT descricao FROM tab_B union SELECT descricao FROM tab_C; And then select the…
mysqlanswered Ivan Ferrer 12,096 -
0
votes2
answers672
viewsA: Can I use IF inside FROM in Mysql?
Simplifying like that would no longer solve your case? SELECT IF(COUNT(p.*) > 0, p.*, c.*) as usuarios_maior_volume FROM pessoas p, clientes c; And to catch global: SELECT * FROM pessoas,…
-
1
votes2
answers537
viewsA: Problems with JSON on the server
Your server’s problem may be an access restriction to the JSON output. In php, you can do this to release the request: header("Access-Control-Allow-Origin: *"); Although the most appropriate and…
-
-1
votes1
answer3825
viewsQ: Fix permissions on the linux root
I made a mistake here on my linux, I ran it: sudo chown -Rf www-data.www-data /* And I gave one ctrl+c after four seconds... because I saw the mistake I had made. That’s supposed to be it: sudo…
-
0
votes3
answers447
viewsA: How to make the content appear in the DOM only after clicking - Angularjs
A simple way to do this is by removing the first one, using its removal method within a method init() inside your controller: $scope.init = function(el) { $scope.removerIcms(el); } $scope.init(0);…
angularjsanswered Ivan Ferrer 12,096 -
1
votes1
answer86
viewsQ: How to create a rewrite rule to read a repository from a website subdirectory
I have two folders in my root: www/Repo-sp/ www/Repo-Rj/ My virtual host (www.meusite.local) points to www/repo-sp/: When typing /rio at the end of the site, it should point to www/repo-rj/, that is…
-
0
votes2
answers119
viewsA: I converted a two-dimensional array to an object in PHP. How to access the values?
There is not a good reason to make this conversion you want, but to be able to capture the elements of cast of the array, it is necessary to convert it to an accessible element, one of the ways to…
-
2
votes2
answers3429
viewsA: Is it possible to capture PHP code from a page using CURL?
It is not possible to execute a third-party PHP code because the PHP code is sent to the server, processed and then returns an HTML output, what you can do is capture only this output, and use only…
phpanswered Ivan Ferrer 12,096 -
2
votes1
answer903
viewsQ: How to validate the IP of a list Emails to know if they are real or fake and can receive messages?
I know there are services that do this, but I would like to know how they do this kind of test, to find out if the email is really valid, not only through a PHP filter, for example: function…
-
1
votes2
answers246
viewsA: How to overwrite a page with ajax
You can do this in a simple way by using jQuery: $(function() { $('.loader').hide(); }); function openPage(pagina, id) { $('.loader').show(); $('#'+id).load(pagina); } HTML: <a…
-
2
votes2
answers2455
viewsA: Move to next line when reading txt file in Php
Using the function readline, would that way: $file = '/caminho/seu_arquivo.txt'; $linha_lida = 2; if ( file_exists( $file ) && is_readable( $file ) ) { echo readLine($file, $linha_lida); }…
phpanswered Ivan Ferrer 12,096