Posts by Lucas de Carvalho • 6,427 points
260 posts
-
1
votes2
answers43
viewsA: How to determine if two random values are next?
Try this logic, I did not test. if ($rand1 > $rand2) { if ($rand1 - $rand2 == 1) { echo "Esta perto"; } else { echo "Está longe"; } } else if ($rand2 > $rand1) { if ($rand2 - $rand1 == 1) {…
phpanswered Lucas de Carvalho 6,427 -
0
votes1
answer391
viewsQ: Site view internet speed
What languages are used to create these Internet speed sites? Could you give examples of how to calculate this? Or is it something complex?
pingasked Lucas de Carvalho 6,427 -
4
votes0
answers51
viewsQ: Why is it recommended to encapsulate in POO?
Would you have small examples to show me? To understand why? I’m studying PHP, but it can be in any language.
-
1
votes1
answer339
viewsQ: Create pull function()
I have a problem in my logic here, I need to create a sac() function, but it has the following requirements: • Account needs to exist • She needs to have balance greater than 0 • The sake cannot be…
-
1
votes0
answers37
viewsQ: What is Ajax and how to use it?
I looked for exactly what Ajax is here in the OS but I did not find, I only found how to use ajax for this and for that. So I wanted to understand better, because I only know how to use Jquery,…
-
1
votes1
answer404
viewsQ: Pick up value script Confirm and move to PHP
Do you have how to do that? A confirm data <script></script> go to URL? To work in PHP using $_GET[""];
-
5
votes2
answers4088
viewsQ: Getters and Setters Methods
In my course, I’m learning getters which takes "data" and setters, inserting/modifying. I made my code like this for the pen class: <?php class Caneta { public $modelo; private $ponta; public…
-
14
votes2
answers2108
viewsQ: Are function and method the same thing?
When we talk about methods and functions, we are talking about the same thing? For example: function blablabla blabla That is a method?
-
0
votes0
answers33
viewsQ: Electronic distribution in PHP without exceeding the electro limit
I want to create a program that makes the electronic distribution according to Pauling’s diagram. Before we begin, I have a question: How can I limit, in PHP, the amount of electrons that each…
phpasked Lucas de Carvalho 6,427 -
1
votes2
answers925
viewsQ: Using $this in POO PHP
I don’t quite understand what $this "gets". In this case we have a code like this, for example: <?php class Teste { public $testando; public function VamosTestar(){ this->$testando = false; }…
-
7
votes1
answer249
viewsQ: Everything I can do in POO I can do in PE?
Can I do everything or change anything? I have limits in structured programming where in POO I don’t have?
-
1
votes1
answer97
viewsQ: How to remove the warning not to use VAR in Netbeans?
Right here in the OS, I saw that I no longer need to use VAR, when declaring a variable in PHP, this was only until PHP4. Netbeans keeps giving error, if I don’t use, and use only the variable How…
-
9
votes1
answer1539
viewsQ: Why use VAR in PHP?
Why use VAR in php if we can already declare variables without VAR? We can do this: $teste then why do it? var $teste For example, it’s the same thing I do? class Caneta { var $modelo; var $cor; }…
-
1
votes3
answers1036
viewsA: problem filling in form with uppercase letters
Can use strtolower and convert, before sending to database. strtolower EDITED <script type="text/javascript"> // INICIO function minuscula(a){ v = a.value.toLowerCase(); a.value = v; } //FIM…
-
1
votes0
answers27
viewsQ: Why use different quotes gives me different results?
Why do I wear it like that, it comes out different? It’s not the same thing? $teste = 'HAHAHA'; echo "Variavel $teste<br>"; // Retorna Variavel HAHAHA echo 'Variavel $teste'; // Retorna…
phpasked Lucas de Carvalho 6,427 -
0
votes2
answers4315
viewsQ: Modal ajax mail tracking
Is it possible to make a script that pulls the tracking of some item on the post office page? For example, inside my website: https://meusite.com.br/requests. There’s the link in the case for…
-
6
votes1
answer6117
viewsQ: Take elements by class/id with pure Javascript
In jQuery, we use quotes to pick up $('div.oi'). What about pure Javascript? Piss if we use without quotation marks is different. If we change the css for example: With jQuery:…
-
8
votes2
answers139
viewsQ: Everything I do with Jquery I can do with Javascript?
I have a serious problem that is: I’m learning jQuery before Javascript, and I think now I’m going to get hurt, put in my sites only use jQuery, and I’m realizing it’s bad practice. But returning…
-
1
votes1
answer28
viewsQ: Why can’t you call CSS "pasted" classes
Why can’t I call classes "glued", like this: .div1.div2.div3 { blablabla; } That’s the only way I can do it: .div1 .div2 .div3{ blablabla } I’d like to know the difference.…
cssasked Lucas de Carvalho 6,427 -
21
votes1
answer3524
viewsQ: What does the asterisk in "* {}" mean in CSS?
Sometimes I take sites ready to edit and realize that the console appears: * { /* código aqui */ } What does that asterisk mean?
cssasked Lucas de Carvalho 6,427 -
0
votes2
answers1203
viewsA: How to create a confirmation window on a PHP system?
Try with Jquery: $('a[title="Deslogar"]').click(function(){ confirm('Quer fazer logout?'); });
-
0
votes0
answers57
viewsQ: How foreach actually works in PHP
Could someone explain how really works the foreach and how to use? I’ve researched and can not understand, I’ve seen it right here in stackoveflow, has THAT ONE topic, but it is not explained, I…
-
1
votes4
answers251
viewsA: substr only with string greater than 4 character
You can use the strlen function to count STRLEN <?php $str = 'abcdef'; echo strlen($str); // 6 caracteres $str = ' ab cd '; echo strlen($str); // 7 caracteres, pôs espaço conta ?>…
phpanswered Lucas de Carvalho 6,427 -
0
votes2
answers162
viewsQ: Skip path that CSS "traverses"
I can "skip the way css goes"? Example: <body> <div class="a"> <ul class="b"> <li class="c"> Teste </li> </ul> </div> </body> There for example, I…
-
3
votes1
answer195
viewsQ: Edge Console? Is there?
Is there a console in the Edge? How to open and use? There are some things I need to fix in the site’s CSS in the Edge and without console I can’t know.
-
2
votes2
answers756
viewsA: How do I break a line to send an email to a user with HTML?
Uses the <br> same as html "<b>Linha 2:{1}<br/>" + "1. Linha 3.{2}<br/>" + "2. Linha 4.{3}<br/>" + "3. Linha 5.{4}", Environment.NewLine);…
-
2
votes2
answers81
viewsQ: Are there "problems" using jQuery’s small?
For example, some parts of a site, I can not fully touch the HTML, put the platform blocks for "security" and does not let modify, so I use jQuery/Javascript to make the modification I need. Does…
-
0
votes3
answers1847
viewsA: Calling PHP file in HMTL form
Put in form one action="pagina.php" Example <form method="post" action="teste.php"></form>
-
2
votes2
answers524
viewsQ: PHP routines, using Return
In the course of PHP I am doing, we are now in routines, and we started using Return, but I still do not understand very well. <!DOCTYPE html> <html> <head> <link…
phpasked Lucas de Carvalho 6,427 -
1
votes1
answer3006
viewsQ: Center select text
How to center the text of a select? I removed the arrows down with the -moz-appearance: none; -webkit-appearance: none; But the text is on the side and does not center. It looks like this:…
cssasked Lucas de Carvalho 6,427 -
1
votes2
answers29
viewsQ: Modify TAG that does not have such a class
When we want to modify a div, and it has such a class, it’s easy. .umaclass{ /*Formatação*/ } But let’s assume that I want to take a div that does not have such a class, without modifying the ones…
-
0
votes2
answers73
viewsQ: Insert idented HTML into jQuery
Why can’t you put the idented HTML in jQuery? If I put it in "straight" it works, already if I put it indented, to be easier to edit later, it no longer works. Why? UNFORMATTED, IT WORKS:…
-
2
votes2
answers1012
viewsQ: Arrange amount of Divs/columns per row
I have the responsive site, and I have a list of products. On the desktop it is OK, it is for example: |PRODUTO 1| |PRODUTO 2| |PRODUTO 3| |PRODUTO 4| |PRODUTO 5| |PRODUTO 6| |PRODUTO 6| |PRODUTO 7|…
-
0
votes1
answer5666
viewsQ: Difference between CSS3 and CSS4
CSS 4 exists? What’s different from CSS 3? Do browsers already support? I was looking for CSS 3 on Google and saw some people mention CSS 4.
-
14
votes4
answers14426
viewsQ: What is the difference between "margin: 0 auto;" and "margin: auto;"?
As the title already says: What exactly is the difference between margin: 0 auto; and margin: auto;? margin: 0 auto; margin: auto; Why can you only use 0? What would be the unit of that 0? px? %?…
-
2
votes3
answers1993
viewsQ: Exchanging TAG with Javascript
Is there a way in JS/Jquery to change a tag in HTML? For example, I have a: <div></div> And I want, let’s say I want it to become a span: <span></span> In short, to change:…
-
0
votes1
answer676
viewsQ: What is the inherit and initial of the CSS for?
As the title itself says, what’s the point of inherit and the initial that has in the CSS?
cssasked Lucas de Carvalho 6,427 -
0
votes1
answer382
viewsQ: Use screen size in 100%
I have two Ivs, DIV 1 is 80% wide, centralized and I have DIV 2 that is within DIV 1, which I want to be 100% wide, but since it is within DIV 1 that is 80%, then 100% becomes 100% of DIV 1 (turning…
-
0
votes1
answer616
viewsQ: CSS does not work on IOS
My site gets all buggy on IOS, is it because css doesn’t load? How could I get around the problem? Is there any IOS console, like Chrome and Firefox, to fix the site? on Android it works normal.…
-
1
votes3
answers5502
viewsQ: Remove TAG with Javascript
How to remove an HTML tag using Javascript? For example, with insertAfter(); and insertBefore(); I can insert some tags if I want. But if I want to delete from my code, some TAG? Not by display:…
-
1
votes3
answers78
viewsQ: While PHP does not exceed count
How do pro while identify that will exceed the count set in the form and pause before? FORM: <form method="get" action="exercico04.php"> Inicio: <input type="number" name="inicio" value="1"…
-
1
votes1
answer5296
viewsQ: Copy text by clicking on a DIV
How do I, with Jquery preference, when clicking the ola class div: $('ola').click(function(){ //FUNÇÃO DE COPIAR AQUI }); Does it copy a text? For example, by clicking on the ola class div, it copy…
-
1
votes1
answer349
viewsQ: Make code only work on Desktop
How do I make a code, Jquery/Javascript work only on Desktop? That is, on mobile phones and tablets, I do not want it working... With CSS I use Media Query, but with Javascript I get lost. Thank…
-
0
votes1
answer368
viewsQ: Leave softer effect
How I make this effect softer? $j(window).scroll(function () { console.log($j(document).scrollTop()); if ($j(document).scrollTop() >= 300) { $j('.logo img').attr('src',…
-
0
votes1
answer513
viewsQ: Swap image while scrolling down page
How to change the image’s SRC (With Jquery) when scrolling down the page and the scroll is larger than 10? Change the <img src="imagem_1.png" alt="Meu site"> for <img src="imagem_2.png"…
-
1
votes2
answers2719
viewsQ: Add and remove Jquery class
I have a toggle effect that opens and closes a div, and in this effect, I put to add a class and remove. It adds the class, but is not removing it. Why? Jquery…
-
2
votes2
answers4715
viewsQ: Toggle() Effect Down, Jquery
Is there any way to change the direction of Jquery’s toggle() effect? For example, I made a button that when clicking, it shows and closes a div $('.botao').click(function(){ $('.div').toggle(700);…
-
28
votes3
answers466
viewsQ: Comments weigh in?
Comments weigh? I leave comments throughout my code, will influence something on the site? I’m saying more specifically in HTML, CSS, Javascript, PHP.
-
-1
votes1
answer48
viewsQ: Redirecting of Urls
Good morning! I have 2 wordpress sites (1 will be deleted) and are with duplicate posts, put exported and imported in the other. Is there a way for me to redirect all urls at once? Example: Whatever…
-
2
votes1
answer59
viewsQ: Check if the person will close the site
Is there any way to check if the person’s mouse is going to close the site? With Javascript, etc... In the simplest case: if(estaindofechar){ alert("Tem certeza?"); }…
javascriptasked Lucas de Carvalho 6,427