Posts by mau humor • 1,991 points
89 posts
-
1
votes1
answer211
viewsA: Table filled incorrectly HTML and Java script
You are using the component (jQuery Datatables) to "manage" the table data. However, lines are included manually. This data, including after Datatable startup, is not recognized by it. Maybe you…
-
2
votes3
answers3583
viewsA: Get input sum value with Jquery
You didn’t post code or give details about your specific problem (avoid that). However, according to the description it is possible to present a solution on which you can rely.…
-
0
votes4
answers2314
viewsA: How do I insert the value of a variable into an HTML attribute using pure Javascript
qs is not in the scope of the function and you are using it anyway. The correct thing is you pass the object qs per parameter. As follows: function urlId(qs) {…
-
1
votes1
answer182
viewsA: How do I redirect and send url get value to another page using Javascript?
The function does not return an array. Alias, you are referencing a key, as if it were an associative array. This does not exist in Javascript. Return is an object JSON and should be accessed this…
-
-1
votes3
answers8546
viewsA: how to convert pixel to percentage? css
Impossible. Pixel is related to image quality and % is related to the area of the screen that the object will occupy, regardless of size. Are different things. To convert Pixels to %, you need to…
-
2
votes4
answers1358
viewsA: How to return the date and time closest to that informed by the user
You can sort the dates, filter the dates before the date given and limit the result to a record. Since you didn’t pass real information, such as table name and fields, I can’t write the exact SQL.…
-
2
votes1
answer478
viewsA: Exercise: Turn decimal to binary and find 1’s
Here is a simplified and properly commented solution to determine the number of bits of an integer. As it is an exercise and not a practical problem. I recommend that you study the code and…
-
3
votes1
answer33
viewsA: How to make a background with a set of images?
Just insert other images and set individual positioning. See the example: .teste{ min-width:250px; min-height:250px; background:#ff0000;…
-
0
votes1
answer54
viewsA: PHP Mysql Search result
I’m not in a position to test your code, but I believe the problem lies in the way you’re merging the tables. When using the JOIN in related tables by foreign key. It is necessary to specify a…
-
2
votes1
answer149
viewsA: Sending form only with HTML and/or JS
After redirecting, the contents of the old page are deleted. You can no longer access any element via Javascript. That’s why your code doesn’t work. Values sent through forms using the POST, GET...…
-
1
votes2
answers1021
viewsA: Problem with Json_encode
Because in the first case you are providing a string as parameter. And then PHP understands that you want to encode a simple string in JSON format. And that’s what it displays. The content of the…
-
0
votes3
answers522
viewsA: Regular expression, PHP
Assuming that the expected behavior for an invalid parameter is 404. I recommend forgetting regular expression and doing so: $page = (int)$_GET['page']; if ($page==0) { header("HTTP/1.0 404 Not…
-
0
votes5
answers1205
views -
2
votes2
answers1567
viewsA: How to handle string to avoid SQL Injection?
You can use the mysql_real_escape_string (Documentation) This function will not make you lose unwanted characters, like the way you are farming. They will be encoded so that MYSQL understands them…
-
1
votes5
answers2467
viewsA: What is a deprecated code?
It is some feature that is still present in a language/framework, but that will be removed in the next version. So, in this case it is up to the programmer to use with caution, knowing that doing so…
-
5
votes4
answers366
viewsA: What’s the difference in using sprintf in relation to using variables within the string?
The sprintf in PHP has basically the same function as in C, which is to allow the value formatting resources available in printf can be applied to a string, instead of playing in the terminal. I…
-
1
votes3
answers326
viewsA: Script to change player (old Jquery game)
I have made some (many) changes. I have implemented the check if the button is pressed again, do not change the set value. Test there and check the code to see if you understand. var vez = false;…
-
3
votes1
answer267
views -
0
votes2
answers315
viewsA: Navigating between Javascript Urls (changing url value)
This should take care of. var urlAnterior = document.referrer; //remove o .html urlAnterior = urlAnterior.replace('.html',''); var complementoURL = "abcd"; function comando(){ window.location.href =…
-
1
votes1
answer215
viewsA: Error while creating mysql function
Lacked a CREATE before FUNCTION ... CREATE FUNCTION DISTANCIA ( lat1 DOUBLE, long1 DOUBLE, lat2 DOUBLE, long2 DOUBLE ) RETURNS DOUBLE ...…
-
2
votes1
answer26
viewsA: Why are you error in the Protect variable by saving manually?
That would not be right? ... public function gravaOrdem(Request $request) { ... Or else when referencing $request, does so $this->request. Thus: public function gravaOrdem() { $codigomaior =…
-
4
votes2
answers1526
viewsA: PHP - List files in a directory
You can use scandir: documentation here Here is a simple example of the documentation: <?php $dir = '/tmp'; $files1 = scandir($dir); $files2 = scandir($dir, 1); print_r($files1);…
-
0
votes1
answer99
viewsA: C++ Doubt-Basic Solution Northwest Corner
You are incorrectly referencing matrix indexes in some parts of the code. matriz[x,j] for example. The correct is matriz[x][j] Another thing. There is no while (condição) do {}. The correct is while…
-
2
votes2
answers1159
viewsA: API mercadolivre does not return JSON
This URL: https://api.mercadolibre.com/sites/MLB/categories Forwards to API documentation, not to JSON code. However, according to this same documentation. The URL is correct. I ran a test using…
-
1
votes1
answer1204
viewsA: Soft anchor inside a DIV
An example of smooth scrolling with jQuery. From what I can understand, this is what you need. It will be necessary to adapt this example in your code, since you have not provided it.…
-
0
votes1
answer66
viewsA: Searching IP or URL of a website using Geolocation
It seems that you are not providing the IP/Name you want to get the location: ... $.ajax({ type: 'GET', url: 'http://ip-api.com/json/', ... I imagine it should be that way: var host =…
-
3
votes1
answer118
viewsA: How can you find a word in the text of a table?
I made the necessary repairs used the millennial tenência of DEBUG. Super recommend. The repairs were more than one, so I commented on the code. window.onload = function(){ /*Aqui você pegou apenas…
-
0
votes1
answer50
viewsA: How to remove %3F among others from the result?
You can use the function: decodeURIComponen. Follow a simple example: var texto = "%3F%3F%3F"; alert(decodeURIComponent(texto));…
javascriptanswered mau humor 1,991 -
6
votes2
answers626
viewsA: How to hide an element after a certain time?
A simple example with pure Javascript, since you didn’t add the Jquery tag. Add up after 3000 milestones. You can change this value if you want. setTimeout(function(){ var a =…
-
0
votes2
answers423
viewsA: Take an input value by name
If it is a single input, this should solve: $conteudo = '<input value="João Lima" name="texto" id="texto"/>'; $array = []; preg_match('/value="([^"]+)"/e',$conteudo,$array); var_dump($array);…
-
5
votes3
answers4250
viewsA: What is the purpose of the "header()" function?
The Header of an HTTP request/response is a key/value list. 1 - Basically this function allows you to add values, or update values that already exist in the default response header (defined by the…
-
0
votes3
answers68
viewsA: Resize image with php
Your code doesn’t make much sense, but to solve your problem, I recommend changing $up = imageJPEG($img_destino,'teste/'. rand() . '.jpg', 85); For $up = $linha['foto']; For the function imageJPEG…
-
0
votes3
answers6852
viewsA: language c is giving me a small error and I can not correct
Cannot assign a string to a char array in C. try to change that: ... cat[i].nome = nome_da_categoria; ... That’s why: sprintf(cat[i].nome, "%s", nome_da_categoria); I also noticed that you are…
-
0
votes1
answer33
viewsA: save text to file
Try it this way: try(BufferedWriter bw = Files.newBufferedWriter(caminho, formato)){ bw.write("frase teste"); bw.newLine(); bw.write("outra coisa"); }catch(IOException e) { e.printStackTrace(); }…
-
4
votes4
answers8807
viewsA: How to convert a date variable to the Brazilian format within a view?
That should work: <td>{{ date( 'd/m/Y' , strtotime($ordemjoin->dataplanejamento))}}</td>
-
2
votes1
answer56
views -
1
votes1
answer413
viewsA: How to quickly put restitution on my website
You can use boostrap’s "img-Responsive" class(Documentation) in the image element of your banner. Ex: <img src="teste.jpg" class="img-responsive" /> But it is important to remember that this…
-
4
votes1
answer62
viewsA: Working with php string
Yeah, that should do it: $fileName = "remessa.txt"; //colocar aqui o nome do arquivo header("Content-Type: application/force-download"); header("Content-Type: application/octet-stream;");…
-
4
votes1
answer1791
viewsA: Decode Base64 mysql
According to the documentation, there is the FROM_BASE64 function() Example(in the documentation): mysql> SELECT TO_BASE64('abc'), FROM_BASE64(TO_BASE64('abc')); -> 'JWJj', 'abc' I didn’t know…
-
1
votes1
answer1634
viewsA: Overwrite Bootstrap classes with CSS file
You have to check the order the CSS is running. However, if you do it this way: background-color: #a6d209 !important; Your CSS will prevail.
-
3
votes1
answer158
viewsA: How could you hide too many pagination numbers
I’ve made the appropriate adaptations to your logic, but it’s possible to implement all of this in a better way. If you want the paging to be changed as selected option, you must recreate it…
javascriptanswered mau humor 1,991 -
1
votes1
answer1475
viewsA: How do I pass an array of data to a readable view?
Thus return view('portal.equipamento.index', compact('equipams')); Or so: return view('portal.equipamento.index', ['equipams'=>$equipams]); No view can reference like this $equipams. I recommend…
-
1
votes2
answers56
viewsA: How to check input text before post?
If you are not going to use any more complex validation, you can use required HTML5 Here no Javascript required. This way: <input type="text" name="lastname" required> <input type="submit"…
-
2
votes1
answer1232
viewsA: How to break lines in the output of an Array?
A solution would be to treat at the time of printing the value. + - So: <?php $lista_lojas = array( "LOJA01 - Bkp 01" => "servers/01/bk001/Mpcfg.ini", "LOJA01 - Bkp 02" =>…
-
1
votes2
answers1050
viewsA: Command to leave running Laravel 5.1
According to Laravel’s documentation: Typically, you may use a web server such as Apache or Nginx to serve your Laravel Applications. If you are on PHP 5.4+ and would like to use PHP’s built-in…
-
13
votes1
answer1465
viewsA: What is "Extract" in PHP?
Takes an associative array and declares variables, having as their name the keys, and the contents of the variable, the value of the array referring to the key. Follow an example: $teste =…
-
1
votes2
answers293
viewsA: Else doesn’t work
You say that if CAPTCHA is not completed the message should not be sent. There is an external if that prevents an upload attempt if the field is not filled in. However, there is no else for this IF,…
-
2
votes2
answers358
viewsA: On click event repeating action
You must "schedule" the event in a block of code that will only run once. Apparently you are doing this within another event that is shot several times. In this case, the event is not overwritten…
-
1
votes1
answer685
viewsA: Better center by margin:auto or text-align:center?
According to the W3C The CSS margin properties are used to generate space Around Elements. Follow the link That is, the function of the "margin" property is to define space around the elements. The…
-
2
votes1
answer588
viewsA: Clear form field, if autocomplete is null
You can reset the field within the if that checks if the response to the ajax request has no content. Included the following line: idCod.val(''); I’m guessing that idCod is global, since it was used…