Posts by MagicHat • 12,262 points
358 posts
-
6
votes5
answers227
viewsQ: What are strings started with @inside PHP comments?
I was reading a code, like this : /** * PHPMailer - PHP email creation and transport class * NOTE: Requires PHP version 5 or later * @package PHPMailer * @author Andy Prevost * @author Marcus…
-
2
votes3
answers92
viewsA: Align vertical giving error!
So you make a mix using the property text-align:center and line-hegiht. <style> .login { display: block; width: 100%; height:50px; border:#E9E9E9 3px solid; position:relative;…
-
8
votes1
answer220
viewsQ: What is cache in the context of the Web?
It’s often said, "Oh, that’s stored in cache..." Where the browser stores your cache, there is a limit size and has some relationship with the Local Storage`?…
-
2
votes2
answers499
viewsA: Show/ Hide div, changing icon
Switch the dial to: var img = document.querySelectorAll('img'); jQuery.fn.toggleText = function(a, b) { return this.html(this.html().replace(new RegExp('(' + a + '|' + b + ')'), function(x) { return…
-
2
votes3
answers186
viewsA: How to pick up middle item with javascript or css?
You can use js using the method getElementsByClassName <div class="corpo"> <div class="item">1</div> <div class="item">2</div> <div class="item">3</div>…
-
9
votes3
answers302
viewsQ: What is a module in PHP?
I’m studying this one documentation and I came across that term : The Return statement returns control of the program to the module that called it. The execution will continue in the expression…
-
2
votes1
answer352
viewsA: problem using regular expression to validate e-mail
I don’t know much about jquery to point out where your code fails and it’s incomplete, your problem is not the regular expression for the email you tested. <head> <script…
-
1
votes2
answers202
viewsA: Displaying certain vectors in a 2D Python list
Good as I was trying to solve also for study, I decided to post post... array = [[10,20,30,40],[50,60,70,80],[5,6,7,8],[100,200,300,400],[9,15,25,30]] result = [i for i in array if sum(i) < 100]…
-
0
votes1
answer113
viewsA: How to do this regular expression in python 3.6
Do so : import re s = "<li><a>href=http://www.ufjf.br/cdara/sisu-2/sisu-2017-1a-edicao/lista-de-espera-sisu-3/?id_curso=01GV&id_grupo=70>ADMINISTRAÇÃO - GOVERNADOR VALADARES -…
-
1
votes1
answer67
viewsA: calculate duration between 2 values within the input
Well the hardest part you’ve ever done (I didn’t check the calculation), so it looks like this: <input id="start" type="time" name="s_time"> : Start<br/> <input id="end" type="time"…
-
2
votes2
answers831
viewsA: How do I check if it’s uppercase, lowercase, or mixed with lowercase?
I don’t understand exactly what you want, but I had the same reasoning as @Matheus Avellar print('-----') print('TESTE') print('-----') print() lista = ['Joao', 'Joaozinho', 'Rafael'] print(lista)…
-
1
votes2
answers244
viewsA: I cannot place the link with the ACTIVE function
To pseudo-class :active is detected the moment the user clicks on the link, but returns its state when it drops. There are solutions with javascript for what you want, however follows an example…
-
20
votes3
answers3434
viewsQ: What does "sanitize" data mean?
I’m making a form, and I’m doing the validation part... I see the term a lot sanitize or sanitizar, what it means? I’ve even seen some functions in the php that carry this term in their parameters.…
-
8
votes4
answers2820
viewsQ: What is the difference between "notice" and "Warning" in PHP?
I always see programmers saying : "Oh if you do this you will receive one notice, but if you do that you get a warning", then I came up with the debt : What’s the difference between them?…
-
0
votes1
answer923
viewsA: How to run a javascript script right after submitting the form? (not onClick)
"How to run a javascript script right after submitting the form?" Event onsubmit. <html> <script> function reg() { window.captureEvents(Event.SUBMIT); window.onsubmit = hit; } function…
-
0
votes3
answers588
viewsA: How do I redirect the user to the address they are visiting after logging in?
Can use header('location:pagina.ext');
-
0
votes2
answers148
viewsQ: How to protect yourself from malicious entry through a select dropdown?
I own a form with a few options of select, example : <select id="sel1" name="sel1"> <option disabled selected style="display: none">Titulo</option> <option…
-
7
votes2
answers278
viewsA: How to know key values in Javascript?
You can do it as follows with pure javascript : document.addEventListener("keydown", function(event) { console.log(event); document.body.innerHTML = "\n<b>keyCode:</b> " + event.keyCode;…
-
3
votes2
answers239
viewsA: Web Scraping how to insert the result into the <img src=
The correct syntax, if in html is : <img src="<?php echo $element->src;?>"/>
-
2
votes2
answers817
viewsA: Alignment Gif Loading
Good a solution would be with Flexbox: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width"> <title>JS…
-
1
votes4
answers1791
viewsA: Display login username on screen
Don’t forget to log in : $validacao = login($dados_usuario['usuario'], $dados_usuario['password']); if(isset($dados_usuario)) { if($validacao) { session_start(); //continue And then you can call it…
-
6
votes4
answers1354
viewsA: XML returned by web service with encoding error
In this case a solution would be, you make a map with the patterns of encoding returned, and replace them, example : <?php $arr = array("Ø" => "é","Ŀ" => "ç","ª" => "ã", "ı" => "õ");…
-
24
votes2
answers665
viewsQ: What is a regular expression?
In many codes I see functions with a set of special characters that seem to have a function of their own. I see it in virtually every language, so what is it after all, a class, a library or what…
-
1
votes1
answer119
viewsA: Disregard words in input
The form that came to mind is using ER(expressão regular) and the method replace(). <form action="" method="post"> URL da thumb: <input type="text" class="restrict" name="url"…
-
1
votes1
answer248
viewsA: I can access site only by ip
If you have done all the procedures correctly. Time_to_live (TTL) Ttls also occur in the Domain Name System (DNS), where they are defined by an authoritative name server for a specific resource…
-
2
votes2
answers188
viewsA: How to remove accent text in php?
Take the double quotes from the variable $remover. echo $texto = str_replace($remover,"",$string);` See worked on IDEONE…
-
0
votes1
answer56
viewsA: Text selection via keyboard
Well I believe that it can vary for each OS. In windows you do the following : CTRL+F and type in the word you’re looking for and to navigate you give a ESC the word will already be ready for the…
-
4
votes1
answer505
viewsQ: What is an "output_buffer"?
Reading is reply, I had this doubt. What is a output_buffer ?
-
1
votes1
answer47
viewsA: File Check on Web Server
Method exists(). Example: import java.io.*; public class FileChecker { public static void main(String args[]) { File f = new File("caminho_para o arquivo"); if(f.exists()) {…
-
0
votes1
answer221
viewsA: image size in kb for upload
Method length() : import java.io.File; public class FileSizeExample { public static void main(String[] args) { File file =new File("sua_imagem.ext"); if(file.exists()) { double bytes =…
-
1
votes3
answers174
viewsA: How do I use the same text in multiple HTML so that I can edit it using CSS?
With pure css, you can do some tricks, but you have to adapt in the layout, example : <h1>Projetos de 2017</h1> <style> h1{visibility: hidden;} h1:before{content:"Projetos…
-
10
votes3
answers8073
viewsA: How is the Global Unique Identifier (GUID) generated?
1 - "I know that the Global Unique Identifier is generated in a way that neither other will be equal." In the very link you put says: "Despite each generated GUID have no guarantee of being unique,…
-
1
votes1
answer83
viewsA: Images overlapping when resolution changes
Your question is not clear, and if the case is not the solution of the comment, ie if you want them to "stay side by side"... Your html and css need to be reworked... But a quick fix(XGH) would use…
-
3
votes2
answers384
viewsA: Is there a standard for structuring an HTML site?
The standard structure for a document html is the following : <!DOCTYPE><!--Document Type Definition--> <html> <head>Meta dados</head> <body>Conteúdo</body>…
-
1
votes1
answer1809
viewsQ: Clear form data if there is "refresh" of the page?
I am performing a simple test and would like to know if there is how to clear the form data if the user gives a refresh in the browser. <?php $test1 = ""; $test2 = "";…
-
3
votes2
answers3258
viewsA: Change background of A when mouse in LI
Do it like this : .menu-item:hover a span{background:white;} .menu-item:hover a span{background:black;} <li class="menu-item"> <a href="http://stanlee.com.br"> <span…
-
1
votes3
answers2684
viewsQ: How to check if the form was sent empty
I’m having a question how to check if the form is empty. My intention is not to check field by field, imagining that I may have N³³³ campos. I’m trying this way: <form method="post" name="submit"…
-
0
votes3
answers1770
viewsA: Increase word size, placeholder attribute value of text inputs?
Good to increase font size staff has already responded. So to make the word take up more space you can use the property letter-spacing and assign the distance between the letters you want.…
-
3
votes2
answers80
viewsA: How to fit all content on the screen? Edge at the bottom of the page does not appear in the viewer or browser
What happens is that the edge that #containerGeral has been added to height and to the width of the element, then the measure will be 100% + a borda. To solve this either you remove the edge or you…
-
1
votes1
answer178
viewsA: How to override a height assigned to a div?
I do it this way: div{ height:700px; width:700px; border:1px solid black; } @media(max-width:480px){ div{ height:250px; width:250px; } } <div>Sua div</div> Then when screen size is less…
-
4
votes5
answers991
viewsA: What is UX (User Experience)?
According to the definition of ISO 9241-210: 2010: Provides requirements and recommendations for human-centered design principles and activities throughout the lifecycle of interactive…
-
4
votes3
answers464
viewsA: Should the checkbox label be on the right or left of the controller?
Edit Who chooses is the client, who designed the layout or the need. And the case of languages where the writing comes from right to left. I believe that there are rules that must be broken, to…
-
5
votes2
answers810
viewsA: What is embedded programming?
Embedded programming is the name given to programs directed to embedded systems, which in turn are those that different from general-purpose systems, are planned for the use of predefined tasks of…
terminologyanswered MagicHat 12,262 -
4
votes3
answers46967
viewsA: What is the difference between col-lg-* , col-Md-* and col-Sm-* in Bootstrap?
These are bootstrap attributes that will set the grid size, relative to the device size, are breakpoints : col-xs-* extrasmall < 768 px col-sm-* small >= 768 px col-md-* medium >= 992 px…
-
2
votes1
answer443
viewsA: Render html from the database using angular 1.6.1
It is necessary to include: <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular-sanitize.js"></script> And then: <div ng-bind-html="teste.ai"…
-
1
votes1
answer1080
viewsA: Open executable by web application
If I understand correctly, you want to open a program that is hosted on a machine in the browser. In the case of the execution on the machine it has a favorable environment for this, already the…
-
0
votes2
answers376
viewsQ: Dynamic Css background URL
To change a property html dynamically by php, I use a code similar to that : <img src="<?php echo $foo;?>"/> You can change the Url of background in css by php example:…
-
3
votes1
answer853
viewsQ: What is DOM Parser?
Reading about regular expression I saw a recurring term, DOM parser, and I had doubts: What is DOM Parser? How it works? Every language has?
-
1
votes2
answers175
viewsA: login system using php and mysql
mysqli_query() expects at least 2 Parameters, 1 Given. Wait 2 parameters, that is, the link and the query. So mysqli_query($con, $query)... Where $con is the connection variable and $query, your…
-
3
votes4
answers6341
viewsA: What is the Assembler?
I found this definition very relevant: Machine code: Is the output compiled by an Assembler compiler. Assembly It is the readable form of the machine code. Assembly Language Refers to a specific…