Posts by Gonçalo • 2,525 points
176 posts
-
0
votes2
answers149
viewsQ: How to separate obtained Loadhtml results
Well, I have the following code: <?php $url = 'https://www.zerozero.pt/edicao.php?id_edicao=135716'; $str = ''; $html = file_get_contents($url); //debug purposes //$html = '<div…
-
2
votes1
answer88
viewsQ: How to interrupt a cycle of "whiles"?
Well, I’m going to give a very abstract example in order to be able to express my doubt more simply I have following code: while(a>b){ // Meu while principal while(c>d){ while(e>f){ } } }…
-
-1
votes1
answer178
viewsQ: How to check the number of words in a String?
Well, I’m doing a job for college where I need to identify the number of words that a string has in Kotlin. Type : texto = "Ola Mundo" The variable numeropalavras has to be equal to 2. Is there a…
-
-1
votes2
answers223
viewsQ: How do I concatenate a decimal value?
Well I have the following code: <?php $numero = "5"; $decimal = "30"; ?> What I want to do is concatenate the number so that the final result is 5.3 and so that the right zeros do not…
-
0
votes0
answers35
viewsQ: Problem when exchanging image with jQuery
Well it’s like this, I have the following code: <script type="text/javascript"> document.addEventListener("keydown", keyDownPress, false); var valoresDigitados = []; function keyDownPress(e) {…
-
2
votes2
answers451
viewsQ: How to remove white space
I have the following code var ola = "242 052"; How do I remove space from the variable? For example, so: var ola = "242052"; Thank you…
javascriptasked Gonçalo 2,525 -
1
votes3
answers62
viewsQ: Get only 1 of each journey
Well, I have a table called tabelajornadas. In it, I have several records, and in which I have the column jornada, who’s kind int. In it, they contain several records with the same number in the…
-
3
votes3
answers269
viewsQ: Click a buttom and a prompt appears
I have a button, and I intend that, by clicking, a prompt to ask if you really want to leave the page, with 2 options: Confirm or cancel. If you click confirm, it will go to the button, otherwise…
javascriptasked Gonçalo 2,525 -
3
votes1
answer79
viewsQ: My code is not properly comparing variables
setInterval(function(){ $.getJSON("http://127.0.0.1/recebecores/valor.php", function(array) { quantidade = array[0]; document.getElementById('betAmount').value = quantidade; var tempo =…
javascriptasked Gonçalo 2,525 -
1
votes1
answer88
viewsQ: What’s wrong with my code?
var quantidade = "200"; setInterval(function(){ var tempo = document.getElementById("banner").textContent; var match = tempo.match(/[^\d](\d+)/); var nr = match && match[1]; if(nr === "5"){…
javascriptasked Gonçalo 2,525 -
2
votes1
answer62
viewsQ: How to check if it already exists in the comic book?
Well, I have this code: <?php $link = mysqli_connect("localhost", "root", "vertrigo", "recebecores"); $red = $_GET["red"]; $green = $_GET["green"]; $black = $_GET["black"]; $procura1 =…
-
3
votes1
answer91
viewsQ: How to remove some characters from a var javascript?
Well I have the following code: var tempo = "Rolling in 8.31..."; What I want is from the string above, leave only the number 8, so that var time, stay as follows: var tempo = "8"; How can I do…
javascriptasked Gonçalo 2,525 -
0
votes0
answers33
viewsQ: What’s wrong with this code?
<span style="margin-left:13%;" id="temporizador">Loading...</span> <div id="roda"></div> <div id="ponteiro"><b style="margin-left:15%; margin-top:500px;…
javascriptasked Gonçalo 2,525 -
2
votes1
answer1477
viewsQ: How do I rotate an image with jquery?
Good is the following I have the following code: <head> <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> </head> <img…
-
1
votes1
answer1126
viewsQ: Place div next to div
Well, I have div items and div items2, which are both inserted within 1 div. What I intended to do was to align the div items and the div items2, since the div items2 is always below the other. What…
-
0
votes1
answer937
viewsQ: How do I place a column next to another bootstrap
Well here’s the thing, first of all I’m sorry the question is a bit dumb, yet I’m new to bootstrap. What I want to do is a menu on the left side and another menu on the right side. How can I do…
bootstrap-3asked Gonçalo 2,525 -
0
votes1
answer4380
viewsQ: How to limit the size of a div
Well, I don’t know what title to ask, so if anyone wishes to edit I accept. I have the following scheme: http://151.80.152. 6/home.php I intend to do with the div itemsatual, have that limited…
-
1
votes2
answers254
viewsQ: How to split a link into "multiple parts"?
I have the following link: https://steamcommunity.com/tradeoffer/new/?partner=377361903&token=9Q0WYuq0 What I want to do is to store the value of Partner in a variable called $partner, and the…
-
2
votes1
answer453
viewsQ: How do I check with nodejs if a table is out of records?
Well, I intend to check a table with nodejs, to see if it is without records. How can I do this in a way that makes no mistake, with nodejs? Thank you.
-
2
votes2
answers662
viewsQ: Set Auto Increment position, always for the smallest ID
I have a database Mysql, where contains a table called usuarios This table contains a column ID, where is Autoincrement and kind INT I need you to: Whenever I enter the first result the ID be equal…
-
0
votes3
answers758
viewsQ: How to add a number with a string
Well, I have the following code: <script type="text/javascript"> var mao1 = "goncalo1"; var mao2 = 1; var mao3 = mao1+mao2; window.alert(mao3); </script> What I intended was that var…
javascriptasked Gonçalo 2,525 -
0
votes0
answers32
viewsQ: Error using SQL with javascript
I would like to know what is wrong with those lines, especially in the query, as it is not working: pool.query('SELECT * FROM `info` WHERE `id` = 1', function(err, row1) { var jogo = row1[0].jogo;…
-
2
votes1
answer644
viewsQ: How do I return the value of a query in the nodejs
Well, I have the following code: pool.query('SELECT * FROM `info` WHERE `id` = 1', function(err, row) { var jogo = row[0].jogo; console.log(jogo); }); The problem is, if I take out the var game of…
-
6
votes1
answer202
viewsQ: Problem Doing JSON to a Site
I need to do JSON from the following link, in order to obtain the data for a record AWP | Dragon Lore (Field Tested) of the day: 2017-03-25. Link: https://opskins.com/pricelist/730.json How can I…
-
1
votes1
answer165
viewsQ: How to copy everything from a website and save to a txt file
Well, what I intend to do is relatively simple: I intend to copy the entire code from this link: http://steamcommunity.com/profiles/76561198337627631/inventory/json/730/2/ And save to a txt file.…
-
5
votes2
answers3112
viewsQ: Is there a URL in Nodejs?
Good is the following I needed some function that served me as "Curl", to use in nodejs. Is there any Function, which does the Curl equivalent in php? Thank you.
-
5
votes1
answer684
viewsQ: Nodejs running at Gate 80 with Apache
Well, it’s like this, whenever I want to use socket.io I have to use some port, so whenever I want to have access to the web page that works with the socket.io I have to go to : wwwwww.meusite.com:.…
-
-1
votes1
answer1130
viewsQ: How can I get the value of a div with id=x
Well, what I intend to do is this: I have the index.html page, with javascript I intend to do a json that gets me the value of a div with id="x" of the test.html page. How can I do that?…
-
1
votes1
answer634
viewsQ: Call Counter Socket.io
Well, here’s the thing I have the following code in my app.js of my project, which I picked up on the Internet to study: // Servidor: app.js // Iniciando servidor HTTP var app =…
-
0
votes2
answers72
viewsQ: How do I center the content of an element vertically?
Well, I intend to centralize the contents of a div, at a vertical level. My div, she’s inside another div that’s the container: DIV Container: container{ margin-left:10%; margin-right:10%;…
-
1
votes2
answers1417
viewsQ: Why doesn’t the background-color appear?
Well, I have the following code: body { background-image: url("imagens/fundo.png"); background-repeat: no-repeat; background-size: cover; margin: 0; } .container { margin-left: 10%; margin-right:…
-
0
votes1
answer189
viewsQ: How can I margin-top a div?
Well, the thing is, I have several Ivs, which are contained in a div of id="container". Some, I want them to be higher up than others, but I wanted to make margin-top, of all of them for one point,…
-
1
votes1
answer87
viewsQ: How do I join 3 backgrounds?
The thing is, I have a div with id="1". And I have three images, with 20 pixels each that I want to be my backgrounds, but I want my div to have all three backgrounds, so on the left side of each…
-
2
votes1
answer4477
viewsQ: How do I put the div at the top of the page by tapping right at the top
Well, I have the following code: <style> body{ background-image: url("imagens/fundo.png"); background-repeat: no-repeat; background-size: cover; } .logo{ margin-left:10%; } .linha1{…
-
1
votes1
answer145
viewsQ: Responsive site with %
Well, my doubt is a bit abstract, however I would like to hear some aspects regarding Responsive Site. I would like to know, what is the way a website will look the best for all screens. That is, if…
-
1
votes3
answers1163
viewsQ: How to get the id of the onclick that was executed
Well here’s the thing, I have a button that has the following structure: <button id="goncalo" onclick="ativafuncao()">Goncalo</button> How do I make for the function activating(), know…
javascriptasked Gonçalo 2,525 -
6
votes1
answer368
viewsQ: Why do they say $_GET in PHP is insecure against sql Injection?
Well, my question is simple. I’ve been hearing a lot of stories lately that $_GET in PHP is insecure against sql Injection. Could you tell me why? Thank you.
-
1
votes1
answer193
viewsQ: Fade effect run in jQuery
Well, I’ll try to explain in the best way, what I intend to do: I have a div with the border id, which actually div serves as edge. I intend to make an effect in jQuery, run color change, top to…
-
-1
votes1
answer84
viewsA: Credit card payment platforms
The question does not fit in the programming area, however below I leave some more that you can use: Netteler Skrill G2apay All are very good and work more or less the same way.…
online-paymentanswered Gonçalo 2,525 -
2
votes3
answers829
viewsQ: How can I check if a variable is in date format?
Well, I want to check if a $x variable is in date format (yy-mm-dd), how can I do this with PHP?
-
2
votes3
answers5128
viewsQ: How to allow only numbers and dashes with preg_replace?
I have a question regarding preg_replace, would like to know how could you do to allow only numbers, and hyphens (-). My code is this:: $ola = preg_replace('/[^[:alnum:]_]/', '',$_POST['ola']); How…
-
0
votes0
answers37
viewsQ: Is Mysqli safe against SQL Injection?
Well, recently I had to read a security article against SQL Injection, and saw that the same in the article recommended the connection and interaction of the database by PDO and not by mysqli. I…
-
0
votes0
answers41
viewsQ: How can I protect a js file?
Well, my doubt is very simple, I intend to protect somehow a file . js, so that no one can see my code. Is it possible to do that? In other words, I intend that no one has the possibility to see my…
javascriptasked Gonçalo 2,525 -
6
votes2
answers263
viewsQ: How do I make mysql_num_rows of various results
Well, what I want is this: I have 1 table designated by items, in this table I have 4 columns: nomeitem iditem (Single id) numerobot What I intend to do is: I want to do a mysql_num_rows of all…
-
9
votes3
answers689
viewsQ: phpMyAdmin is insurance against bruteforce?
Well, my question is this:: phpMyAdmin has some bruteforce security in the password? That is, at the end of x attempts, the IP gets locked or something like that? Thank you.
phpmyadminasked Gonçalo 2,525 -
0
votes1
answer8521
viewsQ: What is the best way to make a "password" for Steam Login?
Well, I tried to do with steamid, as if it were a password and receive the data by POST, however I find this a very insecure way seen, that Hackers, can change the steamid, and log into the account…
-
1
votes0
answers22
viewsQ: How not to allow rolling while in effect
Well, here’s the thing I have the following code: <!DOCTYPE html> <html lang="PT-BR"> <head> <title></title> <script…
javascriptasked Gonçalo 2,525 -
0
votes1
answer2349
viewsQ: How to rotate a div?
Well, I have a div that contains secondary Ivs within it, what I intend to do is to make an effect, which rotates the interior Ivs, ie from right to left, keeping the position of the main div. In…
-
0
votes1
answer74
viewsQ: Place secondary Ivs next to each other inside the main
Well it is as follows, I have the following code, what I intend to put the Divs that are inside the div with id="Goncalo" next to each other in the form of a straight line, that is, I want it to be…
-
0
votes1
answer33
viewsQ: How to make a background with a set of images?
Well, my question is this, how can I do a background of a div in css, with a set of images and not just 1? Thank you.