Posts by Allan Andrade • 6,409 points
206 posts
-
2
votes1
answer8826
viewsA: Background with transparent image
You can use the opacity filter in CSS: opacity: 0.5; filter: alpha(opacity=50); /* PARA IE8 ou superiores */ Read more about opacity and transparency on W3SCHOOLS - CSS Opacity / Transparency…
-
0
votes1
answer466
viewsA: How to handle jquery validate error messages?
You can try to hide the error message: $('#ID_DO_INPUT').siblings('label.error').css('display', 'none');
-
0
votes1
answer35
viewsA: Problem Deleting Row in SQL Table with Ajax
Try to replace where you have var id = $(this).parent().parent().attr('id'); For var id = $(this).attr('id');
-
3
votes3
answers249
viewsA: Extract only numbers from a Javascript text box
You can filter the field value: var valor_extraido = valor_extraido.replace(/[^0-9]/g,'');
-
1
votes1
answer79
viewsA: Error in taxonomy.php
The function add_term_meta() is being declared twice. One in the archive: /home/xxx/public_html/wp-includes/taxonomy.php And another in the file:…
-
3
votes3
answers112
viewsA: swap Z for S char between vowels in a string
Using a vowel list: $input = ['TEREZA' , 'CEZAR', 'BRAZIL', 'ANZOL']; print_r(preg_replace('/([aeiou]+)z([aeiou]+)/i', '$1S$2', $input)); or: echo preg_replace('/([aeiou]+)z([aeiou]+)/i', '$1S$2',…
-
1
votes3
answers16505
viewsA: How to get month and year of a date?
If dates are in fields of type date or datetime, may use YEAR and MONTH: SELECT * FROM SUA_TABELA where year(CAMPODATA) = 2013 and month(CAMPODATA) = 1;…
mysqlanswered Allan Andrade 6,409 -
1
votes5
answers50
viewsA: How to change the end of a name
You can use preg_replace, see an example: I created a function to return the changed name: function alteraFinal($nome){ $pattern = ['/ON\b/']; $replace = ['OM']; return…
-
2
votes2
answers536
viewsA: How to remove a part of the string at the beginning or after the space?
You can do it using the preg_replace, created an example function: function removeHe($nome) { $pattern = '/[^a-zA-Z ]{1}H(e)/i'; $replace = '$1'; return ucwords(preg_replace($pattern, $replace,…
-
4
votes1
answer86
viewsA: How to calculate fixed date in php?
You can do it using strtotime, with the parameter 'next sunday', take the example: to write to the database // formatei no formato que utilizo no banco, e complementei com o horário fixo echo…
-
9
votes2
answers1023
viewsA: How to remove a repeated character in sequence?
You can use the preg_replace, an example: $var = 'Elliiiiiiiiiiizabetth'; $pattern = '/(.)\1+/'; $replace = '$1'; $resultado = preg_replace($pattern, $replace, $var); echo $resultado; Upshot:…
phpanswered Allan Andrade 6,409 -
1
votes3
answers2823
viewsA: How to add and remove classes with Javascript?
To remove the class, set the element class to empty: // Pega o primeiro li e remove a classe document.getElementsByName("li")[0].className = ""; If you want to keep some class, restore the class:…
-
9
votes3
answers1297
viewsA: How to delete the last record from a table?
As Rray said, it is not possible, but there are alternatives... An alternative would be to use variables: set @val_max = (select max(id) from aluno ); delete FROM aluno where id = @val_max; I hope…
-
1
votes2
answers36
viewsA: My main DIV link does not work if I have a link in my internal DIV
The link you refer to is not down below the other link and yes WITHIN from the other link. Put in separate tags... See the code snippet below: function superpopgv(guaraparivirtualsuperpopup) {…
-
3
votes1
answer1424
viewsA: Force https using . htaccess on a given domain and domain only
The correct name for the file is: .htaccess Use mod_rewrite to force HTTPS is not recommended for security reasons. read more on Redirectssl It is recommended that you use Virtual Host for this...…
-
5
votes1
answer1095
viewsA: Best practices for a login system Sessions/Cookies
In security matters: Session wins because cookies are text files saved on the client computer, so they can be manipulated. However, to avoid manipulations of Session, you must specify some settings…
-
1
votes2
answers1286
viewsA: How to get the value of an attribute in Jquery?
See the example below working, using the method is and the parameter :visible: $(document).ready(function() { $("#lista").css('display', 'none'); $("#imagem").click(function() { if($("#lista").is(…
-
1
votes3
answers57
viewsQ: THIS object in conflict between jQuery and ECMA6 class
How to resolve the conflict between the this of a jQuery loop performed within a javascript class method (ECMA6)? Example, the metodoUm loops using jQuery and for each loop iteration, calls the…
-
1
votes1
answer99
viewsA: how to restore Mysql Database
If you want to RESTORE an existing backup file, you can use the following command: #mysql -u root -p nomedobd < /home/nmedobd.sql If you want to GENERATE a backup file, you can use the following…
mysqldumpanswered Allan Andrade 6,409 -
2
votes2
answers276
viewsA: How to configure the Session?
I don’t know if I understand exactly what you need, but I think the example below can help you. <?php // inicia a seção. antes de escrever qualquer html na página session_start(); // DEFINE O…
phpanswered Allan Andrade 6,409 -
3
votes2
answers96
viewsQ: How to make Netbeans recognize the ES2015 syntax?
How to use the Netbeans with the ES2015? I’ve done some testing with Netbeans 8.0.1 and 8.0.2, but does not recognize the new syntax: let, const, etc..…
-
7
votes5
answers163
viewsA: Is there a tool to make html manuals easy to update?
In addition to the options informed by Lacobus: phpDocumentor or the Doxygen ... there is the Apigen, the phpDox, the phpXRef, the Phpdoctor, the Phpsimpledoc and others. phpDocumentor has…
-
0
votes0
answers172
viewsQ: Error trying to run official Angular2 Quickstart example
I am starting a project to study Angular2, and for that I am using Debian 8 with Node V6.3.1 (npm v3.10.3). Following the step by step official Angular2 Quickstart: #git clone…
angularasked Allan Andrade 6,409 -
1
votes1
answer143
viewsQ: Do you use Typescript in Netbeans 8.1?
I’m using Netbeans 8.1, but it doesn’t recognize the syntax of Typescript. Is there any plug-in that works well with Typescript in Netbeans 8.1? If not, which IDE would be indicated?…
-
1
votes3
answers227
viewsA: How to store the number of rows found from a Mysql query in a variable
The result is accessed using the method mysql_result I made some changes to your code, but I couldn’t test it because I updated PHP on my servers and the lib mysql_... doesn’t work anymore... so I…
-
0
votes1
answer38
viewsA: Java Mysql and FTP connection
I don’t know if it’s the best way, but one I’ve used and it worked: - for each system user, create a user in the database, then the user will log into the system with a database login, so there…
-
5
votes4
answers1229
viewsA: How do you know if a certain day is a weekend?
I don’t know any native method that returns whether it is weekend or not, however, could be implemented through a simple function: function isWeekend($dia) { $mes = date('n'); $ano = date('Y'); $dt…
-
6
votes2
answers1362
viewsA: PHP Current business days/ Missing days
I’ve built a small class that responds to an array with the information you need. class DiasUteis { public static function contarDiasUteis($data, $formato = 'd/m/Y') { $dt =…
-
0
votes2
answers827
viewsA: Remove duplicated data and return the highest value date field
I think this might help: $formato = 'd/m/Y'; // define o formato para dd/mm/yyyy $data1 = DateTime::createFromFormat($formato, '05/07/2016'); // define data 1 $data2 =…
-
5
votes5
answers19859
viewsQ: Is it possible to include a Javascript file within another Javascript file?
You can include a Javascript file inside another Javascript file? Similar to @import in CSS or to include of PHP?
javascriptasked Allan Andrade 6,409 -
0
votes1
answer5122
viewsA: PHP class to generate barcode in Code39 standard with height and width adjustment
After trying several classes, I found one that met well with barcode printing, with 10 digits, in the Code39 standard, in thermal printers, without giving reading problems or something similar.…
-
4
votes1
answer107
viewsQ: Why do errors in PHP scripts run via the command line not appear in the apache error log?
It is important to note that errors that occur in running PHP script via browser are recorded without any problem in the file: /var/log/apache2/error.log. The problem only happens when scripts are…
-
0
votes1
answer43
viewsA: Why did I repeat it twice to get the answer right?
The search you are doing is for each vector item. That is, it compares the item value to the vector item $vet with the value of the variable $chave you are looking for. He’s writing because it’s…
phpanswered Allan Andrade 6,409 -
0
votes1
answer5122
viewsQ: PHP class to generate barcode in Code39 standard with height and width adjustment
I’m having difficulty generating barcodes in PHP, by default code39, containing 10 digits (numbers only), for printing the web page containing the barcode in thermal printers. I have tested several…
-
1
votes1
answer68
viewsA: How to market a framework
PHP is an open source language. Once you have access to the codes I don’t see how to prevent it from working. Even using tools like Zendguard there are ways to reverse the code. So, there’s no…
frameworkanswered Allan Andrade 6,409 -
3
votes1
answer96
viewsA: if only executes Else
Maybe it’s because you’re comparing a string with an integer, just to be sure, it converts to an integer before comparing and makes a comparison of value and type '==' (three equals signals). I also…
-
0
votes1
answer97
viewsA: Issue Statement of Services
Basically where you’re wearing: SUM(IF(debito_credito_financeiro = 'D', valor_financeiro, 0)) AS debito, Change to sum(case when debito_credito_financeiro = 'D' then valor_financeiro else 0 end) as…
mysqlanswered Allan Andrade 6,409 -
2
votes1
answer47
viewsA: Various functions that will do the same thing
Yes, using the concept of Inheritance of Objects, which is part of the object orientation. To create class inheritance you can do so: Create a file, for example: comum.php, with the following…
-
0
votes2
answers202
viewsA: Mysql query not returning
Probably errors are not being displayed. If you are in a (non-public) development environment, you can change your file php.ini changing: where there is display_errors = off change to display_errors…
-
5
votes1
answer1749
viewsA: Limit login attempts by time and quantity
I think it would be interesting to evaluate if in your case it would be interesting to implement resources to avoid nonhuman access, ie robots, as for example: CAPTCHA: This feature can be…
-
0
votes1
answer69
viewsA: Jquery slide plugin
In HTML, add id="myCarousel" in the <ul id="myCarousel" class="nav nav-pills nav-justified">, that should stay that way: <ul id="myCarousel" class="nav nav-pills nav-justified">. I also…
-
0
votes1
answer45
viewsA: Remove spaces between a page and another
Do not need (and should not) to open the PHP tag on each line. Anything between <?php and ?> will be interpreted by the server as PHP code. It is also not necessary to use ?> at the end of…
-
2
votes1
answer1211
viewsA: How to run a function from a url?
You can try like this: require("classes/Database.php"); /* requiro fora da função */ function excluirDados(){ $tipo = $_GET['tipo']; $funcao = $_GET['funcao']; if($_GET['tipo'] == 'blog' &&…
phpanswered Allan Andrade 6,409 -
1
votes2
answers450
viewsA: Sending form for two php files
Using PHP: You can send via post or get to a file (controller), which will handle and distribute the data to the 2 distinct files (models). Using JAVASCRIPT: You can take the fields you want and…
-
0
votes1
answer173
viewsA: Pick arrays with php space
Every entry in json_encode() All string must be encoded as UTF-8. So, to solve your problem, just format the entry with utf8_encode: <?php $servername = "localhost"; $username = "root"; $password…
-
3
votes1
answer83
viewsA: Integer division
If I understand your question correctly, I think this is what you’re looking for: <?php function distribui_inteiros($numero, $caixas) { echo "Distribuindo o número: $numero em $caixas caixas.";…
phpanswered Allan Andrade 6,409 -
0
votes2
answers1272
viewsA: Problems with UTF-8 in PHP project
Before writing any output in HTML, try the command below: <?php header('Content-Type: text/html; charset=utf-8'); It is also important to check the charset of the editor (or editors) you are…
-
1
votes2
answers224
viewsA: Regular expression to grab Youtube link in text
I think this might help, basically, I changed the $Pattern. <?php $content = 'Saúde" todas as segundas-feiras, às 9h15, com reprise às sextas-feiras, a partir das 13 horas. Durante a exibição da…
-
2
votes1
answer639
viewsA: Check database in real time with Javascript
You can try the following: Use the method setInterval() to call a script via AJAX every X period. Ajax content can be loaded anywhere on the page without the need to reload it, inside a div for…
-
1
votes2
answers427
viewsA: Using $tempo = date("d/m/Y H:i:s",time()-86400); to delete past schedules
I don’t know if I understood the question correctly, but it is possible to delete the records with a field type "datetime" with values less than 30 minutes of the current time using the exclusion…