Posts by MagicHat • 12,262 points
358 posts
-
7
votes2
answers3359
viewsQ: Difference between "~" tilde and "/" bar at linux prompt?
I am starting a lower level part, where I will program the part of users, permissions and etc. My first question is ~ and / at the prompt ?
-
2
votes1
answer274
viewsA: Upload file to a folder inside the root folder with PHP
In function move_uploaded_file you’re moving it to: $uploadfile = basename($_FILES['userfile']['name']); Then the right thing in your case would be: $pasta = $uploaddir."/".$uploadfile;…
-
0
votes2
answers25
viewsQ: Difficulty mounting query for Search in multiple columns
I have 2 tables tab_user user_id | nome_user | tel_user 1 jão 888 2 mari 999 3 jão 777 4 mari 666 tab_product id_produto | user_id| carac_a | carac_b | carac_c | carac_d 1 1 aaa bbb ccc eee 2 1 mmm…
-
3
votes2
answers127
viewsA: Pick specific characters from a string?
Can use regex... alert("<[email protected]>".match(/\<([^)]+)\>/)[1]); I’m going to post because it started @Sergio is very fast…
-
0
votes3
answers655
viewsA: Lateral alignment of Divs
There are several ways to do that, but in your case, I believe that: img{float:left;} resolve...
-
0
votes1
answer47
viewsA: Pass value by link
Kind of : <li><a href="../download/index.phtml?pasta=id_7" id="icons"><?php echo $this->translate('Download');?></a></li> To get the value: $peguei = $_GET['pasta'];…
-
1
votes3
answers267
viewsA: Input email display only suggestions for EMAILS
To validate is a little different, so: <form action=""> <input type="email" name="email" pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$"/> <input type="submit"/> </form>…
-
0
votes2
answers1188
viewsA: Manipulating XML with Javascript
Kind of: var childs = document.getElementsByTagName("child"); for (var i = 0; i < childs.length; i++) { console.log(childs[i].id); } <child id='child1'/> <child id='child2'/>…
-
2
votes3
answers868
viewsA: Catch string inside <a> tag without attributes
Can use strip_tags: <?php $text = '<a href="link"> <font style="font-size: 14px;" color="black" face="arial"><b>String que eu quero pegar</b></font> </a> ';…
-
1
votes1
answer32
viewsA: Prevent Google indexing in specific folder
To the Google, can use: <meta name="googlebot" content="noindex"> Source For the whole folder as mentioned in these answers: robots txt. User-agent: * Disallow: /chat You can test your file…
-
8
votes4
answers7265
viewsA: How to get customer operating system information?
There are some methods, but no 100% guaranteed, as mentioned in Anderson’s answer. The data relating to USER_AGENT shall be obtained through the environment variable HTTP_USER_AGENT: <?php echo…
-
1
votes1
answer741
viewsQ: What is tracking pixel?
I had recently spoken with a friend about tracking pixel, but I don’t understand exactly what it is and how it works. Today I came across the question, what is Beacon, and researching falls into the…
-
5
votes2
answers52
views -
10
votes3
answers4035
viewsA: Like writing a pseudocode?
Pseudo : "Prefix used in word formation to express falsehood or similarity". A pseudocode mimics real code, but it is not. It is a representation of an algorithm, which in turn : "... is a finite…
pseudocodeanswered MagicHat 12,262 -
1
votes2
answers2006
views -
3
votes2
answers73
viewsA: Non-functional PHP Mysql database
It happens when you omit the value of action processing takes place on the same page. In your case the problem is the attributes name of the fields. When you use $nome = $_POST['nome']; that value…
-
25
votes2
answers35740
viewsA: What is TCP and UDP? What is the difference between the two protocols?
TCP and UDP are protocols part of a conceptual model (OSI model) that standardizes communication functions in computing divided into 7 layers. TCP and UDP are in the transport layer that is…
-
4
votes1
answer346
viewsQ: preventDefault does not work
The next form: <form id="form_id" method="POST" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" autocomplete="off" onsubmit="valida_form()"> I have a function that checks…
javascriptasked MagicHat 12,262 -
1
votes1
answer23
viewsQ: Difficulty in passing parameters and arguments in callback
I have 2 functions, where I wish, to satisfy a condition in the main function I must call an external function, using in this external function the current parameter in the first function. //1…
javascriptasked MagicHat 12,262 -
8
votes3
answers124
viewsQ: Callback running when loading the page
I’m taking some tests to learn more about callback in javascript and found the following difficulty: function nome_existe(element) { console.log(element.id); } window.onload = function() {…
javascriptasked MagicHat 12,262 -
4
votes4
answers4728
viewsA: How to write values to the Mysql database using PHP?
You need a connection to the database: php connection. <?php $servidor = 'localhost';//Teu servidor $usuario = 'root';//Teu usuário do Mysql $senha = '';//Tua senha se houver $banco =…
-
2
votes2
answers346
viewsQ: Assign function to variable?
What is the correct way to perform the following assignment: preg-replace.php <?php function file_name(){ $pg = $_SERVER["PHP_SELF"]; echo $path_parts = pathinfo($pg,…
-
0
votes2
answers5037
viewsA: Decimal to hexadecimal conversion
You can do it like this : hex = [0,1,2,3,4,5,6,7,8,9,"A","B","C","D","E","F"] n = int(input("Digite um núemro inteiro: ")) r = [] while n > 0: r.append(hex[(n % 16)]) n = n // 16 for i in…
-
1
votes3
answers321
viewsA: How to make a stylized edge?
Use the attribute border-image. <p id="borderimg">Utilize o atributo <strong>border-image</strong></p> <style> #borderimg { width:300px; border: 30px solid transparent;…
-
1
votes2
answers703
viewsA: How to make a welcome screen in PHP?
In this case your index page should be: <?php session_start(); echo "bem vindo: ".$_SESSION['username']; ?> Note that in the login file, in this excerpt: $_SESSION['username'] =…
-
8
votes3
answers1348
viewsA: Should systems force the user to create a strong password?
In my opinion, nay, I will explain why: Overall, there are 2 main targets, the "Usuário" and the "Sistema". However, most attacks targeted at a "Usuário" has as real objective to obtain information…
-
5
votes3
answers1847
viewsA: Jquery: calculate the number of banknotes of the cashout value (deliver as few as possible)
I decided to post a solution, which in my view is closer to what is being asked: First you need to understand what recursion is, it’s outside the scope of this answer, but you can get more…
-
0
votes3
answers33
viewsA: Print at the top of the page
Well from what I understand it would be something like this, put it anywhere: <?php resultado(0);?></br> <NAV BAR / CABEÇALHO> <?php resultado(2);?></br> <?php…
-
2
votes2
answers3037
viewsA: CSS Input Zip code
You can use the attribute pattern along with the required: <form> <label for="CEP">CEP: <input name="CEP" id="CEP" required pattern="\d{5}-\d{3}"/> </label> <input…
-
1
votes2
answers74
viewsA: How to modify link in PHP code
You can do this in many ways: <a href="http://www.google.com"><div class="menu-item" ui-sref="albums" ui-sref-active="active"><i class="icon icon-cd"></i>…
-
12
votes2
answers4241
viewsA: What is a rubber duck and what is it for?
It’s a code debugging method, where explaining how the code works to a third party any incongruity between what the code should do and what it actually does would be more apparent. The term refers…
terminologyanswered MagicHat 12,262 -
0
votes2
answers21
viewsA: How to preg_mach_all in different lines?
Using preg_match_all: <?php $dado = " <div class='information di-ib mt4'> Movie (1 eps)<br> Aug 2016 - Aug 2016<br> 380,496 members </div>";…
-
0
votes3
answers374
viewsA: Store CSS in string
Maybe that’s what: <!DOCTYPE html> <html> <head> <style> body { background-color: blue; color: red; } p { background-color: green; color: red; } </style> </head>…
-
0
votes2
answers172
views -
2
votes2
answers830
viewsA: How to subdivide HTML
As stated in the comments you can use the tag iframe. iframe.html <iframe src="menu_frame.html" style="border:none;"></iframe> menu_frame.html <a href="#">Menu</a> You can…
-
0
votes2
answers1336
viewsA: Differences between a transpilator and a compiler
Roughly the transpiler is a type of compiler that translates a code written in a medium/high level language to a code from another medium/high level language. The compiler translates from…
-
2
votes1
answer41
viewsA: Regex in Javascript and C# for text validation
I do not know if I understood very well, see if this example helps. <input type="text" id="input_teste" name="input_teste"/> <input type="submit" value="Testar"…
-
0
votes3
answers109
viewsA: Form details
To receive the data in the form, the basic is like this: Tag form you have 2 relevant attributes in this scenario. o method and the action. By default in the absence of action it will return the…
-
5
votes2
answers1598
viewsA: Test access method, whether it is GET or POST
The test would be something like: if($_SERVER["REQUEST_METHOD"] == "POST") { //faça algo...
-
0
votes1
answer5051
viewsQ: How do I fix the php ERR_CACHE_MISS?
Whenever I click to return in the browser navigation appears the message to confirm the form resend and the error: ERR_CACHE_MISS. How do I click to return to the previous page and do not ask for…
-
2
votes1
answer659
viewsA: Php - Pick variable by _GET or _POST? How to make name appears instead of Cpf
In this line: <h4> <?php echo "Olá ".$_SESSION['cpf'];?></h4> You are saying that the output must be the data contained in the Cpf session variable, can change to the name:…
-
1
votes1
answer840
viewsA: HTML - I can’t align a textarea, all other items are aligned
Add to your css the rule for id="tOutro" #tOutro{margin: 0 auto;} And you have a syntax error in the following line: <th width="33%"><a href="Empresas.html">Empresas…
-
3
votes2
answers192
viewsA: Why do you need to close the script tag?
What defines the document syntax requirements is called "DTD - Document Type Definition " In his specification(18.2.1 The SCRIPT element) contains that definition clearly : Start tag: required, End…
-
0
votes3
answers88
viewsQ: What is the correct way to call function within another nested function?
For example: function principal() { function one_level_1(){...} one_level_1(); function two_level_1(){...} two_level_1(); function three_level_1() { function one_level_2(){...} one_level_2(); }…
javascriptasked MagicHat 12,262 -
1
votes5
answers2915
viewsA: What is actually the array?
But after all, what is an Array? Is it a sequentially indexed list? Or is it a manually indexed item container (like in PHP)? Array has its origin in algebra as matrix: Matrix : "Arrangement of m.n…
-
3
votes3
answers3528
viewsA: How to take the space between two inline-block Divs?
You can solve this with a gambit: #tudo{ font-size: 0;<<-------- esta text-align: center; margin: 0 auto; } #tudo { font-size:0; text-align: center; margin: 0 auto; } .desktop { display:…
-
0
votes0
answers43
viewsQ: Difficulty with mysqli_fetch_object
I’m performing the function as follows: Through a query: <?php [...] $sql = "SELECT f_u.*, f_i.*, f_g.* FROM form_user AS f_u LEFT JOIN form_imovel AS f_i ON f_i.imovel_id = $imovel_id LEFT JOIN…
-
1
votes2
answers220
viewsA: Regex: Open and close with the same character and allow more than one type
See if this is it : /\(asdasd\)|{asdasd}/g Explanation in English
-
3
votes3
answers6724
viewsA: How to use Ellipsis css3?
Following the example you mentioned, we were missing 2 rules : .box { width: 250px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; border: 1px solid #000000; }…
-
11
votes2
answers2648
viewsQ: What is a shebang?
Since in many languages the character # represents a committal, what is the sense of using it? He has some special sense?