Posts by Zuul • 35,190 points
501 posts
-
1
votes4
answers1160
viewsA: load datepicker plugin on page called with ajax
I would change the file dateconfig.js to deal with the datepicker in a more pragmatic way: Solution // Opções para o Datepicker var options = { dateFormat: 'dd/mm/yy', dayNames:…
-
6
votes1
answer180
viewsQ: Select database record for variable
The code below aims to select a database record and save it in a variable for later use of the data: #!/bin/bash dbName='basedados' dbUser='utilizador' dbPass='password' row=$(echo "select file_id,…
-
0
votes1
answer188
viewsA: Close modal in the REMODAL plugin
You don’t indicate how you’re instantiating remodal, but you can deal with your problem as follows: // instanciar remodal var inst = $.remodal.lookup[$('[data-remodal-id=modal]').data('remodal')];…
-
2
votes2
answers6962
viewsA: PHP How to pass attribute values between classes
You can pass the usuario_id for your class ComentarioDAO either by parameter in the constructor (if any), or as a parameter of the function using it: Examples class ComentarioDAO { /* @var integer…
-
2
votes2
answers194
viewsA: Retrieve jQuery instance within an iframe
Not forgetting the potential problems caused by politics of the same origin, a possible solution for what you seek: Example in Jsfiddle. HTML <iframe id="bubu" width="300"…
-
2
votes2
answers742
viewsA: PHP search system without Mysql
Essentially, what you want is to use PHP to locate a string within files. Two options, each one more suitable for the PHP version you’re using: PHP > 5.0 Making use of class Directoryiterator, we…
-
3
votes3
answers3788
viewsA: How to copy a file with PHP?
To copy in PHP, as mentioned above, you can use the function copy() which allows you to copy a file to another location or to another file because the input name does not have to be the same as the…
-
13
votes1
answer1339
viewsA: A Product in Multiple Categories - PHP
You do not indicate the structure of your tables, but for this purpose you should make use of an intermediate table that will effectively serve the purpose of relating each product to multiple…
-
5
votes2
answers42594
viewsA: How to open and close modals with jQuery
Your problem is you’re using the method .delay() incorrectly. The same only affects the Queue of animations and not other methods, functions, events, etc. that are not in the Queue. Solution…
-
4
votes1
answer6072
viewsA: Prevent scrolling of the screen when opening modal
One solution is to place the overflow of the page to hidden when the modal is opened, and revert when it is closed. When opening $("button").click(function(){ $("#modal").show();…
-
6
votes2
answers104
viewsA: Error executing cascade class methods
So you can create "method chaining", your methods need to resume $this, that is to say: class Customer { function setVat() { echo "bubu!"; return $this; } function setName() { echo "Bubu2!"; return…
-
6
votes4
answers10317
viewsA: How to delete files inside a folder
PHP 5 or higher To eliminate everything within a certain board: $dir = "caminho/para/diretoria"; $di = new RecursiveDirectoryIterator($dir, FilesystemIterator::SKIP_DOTS); $ri = new…
-
1
votes2
answers392
viewsA: Reduce image and center
One solution would be to use the statement transform in the image: div{ position: relative; overflow:hidden; width:470px; height:160px; } img{ position: relative; top: 50%; transform:…
-
2
votes1
answer536
viewsA: Why does form serialize return empty textarea value?
The problem is that with the tinymce, to textarea no longer exists and editing the text takes place in a iframe. The .serialize() will locate elements, but the textarea is not in use, so will an…
-
4
votes1
answer229
viewsA: Open a <span> when the image loaded by Jquery is loaded
Preserving the plugin structure Touchtouch, whose demo you can also see here, you can solve your problem as follows: HTML In the elements that make up the slider, we will add a new attribute with…
-
2
votes4
answers191
viewsA: Doubt with CSS selector
You can use the selector :nth-child to remove the margin to each X elements depending on your need: /* A cada 2 elementos, retira a margem */ .linhasFotos:nth-child(2n+2){ margin-right:0; } You can…
-
4
votes2
answers10715
viewsA: Simplest way to generate a PDF of an HTML, client-side input
Apart from the jsPDF project, there is nothing else out there that serves your requirement to generate Pdfs on the client side. I don’t know why you find jsPDF complicated, after all, starting and…
-
3
votes2
answers86
viewsA: PHP Submit refers to the wrong file
Problem Since you indicated that you are using a "single page" template, it tells us that you have all the code to be a server at the same time, which raises a problem with your Javascript…
-
5
votes1
answer721
viewsA: Highlight day and week in Calendar
Get current day In Javascript, to get the current day use the method getDate(): var hoje = new Date().getDate(); Get nominated week To get the week indicated in Javascript, during the construction…
javascriptanswered Zuul 35,190 -
6
votes3
answers8862
viewsA: How to make a redirect to finalize purchase without going through the Woocomerce cart?
Latest version You can see in the documentation you have option to configure the cart page so that when we are supposed to access the cart, we will be accessing another page. So two things to let…
-
1
votes2
answers147
viewsA: Activate the Hover in series
1º Locate correct element Assuming that the element responsible for the animation is the <a/>, your problem is the way you catch the element <span/>, because you have two elements inside…
-
3
votes2
answers1775
viewsA: batch file to create mysql database
To reply by @Bacco already dealt with your immediate problems, I’ll leave an agile way to deal with the issue: Mysql in batch mode Mysql can be run in batch mode, which essentially allows us to pass…
-
7
votes3
answers1382
viewsA: How do I delete a file, which has quotes in the name, by CMD?
Reserved characters Under Windows, there are some characters that are reserved (English) as they serve a purpose when used by the operating system: < (less than) > (greater than) : (two-point)…
-
2
votes1
answer1214
viewsA: Modify a button property when closing modal bootstrap
From Bootstrap v3.0.0, you can refine the element that opened the modal as follows: $('#id-da-modal').on('show.bs.modal', function (e) { var $botaoQueAbriu = $(e.relatedTarget); }); See…
-
11
votes1
answer152
viewsQ: Convert PDF document pages to Jpgs
The following code is working within the desired, where it receives parameters in order to convert all pages of a PDF file into JPG files: ID (natural number) Absolute path (must exist and point to…
-
12
votes1
answer129
views -
17
votes2
answers14623
viewsQ: What is and what is "2>&1" for?
When we want to direct the output in order to execute a command without receiving any information, among which potential execution errors we use: meuComando >/dev/null 2>&1 Effectively…
-
8
votes5
answers1617
views -
2
votes1
answer1179
viewsQ: Check if user exists
How can I in bash check if a user exists, but in such a way that script work in multiple systems ? A limited example: grep <username> /etc/passwd Does not work on systems that use NIS or LDAP…
-
1
votes1
answer715
views -
1
votes1
answer88
viewsA: Is it normal for Facebook login not to bring email from some users?
If the user has an unconfirmed email on Facebook (i.e., Facebook sent him a validation email, but he did not reply), Facebook will not send that email to the application that is being logged in,…
-
6
votes4
answers2315
viewsA: How to format a value in Javascript?
An alternative solution to deal with the problem: function formatar_valor(str) { var split = str.match(/.{1,4}/g), // divide a string em blocos de 4 join = split.join('.'); // junta os blocos…
-
2
votes3
answers777
viewsA: Calendar in PHP
The error obtained is realizing that the function mysql_fetch_array() expects an appeal but received a boleano: Warning: mysql_fetch_array() expects Parameter 1 to be Resource, Boolean Given in C:…
-
1
votes2
answers91
views -
4
votes2
answers481
viewsA: Separate <script> tag by semicolon
The problem is not with us ; but rather in the fact that browsers do the parse string <script> abstractly, soon looking for a </script>. How you have in the contents of the variable test…
-
2
votes1
answer506
viewsA: json_encode in html tag
In the form you intend, you must make use of the function htmlentities() so that double quotes are converted to your HTML entity: $array = array('a','b','c'); $json = json_encode($array); $link =…
-
6
votes2
answers494
viewsQ: Directing all root traffic to sub folder results in "403 Forbidden" error if you do not have "index.php"
The code below works perfectly to direct all website traffic transparently into the folder www: Options -Indexes +SymLinksIfOwnerMatch RewriteEngine on RewriteBase / # Verificar o destino…
-
5
votes3
answers27524
viewsA: Place button side by side
You have some problems with your current code: Elements within the link tag: The element <button/> cannot be inside the element <a/> what can be read in the documentation in: HTML5 Spec…
-
1
votes1
answer89
viewsA: "ob_gzhandler" on the same server not always supported
For my particular case, the problem was in the definition of page headers, where we scripts with the problem of triggering the "Content Encoding" error, the headers were being set after the opening…
-
4
votes1
answer89
viewsQ: "ob_gzhandler" on the same server not always supported
On the same hosting server, some accounts support ob_gzhandler and send the compression page to the browser: /* Sending gz-encoded data to web browsers * that support compressed web pages */…
-
2
votes1
answer66
viewsQ: Reset to CSS "padding" declaration
Some frameworks, as the case of Bootstrap make use of CSS-based statements to standardize overall behavior in certain elements. In this case, the padding: td, th { padding: 0; } The problem is that…
-
1
votes1
answer106
viewsA: Manipulate event with Jquery when form and link are generated automatically
The problem is that you are associating the event with elements that do not exist in the DOM when it is read by the browser. To resolve, you must make use of delegation, attaching the event to an…
-
3
votes2
answers2266
views -
1
votes2
answers2266
views -
2
votes1
answer14715
viewsQ: How to remove/uninstall the entire LAMP layer?
I have a web server on which I would like to remove the entire LAMP layer in order to perform root reinstallation of all packages, as I can perform this operation?
-
8
votes4
answers58562
viewsA: Css comments with // instead of /* */
To fill in a little bit of everything that’s already been said, and hopefully not creating any redundancy of information, the big reason why we can’t break the rule when it comes to WEB development,…
-
4
votes1
answer2835
viewsA: How to put logo on sidebar or navbar depending on screen size?
Bootstrap brings a number of responsive utilities to help deal with scenarios like this. These utilities are CSS classes that aim to manipulate the presentation of elements based on the screen of…
-
4
votes1
answer322
viewsA: Affix(Bootstrap) in div with images does not work
The problem is that you are applying the plugin Affix an element that is part of the CSS base structure responsible for keeping elements in place: <div id="right-sidebar" class="col-md-4…
-
6
votes2
answers10840
viewsA: How to read a large file row by row with Javascript (nodejs)
There is an interesting project on Github designed specifically to deal with this problem: Line Reader Asynchronous line-to-line file reader. Example: var lineReader = require('line-reader');…
-
5
votes3
answers739
viewsA: Add space to each letter in UPPERCASE
You already have an answer that is undoubtedly the way forward, an example for those who do not want to use regular expressions: $texto = "oiEusouMuitoLegal"; $letras = preg_split('//', $texto, -1,…