Posts by Leite • 1,147 points
56 posts
-
0
votes2
answers65
viewsA: Insert variable in jquery Animate value
In principle the value must be passed correctly, however, the animation only seems to work if you use in $("html, body"). Thus var top = $(".sku").offset().top; $("html, body").animate({ scrollTop:…
-
0
votes1
answer44
viewsA: my question is about the error: Uncaught Referenceerror: createSlider is not defined
You’re right, you need to include a dependency to get the job done createSlider. In your HTML you have to import the p5js library, because it is the one that provides the function createSlider. You…
-
2
votes1
answer35
viewsA: $_FILE not defined
The correct name will be $_FILES instead of $_FILE. You can consult here the documentation.…
-
1
votes1
answer401
viewsA: Calculate installment entry value - PHP
You can for only 2 checks if it exists $valor_entrada at specific points of the function to change its behavior, without having to separate into 2 distinct blocks that do something very similar.…
-
1
votes2
answers508
viewsA: Loading script.js (external) using Domcontentloaded?
You’re right, the problem is that when the file encurtador.js is included, the event DOMContentLoaded has already been launched, so the new script will never be Triggered. Fortunately this is all…
-
0
votes1
answer76
viewsA: How to change the background of wordpress posts and leave each one with a different color?
The problem is that div .postagem is the only daughter of the div .col-md-4, then the CSS :nth-child(2) and :nth-child(3) do not apply. If you change the class .postagem to where the class is…
-
1
votes1
answer94
viewsA: Create array through function
Yes, you can return a filled array and then use this to display the information, for example <?php function calcParcelaJuros($valor_total, $parcelas, $juros = 0){ $parcelado = []; if ($juros >…
-
1
votes2
answers279
viewsA: Replace foreach php by each jquery
PHP and include_once In PHP when you include other files in a file (include, include_once), when processing that file, PHP, will manage that code as if it were a whole file (the one that calls the…
-
2
votes1
answer216
viewsA: Grab bank ID to load into HTML select
Maybe it’s the issue that’s not well-crafted, because I don’t fully understand what the problem is, but what I understand about your parameters is $sql - SQL que vai retornar os resultados para…
-
4
votes4
answers355
viewsA: Edge at intersection between 2 elements - CSS
Only with CSS, you can use pseudo-elements ::before and ::after, however this solution works only if the bottom of the page is solid. In your case, as it is a gradient, it is possible only with the…
-
1
votes1
answer1063
viewsA: Nameerror : is not defined in python3
The only problem I see in the code is that the indentation of the return aux1 + aux2 is misaligned. Python, unlike other languages (e.g. PHP), space is important, and this is what defines language…
-
0
votes1
answer95
viewsA: How I create an optional parameter
It seems to me that there are several possibilities here, but that you do not want to enter the if case bonus1 or bonus2 be false. If bonus2 is optional, you can set its value to true by omission.…
-
0
votes2
answers3993
viewsA: Momentjs - How to add/subtract datetime?
What result do you want for sure? You got the add and the subtract, which you can use to add or remove seconds, minutes, hours etc. var convertDatetime = moment(datetime).add(1, 'days'); If you want…
-
2
votes2
answers80
viewsA: Script syntax error jQuery product variation
As I understand it, you’re putting onClick on .swatch, which is the image container and variation description. You should change your code to add the event only in the link Select which is the <a…
-
0
votes1
answer347
viewsA: Display error message just below the form with the action on the same page!
When the page loads $resposta it won’t be 1, it’ll be none by the logic you have at the beginning of the file, hence it always print the error message. I suggested that you put the check and…
-
1
votes1
answer51
viewsA: Return to the JS slide
It’s almost over there! If you had animations, you would have to change a little what you already have, but, as (at least for now) you don’t, just change your conditions that change to var current…
-
1
votes1
answer35
viewsA: Insert image path in BD and file on server
The problem seems to be on the way to the target folder of the image, the relative path will not be correct because php is running in a folder other than the one that has the upload file, this must…
-
3
votes2
answers529
viewsA: Send email using Phpmailer
If you do not need to attach files to the email, remove these lines. If you want to keep the code for later use as an example, comment then use // at the beginning of the line to become a comment.…
-
1
votes2
answers131
viewsA: Can anyone tell me what is causing this error
Your query must be returning false, which is what the PDO::query returns when the query fails, if it was working, it should return a PDOStatement, that does not happen there. The problem may be the…
-
2
votes2
answers3397
viewsA: Read serial port data with javascript, Node
In Chrome 61 you have a Webusb API available, although I’m not sure if you’re gonna get what you want by using this, I hope I can at least put you on the right track or look for solutions that might…
-
3
votes2
answers47
viewsA: More than one value in the same GET parameter
Yes, it is possible to pass this way, you can use the explode() then to get each value individually. $campos = explode(",", $_GET["campos"]); You can also pass as an array //…
-
1
votes4
answers685
viewsA: Only put the correct message print once
No need to loop ai. As you are already checking the characters . and - using the positions of the string (e. g cpf[3] != ""), the cycle seems unnecessary. cpf = input("CPF(xxx.xxx.xxx-xx) :") #3 7…
-
1
votes1
answer55
views -
0
votes1
answer26
viewsA: Hash of some Cakephp2 field
I suggested you use the beforeSave to change the values before they are saved, and then you can do Security::encrypt() the password. As I recall, Cakephp2 doesn’t use getters/setters that way. Why…
-
-2
votes3
answers881
viewsA: Is it possible, in CSS or Javascript, to leave a color of a transparent image?
There is a CSS property that allows you to "hide" the background color of an image, but that image has to be set to background. The background of the div that has the image has to be the same…
-
0
votes1
answer40
viewsA: Error to use mongodb filter
Your params is a string, uses a normal javascript object. // aqui nao precisas contatenar como estavas a fazer, isto será suficiente var params = { cd_entidade: vcd_entidade };…
-
2
votes1
answer489
viewsA: Upload Ajax and PHP
The FormData supports only the <form> in the builder. If the .photo_change is the form, I think you can make, note that has the [0] since the FormData expects the HTML element and not the…
-
2
votes2
answers522
viewsA: Query SQL with multiple WHERE conditions
Your query is not a valid query, so the return of mysqli_query is a BOOLEAN, in this case false. You have other code problems. You close the loop here foreach ($v as $key => $value);, instead of…
-
1
votes2
answers784
viewsA: Problem accessing Json API with React
In React, to access objects/values that are in state of a component, you must use this.state, in your case would this.state.page
-
0
votes1
answer45
viewsA: Class not found on remote server
Locally it must be working because Windows is usually case-insensitive. On the server, which should be based on linux, it will be case-sensitive. You can change the vendor/autoload.php to always…
-
3
votes1
answer368
viewsA: Change pie colors Chart php
You have a field colors in options. Example var options = { // .. outras opcoes colors: ['#e0440e', '#e6693e', '#ec8f6e', '#f3b49f', '#f6c7b6'] }; chart.draw(data, options); If you do not control…
-
1
votes2
answers8160
viewsA: Error switching mysql port in xampp
You have to change the Phpmyadmin connection setting. To do this, go to the folder where Phpmyadmin is and find the file config.inc.php, then you’ll have a configuration like…
-
0
votes2
answers53
viewsA: Finally error with Try Cath
Try changing the line where you make the connection, error 500 can have many causes, but I think those line breaks and use the variables inside a string with ' instead of " is causing this problem.…
-
1
votes5
answers1890
viewsA: Receive and read array coming by Ajax
You have some options. You can use the option dataType jQuery, so it tries to guess the server response type depending on the MIME sent in it, if you do not control it or prefer not to change, you…
-
0
votes2
answers131
viewsA: Selected combo component
You have to compare on ng-selected the value of option with what you have in nota.flagARendimento <option ng-selected="nota.flagARendimento == 0" value="0">Não</option> <option…
-
0
votes2
answers41
viewsA: Having products from the database
I would suggest that you start by trying to make an HTML and CSS that looks like the final image, even before doing PHP (I assume), when you’re happy with the look, you start working on PHP to fetch…
-
1
votes1
answer137
viewsA: Working Dynamic Selectors (Or Multiple Selectors) in Jquery
Why don’t you just do everything on each that’s adding the CSS class? var $this = $(this); var str = $this.text(); var res = str.slice(0,15); $('<div…
-
0
votes2
answers508
viewsA: Input for receiving Cpf
You can do it alone return false for deny the key that has been pressed. There was a discussion about it recently here, although it was to block other characters.…
javascriptanswered Leite 1,147 -
0
votes2
answers592
viewsA: Virtual hosts configuration in Vagrant Homestead/Laravel
You have to do Provision box, if the box is already started, you must use the command vagrant reload --provision from the command line on the host, it will read Homestead.yaml again and configure…
-
2
votes1
answer73
viewsA: How to take a value inside an array with PP
Since it’s an array, and there may be more than one genre, you don’t want to have a cycle to catch all genres? If you just want the first one, it would just be $json['genres']['data'][0]['name'],…
-
2
votes2
answers220
viewsA: Item within comment in PHP
No, the @return string is only documentation of the method, in format Docblock. Your IDE and other tools, for example, the Phpdoc, use these special comments to give you information of what the code…
-
1
votes1
answer702
viewsA: Pass two variables in the javascript url
Use this help function to add/change querystring values. I’ve tried to comment to make you understand what’s happening at every step, but if you have any questions, feel free to ask. function…
-
1
votes1
answer56
viewsA: Why is the array lenght as Undefined?
The syntax is .length and not .lenght.…
javascriptanswered Leite 1,147 -
0
votes1
answer62
viewsA: Mysql above 5mil lines
How are you doing a query that uses BETWEEN in a table with many records, the field you use in the between must be set to INDEX. Mysql (and other database engines) will optimize searches that filter…
-
0
votes1
answer335
viewsA: how to run a previous with parameter in php
You can run a query before to set a variable for the past, and then use that variable in the call. mysqli_query($conexao, "SET @template = '" . $template . "'"); $figura =…
-
3
votes2
answers279
viewsA: How to remove null value from a foreach or array
If you use the continue after verifying that the $resultado[2] is null it will pass to the next element without executing the code that is after. foreach($valor as $resultado) { $nome_aluno =…
-
1
votes1
answer97
viewsA: Update a value in a conditional column by comparing 2 columns from 2 different tables
Without being sure of the structure, my best suggestion is use the IN instead of the =.
-
0
votes3
answers2062
viewsA: html form with PHP code to insert into mysql
If when you submit the form, what appears to you is the PHP code you should be saving to the database, the way you should be accessing the page is wrong. You’re using an address like…
-
3
votes3
answers6287
viewsA: javascript countdown
You just need to change your javascript a little bit var count = 60; var tempo = document.getElementById("tempo"); // associar a variável tempo ao elemento function start() { if (count > 0){…
-
1
votes1
answer29
views