Posts by MagicHat • 12,262 points
358 posts
-
1
votes1
answer55
viewsA: File is being sent out of the defined folder with the move_uploaded_file method
Use the $_SERVER['DOCUMENT_ROOT'] to return the root directory under which the current script is executed. move_uploaded_file($tmp_name, $_SERVER['DOCUMENT_ROOT'] . "./public/$nome_pasta/$name" );…
-
8
votes2
answers1956
viewsQ: What is Backus-Naur Form (BNF)?
I was reading an answer here and I came across this term, so what does this term mean, and what is the relationship/influence on current languages?
-
2
votes2
answers1241
viewsA: Store multiple select in a single column with PHP/javascript + Mysql
Good for storing multiple options of one select it must have the following structure: <select name="pedido_bebida[]" id="pedido_bebida"class="selecionar" multiple> That is to add the attribute…
-
3
votes2
answers461
viewsA: Timezone does not work PHP
In my view it is a syntax error : Substitute ini.get('date.timezone') for ini_get('date.timezone'); Example : <?php echo 'date.timezone: ' . ini_get('date.timezone'); ?>…
-
1
votes3
answers710
viewsA: How to join two array variables into one in php?
To unite 2 arrays in 1 you can use the function array_merge, example : <?php $array1 = array("cor" => "vermelho", 2, 4); $array2 = array("a", "b", "cor" => "verde", "forma" =>…
-
4
votes2
answers413
viewsA: What is the difference between "memory_get_usage" and "memory_get_peak_usage"?
memory_get_usage: Returns the amount of memory allocated to PHP. memory_get_peak_usage: Returns the memory peak allocated by PHP. And the directive : memory_limit: Directive of php.ini that sets the…
-
2
votes3
answers313
viewsA: Dynamically generated ajax tags are not viewed by jquery
Change that passage : $('.id_aluno').click(function () { $('#campo_aluno').val(this.text); }); for that: $('.modal-trigger.id_aluno').click(function () { $('#campo_aluno').val(this.text); });…
-
2
votes2
answers1785
viewsA: Open second modal only after closing the first
Next you can use the event function itself bootstrap: $('#myModal').on('hidden.bs.modal', function (e) { // abre o outro modal aqui... }) I pulled from here has other info if you need source…
-
1
votes7
answers874
viewsA: Extract Array content for PHP variables
You can use the function Extract(): Kind of: <?php $foo = array( "InvoiceIdOut" => 879, "FiscalDocumentNumber" => "AAAA879", "InvoiceURL" => "http://teste.pt/maistestes/AAAA879",…
-
18
votes1
answer540
viewsQ: What are HTML entities?
I often see some pretty crazy codes in the middle of tags HTML, and searching falls under that term entities, then the doubts arose: What are Entities HTML and when should I use them?…
-
14
votes6
answers29816
viewsQ: How to create space before or at the end of the text contained between html tags?
I need to put a space before a text that is found between tags html, what is the right way to do ? No css... div{float:left;} <div>Texto 1</div><div> texto que quero um espaço…
-
3
votes1
answer71
viewsQ: When should I include ".. /" in the path to a include or image?
I have this doubt because time is necessary only the way pasta/arquivo.ext and time I have to put ../pasta/arquivo.ext. Is there any rule?
-
18
votes4
answers31300
viewsQ: How to disable resize from textarea?
How do I disable resize of a textarea ? <textarea></textarea> I wish I couldn’t change the size of the box...…
-
3
votes4
answers517
viewsA: Why Artificial Intelligence and Machine Learning are different subjects?
"So why is it a totally different course?" This question is independent of how the machine actually works. "It would have to do because they are very complex subjects or make more or less use of…
-
11
votes2
answers12106
viewsA: Remove arrows in type number field
based on this :question, you can use the property -Moz-Appearance, which is used to display an element using the native platform style based on the operating system theme.…
-
3
votes1
answer67
viewsA: How to apply Pathfinding in a structure of nodes?
There are several algorithms for this purpose, among them (all in English): Dijkstra’s Here’s an example of pseudo-code taken from the link: function Dijkstra(Graph, source): create vertex set Q for…
-
0
votes3
answers2856
viewsA: What can cause file_get_contents to give "timeout" error?
Start by trying to include www. You can try too :ini_set('default_socket_timeout', 900);(or by the Zooboomafoo response script) Increase the time limit that by default is 60 segundos. Make sure your…
-
6
votes2
answers3168
viewsQ: How does the history Javascript object work?
I wonder if there is a limit of Urls to be recovered or not, he has access to the entire history ?
javascriptasked MagicHat 12,262 -
1
votes1
answer178
viewsQ: How to enable the right-click (with the new tab option) on an input or button
I have a input I would like the option to appear when right-clicking abrir link em uma nova guia. How can I do it, is possible only with css and html, taking into consideration that this same button…
-
0
votes2
answers21
viewsA: Last elements of a class running incorrectly
What I could understand is that the divwho is wrong belongs to the same block of his div previous... This is a problem you will have to solve in your layout. A quick solution would be to open a new…
-
1
votes2
answers106
viewsA: Attribute href exclusively for goal <a></a>?
I believe it is incorrect: According to W3C : 4.4.7 The li element Content The following: Global Attributes Content attributes:Global attributes and href, is not a global attribute.…
-
4
votes3
answers218
viewsA: Is it possible to load alternative . css links in case the primary link is not working?
Yes, just declare them within the tag head. An example would be: <head> <link href='http://host-1.com/style.css' rel='stylesheet' type='text/css'/> <link…
-
2
votes1
answer48
viewsA: Why isn’t this Function working?
Instead of putting your function in the action put in the specific attribute for the javascript event. I made this example imagining that the data that will be called are correct in the other…
-
2
votes1
answer355
viewsA: Interpret XML file tags with PHP
You can use Xpath for that : <?php $dom = new DOMDocument(); $xml = "data_export.xml"; $dom->load($xml); $xpath = new DOMXPath($dom); $items = $xpath->query('/root/id_couponoffer'); for($i…
-
13
votes3
answers890
viewsA: Is it wrong to use more than one <thead>, <tbody> or <tfoot> in a table?
According to the DTD: <!ELEMENT table (caption?, (col*|colgroup*), thead?, tfoot?, (tbody+|tr+))> <!ELEMENT caption %Inline;> <!ELEMENT thead (tr)+> <!ELEMENT tfoot (tr)+>…
-
6
votes1
answer476
viewsQ: Scope, nested functions, called functions
I’m studying that answer and I came across a doubt in a test that I am performing, follows : <script> function x(a1="a1"){ // "x" tem acesso a "a" var a2="a2"; console.log("Consele fx =" +…
javascriptasked MagicHat 12,262 -
2
votes2
answers759
viewsQ: Understanding parameters and arguments in functions
I am learning programming and I know that there are some answers on this topic, that have made me (theoretically) understand who is the parameter and who is the argument, however still do not…
-
3
votes2
answers283
viewsQ: Change variable values in a function through another function?
How to pass parameters from one function to another ? Follows the code: <body onload="getfoucs()"> <select id="select_compra" data-limit="3"> <option disabled selected style="display:…
javascriptasked MagicHat 12,262 -
1
votes2
answers78
viewsA: alignment of div and summarize text
Kind of: .container { left: 0; right: 0; margin: 10px auto 10px auto; width: 95%; border-radius: 4px; background: #FFFFFF; } .container table { width: 100%; margin: 0 auto; } .container .linha {…
-
2
votes2
answers407
viewsA: How to give a blank space between 2 input-group?
Can use the br/, as an alternative. <br/><br/> <div class="input-group" style="width:1px">
-
0
votes2
answers1391
viewsA: How to format a very large string (organize the text)
You can use this solution with Regex, however, depending on the patterns that appear in your text, you will have to add new rules. <script> var obj = { text: 'Contrary to popular belief, Lorem…
-
2
votes2
answers527
viewsA: Strategy of how to save images (with preview) in CRUD of products
The ideal is that you put your code to facilitate the life of those who want to help you. <legend class="leg_img">Insira imagens</legend> <fieldset id="upload_img" class="nf_class…
-
5
votes2
answers1198
viewsA: Dynamic tables with Jquery, Javascript and Mysql
Well, you need a loop to make that insertion, try it like this: for($i=0; $i < count($_POST['nome']); $i++) { $nome = mysql_real_escape_string($_POST['nome'][$i]); $cpf =…
-
2
votes2
answers14245
viewsA: CSS Hide Elements using css only
One of the solutions would be the following : Using media queries and display:none together display:block. There are several paths using css selectors, there goes creativity. <div class="ui…
-
1
votes1
answer134
viewsA: Action Form HTML
Following this definition of attribute action : free translation : This attribute specifies a form processing agent. User agent behavior for a value other than an HTTP URI is undefined. In my…
-
1
votes2
answers675
viewsA: Accordion menu with CSS opening more submenus inside a submenu
The solution I found is as follows: : <ol class="menu-sanfona"> <li> <label for="Item-1">Item-1</label> <input type="checkbox" id="Item-1" /> <ol> <li>…
-
0
votes1
answer33
viewsA: Select radiobuttons of different values
I don’t know how to do it with just html, so I used javascript. It’s not very optimized, but I already have an idea... <body> <br>COR DA LETRA<br><br> <input id="black"…
-
14
votes3
answers1496
viewsQ: What is DTD (Document Type Definition)?
How this technology works and how it relates to other technologies currently used, such as DOM, Xpath and Xquery? I’m not looking for something totally thorough, an overview, the way to create a…
-
0
votes2
answers330
viewsA: by placing plot value in dynamically created input
I made an edit, I don’t know if it’s what you’re looking for. The code is commented, any doubt comments that we adjust. function start() { var input_total = document.getElementById("input_total"),…
-
0
votes3
answers191
viewsA: How to display the date in the input after the query
You can recover the data as follows, as already mentioned in the previous answers, through the global variable $_POST. Regarding the error referred to in the comments in the previous reply :…
-
0
votes1
answer215
viewsA: Stretch an element div over the entire length of the table
Use the element caption to involve the div. Following @Guilhermenascimento’s suggestion, you can do so : <table> <caption style="background-color:#003686; height:77px;color:white;…
-
2
votes2
answers726
viewsA: Domxpath query with multiple classes
Follow the solution I arrived at: <?php $html = <<<HTML <div class="lstImv blackBd12"> <div class="stCl3 stLeft imvImg"> <div class="imgBox"> <a…
-
3
votes2
answers726
viewsQ: Domxpath query with multiple classes
I’m performing a parse on a file html with the following structure : <div class="lstImv blackBd12"> <div class="stCl3 stLeft imvImg"> <div class="imgBox"> <a…
-
4
votes1
answer152
viewsQ: "Output" with special characters
I am using the GCC compiler version 5.3 for the following program, written in Aptana: #include <stdio.h> void main(void) { int positivo = 32767; int negativo = -32768; printf("%d +1 é %d\n",…
-
5
votes1
answer79
viewsQ: Type modifier: Type modifier
The type modifier register I have instructed the compiler to store the variable directly in the registers, however I do not see much its use in codes, this put, I have the following doubts: In what…
-
1
votes3
answers2005
viewsA: Picking up content within multiple Ivs
I’m not sure it’s right to use a list item without a list. In pure Javascript looks like this: <body onload="getbyclass()"> <ul class='conteudo'> <li>Conteúdo 1</li>…
-
7
votes1
answer77
viewsQ: In the Web context what is a proxy?
How to work with this technology and what its use on the day of a web application is in the case of client or server ? Use cases can be in any language, just for understanding its functioning.…
-
3
votes3
answers568
viewsA: Scroll bar in a SELECT in html
The input I don’t know, but you can use the textarea: textarea { height:30px; overflow-y:hidden; overflow-x: auto; white-space: nowrap; resize: none; border-radius:5px; }…
-
2
votes1
answer24
viewsQ: Get content through the php class
How to parse to get content from the php class ? <p class="p2 p2-resultado-busca"><span>Conteúdo desejado 1</span><strong>Conteúdo Indesejado</strong></p> <p…
-
4
votes2
answers996
viewsQ: Display the contents of Object Nodelist
How to display received content through a objectNodeList ? Through the following function I try to get the content of tags by the class. function final(){ var titulos =…
javascriptasked MagicHat 12,262