Posts by Diego Andrade • 695 points
29 posts
-
3
votes1
answer490
viewsA: Generate JSON with header and detail of multiple records
First you need to do in a single query, to optimize select o.id, o.titular, o.data, o.status, i.id, i.nome, oi.quantidade, oi.preco from orcamentos o inner join orcamentoItens oi on oi.orcamento =…
-
1
votes0
answers222
viewsQ: Angular 4 application slows down over time
Hello. I have an Angular 4.3.5 application that slows down when used after a time (~20 minutes). My scenario is more or less like this: Rest API and Angular static files are on a Raspberrypi B 3…
-
1
votes2
answers376
viewsA: Why is JSON not considered a markup language? And why is XML?
Translated from: https://stackoverflow.com/questions/27647722/is-json-a-markup-language-like-xml Of Wikipedia: A markup language (document) is a modern system for annotating a document in a way that…
-
2
votes1
answer40
viewsA: What should I do to display the return of the get class in PHP?
remove the quotes inside your echo Edit: Or $x=$UserNow->getName(); echo $x;
phpanswered Diego Andrade 695 -
0
votes2
answers1152
viewsA: How to redirect Css to only one Div
add a class in div, example <div class="nomedaclasse"> then in a css or tag style, copy the code from the css file that you will take from somewhere else, instead of using the entire file.…
-
0
votes3
answers543
viewsA: json php error, but json is correct
I found characters like r n in your json. Try removing them in php before moving to variable. Suggestion: $json = preg_replace("/\r\n|\r|\n/", ' ', $json); I simulated your code by testing only this…
-
1
votes4
answers1270
viewsA: How to fix Cross site scripting or XSS
You have an option not as sophisticated as P1xm4, but an alternative is also filter_var: $busca= htmlspecialchars ($_GET[“busca”]); $strBusca = filter_var($busca,FILTER_SANITIZE_NUMBER_STRING);…
-
1
votes2
answers90
viewsA: problems submitting form
The error is in setting the js variable "post_data" with the data you sent by ajax. //data to be sent to server post_data = {'userName':user_name, 'userEmail':user_email, 'userPhone':user_phone,…
-
0
votes1
answer148
viewsA: error in the sublime
normally removes the theme: Ctrl + shift + p > "Package Control: Remove Package" looks for "Colorhighlighter". Then install it again
sublime-textanswered Diego Andrade 695 -
1
votes3
answers367
viewsA: Search field with php and mysql. How not to differentiate special characters?
Complementing @Victor Hartur de Carvalho’s reply a simple function to remove the special characters: function cleanStr($str) { return preg_replace("/[^a-zA -Z0-9_.]/", "", strtr($str,…
-
9
votes1
answer2540
viewsA: What is the difference between Javajdk and Openjdk?
Nothing crucial. The openjdk project is mainly based on the hotspot source code donated by Sun. In addition, openjdk was selected to be the implementation of reference for java 7, and is maintained…
javaanswered Diego Andrade 695 -
1
votes3
answers182
viewsA: Radio enabled field, bank checked
This happens because the change function was not called, since the page was loaded and the radio preselected. you can solve your problem by triggering the change function as soon as the page loads.…
-
1
votes2
answers3493
viewsA: Pass and receive field id by parameter
So I believe it should work Thiago: function habilitaCampo(valor, id){ if(valor == "Y"){ document.getElementById(id).disabled = false; document.getElementById(id).focus(); } else{…
javascriptanswered Diego Andrade 695 -
6
votes1
answer236
viewsA: What are the differences between Adodb and PDO?
PDO is standard in PHP as of version 5.1. (It is also available with a PECL extension in PHP 5.0) Most hosting providers will have enabled. Adodb is not a standard extension. Furthermore, I believe…
-
0
votes2
answers377
viewsA: jquery datepicker is always visible
Edited/corrected: I forgot to edit the fiddle link. Maybe using an input instead of the span tag will work. example: https://jsfiddle.net/3hcuLf0j/6/ html: <input type="text" id="test"…
-
3
votes2
answers2195
viewsA: Uncaught Typeerror: $(...). live is not a Function
check the version of your jquery, because the .live was discontinued in version 1.7 and removed from version 1.9 onwards. Source: http://api.jquery.com/live/ Tip: if your version is 1.7 or higher,…
javascriptanswered Diego Andrade 695 -
1
votes3
answers1847
viewsA: Calling PHP file in HMTL form
It depends, if you just want to redirect to the page at the moment of the click, you must create the tag for link if not, the act is the registration and you want to send data to work with them in…
-
2
votes3
answers2030
viewsA: How to create an empty object in PHP?
Standard class. Read more in: http://php.net/manual/en/reserved.classes.php $class = new stdClass();…
-
0
votes2
answers66
viewsA: Help with Jquery + Php
Edit: If you repeat the id of the Arrais n times, it will only catch the first time. The problem is pq vc is passing to ajax, only input values with ids a, b and c. So it will only interpret the…
-
2
votes1
answer88
viewsA: Undefined Variable using this
Your logic is right, however, there should be no 2 $. Change everywhere the $this->$conexao for $this->conexao
-
1
votes2
answers87
viewsA: I’m having trouble comparing two numbers in php
The method is with the same class name, so it is interpreted as a method the magic method __construct. Change the method name maior() or class, so as not to obtain this error. Edit: see more about…
-
1
votes2
answers220
viewsA: Return Jquery data within Input
$("#nome").data[nome]; $("#telefone").data[telefone]; $("#email").data[email]; replace with: $("#nome").val(data.nome); $("#telefone").val(data.telefone); $("#email").val(data.email); The code may…
-
0
votes2
answers450
viewsA: Put two icons in the same paragraph
create a "span" tag where you want to place the Whatsapp symbol, add the "class" tag and put the fa fa-Whatsapp" (I don’t remember if that’s the name of the class that matches the Whatsapp icon)…
-
1
votes1
answer134
viewsQ: Session Error - Permission denied - sites at different ports
Hello, good afternoon, sir. I’ve been trying to solve this problem for some time: I have a website that runs on the standard door and an administrative system that runs on port 8080. (ex:…
-
3
votes2
answers1959
viewsA: Show content in desktop version and hide it in mobile version. And vice versa
code snippet extracted from bootstrap library: @media (max-width: 767px) { .hidden-xs { display: none!important } } @media (min-width: 768px)and (max-width: 991px) { .hidden-sm { display:…
-
1
votes2
answers186
viewsA: How to return a specific variable from within a Function?
You can create a return array with the desired information, then your code would look like this: function list_all_pages() { $url_controle = $_SERVER['REQUEST_URI']; $url_controle = explode('/',…
-
1
votes5
answers3697
viewsA: How to import a variable within a function of a class?
It’s not recommended, but you could use it like this too: $valortotal = 15.00; class CreatePaymentRequestLightbox { public static function main() { global $valortotal; $pedido_total = $valortotal;…
-
0
votes2
answers737
viewsA: How to use one class functions in another?
You can use include/include_once/require/require_once in the file you will consume. http://php.net/manual/en/function.require-once.php To use methods of one class, within methods of another class,…
-
0
votes1
answer311
viewsA: Save data to database with Drag & Drop
Man, I’ve done it like this: I created a class in a TD for reference via jquery; within that td I created an input with name array and the key is the product id; at the time of clicking the reorder…