Posts by Filipe Moraes • 8,737 points
259 posts
-
0
votes1
answer724
viewsQ: Capture value from an email-like field at js
I have the following HTML code with Angularjs: <html ng-app> //... <form name="myForm2"> <input type="email" id="email" name="email" ng-model="formData.email" required/> <span…
-
3
votes1
answer295
viewsQ: Div with superior z-index cancels another div with lower z-indez
I have 2 Divs. The first has z-index 1 and position Fixed. The second div has z-index 2 and position relative. The second div has a very extensive content and among the contents, there is a blank…
-
1
votes3
answers2982
viewsA: Find out if a website is on or off
I had the same problem and changed the script. The "responsibility" of getting data from the page passed to another function. Function to check only if the given link returns any response:…
-
1
votes3
answers660
viewsA: Position of a text relative to the top line
You will have to use Javascript to do this, although CSS would be sufficient, but would be limited to the alignment of the text. Utilize Jquey to facilitate. Alignment will always be relative to the…
-
3
votes2
answers154
viewsQ: Variable equal to itself if the logic result is false
Consider the following code: $a = $b > $c ? $c : $b; The question is, if $b is a set of operations, if the logic result $b > $c is false, I will have to repeat the entire existing operation in…
phpasked Filipe Moraes 8,737 -
13
votes3
answers759
viewsQ: Comparison between a numeric string and an alphanumeric string
The following operation returns true: var_dump("1" == "1e0"); //1 == 1 -> true But if I add an "e" at the end of the second string, it already returns false: var_dump("1" == "1e0e"); //1 == 1…
-
1
votes4
answers685
viewsA: Effect with jQuery locking without reason
I tested your code here and it worked, I just made a modification: SemConflito("#lp-1-hover").stop().slideDown(400,'easeInCubic'); I made the include of Jquery UI, it is also necessary because of…
-
2
votes1
answer198
viewsQ: Send email via PHP in windows server 2008 R Standard with wampserver 2.0
I am using wampserver 2.0 in windows server 2008 R2 Standard. On the server is installed the SMTP Virtual Server. In php.ini I have the following configuration: [mail function] SMTP = 000.00.000.000…
-
4
votes6
answers1555
viewsQ: How to do the following query without using INNER JOIN?
I have table A with the following fields: ID | ID_PAIS_ENVIO | ID_PAIS_RECIBO 1 | 23 | 47 //... I have table B with the following fields: ID | NOME_PAIS 23 | Brasil 47 | Portugal //... I need a…
-
5
votes3
answers6817
viewsQ: Recover Mysql Table
I reinstalled WAMP and did not export the database (.sql), but I have the files ". ibd" and ". frm". After the installation, I created a blank database and copied to the folder all the files ". ibd"…
-
1
votes1
answer2257
viewsQ: Limit upload size with PHP
I set up the php.ini and changed the maximum allowed size for uploading 12MB. In PHP, I also limited the upload size to 12MB, as follows: if($_FILES['imagem']['size']>12582912){ echo "Limite…
phpasked Filipe Moraes 8,737 -
1
votes1
answer324
viewsA: File opening via Load jquery method
Which error is returned? Your absolute path is right? The "alert()" function exists in your script? Try changing your code: function Ler(){ setTimeout(function(){…
jqueryanswered Filipe Moraes 8,737 -
2
votes1
answer352
viewsA: Real time server load
You can use AJAX to make your requests to this PHP file, preventing the page from being reloaded every 50 seconds. The advantage of using AJAX is that you reduce traffic between the client and the…
phpanswered Filipe Moraes 8,737 -
5
votes2
answers212
viewsQ: Comment system with video
When making a comment on Facebook, for example, and adding a link to the video from youtube, Vimeo and others, notice that the video is automatically embed. The same is true when we insert a link to…
phpasked Filipe Moraes 8,737 -
10
votes2
answers1172
viewsQ: Block unwanted AJAX calls
I did a test on Google Plus, turned on Firebug and inserted a post. When parsing Firebug I recovered the URL it was executed via AJAX. I copied the URL and ran it in the browser with the active…
-
10
votes1
answer290
viewsA: What does the semicolon at the beginning of the line mean?
The semicolon function at the beginning of the line is to correctly concatenate a new code when the previous one does not include ";" at the end. var n = a + b (c + d).print() Without the comma, the…
javascriptanswered Filipe Moraes 8,737 -
11
votes1
answer290
viewsQ: What does the semicolon at the beginning of the line mean?
I was going through a code and I found the following excerpt: ;(function ($, window, document, undefined) { //... })(jQuery, window, document); Note that at the beginning of the first line there is…
javascriptasked Filipe Moraes 8,737 -
7
votes1
answer1759
viewsQ: Center div parent when children have dynamic width
I have several div’s with the following css: float:left; width: 25%; min-width: 300px; max-width: 400px; That is, as I insert a div, it fills the available space from the left side of the parent div…
cssasked Filipe Moraes 8,737 -
2
votes2
answers1331
viewsA: When to record logs in database?
Your question will probably be closed because it is based on opinions, but I believe I can answer something within the scope of the OS. Be afraid yes, but not because the table gets big, but…
loganswered Filipe Moraes 8,737 -
3
votes3
answers21331
viewsA: Insert image into database
It is difficult to help you without knowing which DBMS and which language you are using. However, for example, I will use Mysql+PHP. Answering your question: Mysql uses a LONGBLOB field. Now, I…
-
0
votes1
answer450
viewsA: HTTP 500 error in Drupal Ajax
The problem has been solved. Due to a server upgrade, for some reason the php version has been changed to 5.4. I selected version 5.3 again and it worked again. Surely it was version…
-
4
votes2
answers3291
viewsA: How to multiply the value of 3 inputs using pure javascript?
Change your total variable: var Total = document.getElementById(comprimentoID).value * document.getElementById(LarguraID).value * document.getElementById(InclinacaoID).value; The problem is that you…
javascriptanswered Filipe Moraes 8,737 -
0
votes2
answers376
viewsA: jQuery Toggle Animation is not working
It doesn’t work because clicking is running the second function: $('#logoMob, #btMob').click(function() { //NÃO EXECUTA ESSE TRECHO AO FAZER CLICK $('nav ul').stop(true).animate({ left:"328px" },…
-
1
votes1
answer223
viewsA: Table without color IE
The problem is in CSS, what you posted is incomplete. Note that what you posted applies a solid color and not a gradient as in the image. <table…
-
6
votes4
answers2040
viewsA: Problem with height of Ivs that do not accompany each other’s content
One solution would be to use the display table on parent div and display table-Cell on the strings, see the css: .conteudo { display:table; width:auto; } .esquerda { display: table-cell;…
-
4
votes5
answers5625
viewsA: URL friendly with . htaccess
htaccess will not change your URL, it will remain the same. It is the opposite of what you wrote, the user will write: meusite.com.br/criacao-sites htaccess is a read/orientation file. Your URL will…
htaccessanswered Filipe Moraes 8,737 -
1
votes4
answers145
viewsA: How to define database tables?
If you just want to count the number of days, just create a field. When generating reports, avoid adding another table to your query. Within this field save the data as follows:…
-
3
votes1
answer534
viewsQ: Index for MYSQL - ORDER BY influence when creating an index?
I have the following query: SELECT type,name,points FROM clients WHERE type='1' ORDER BY name I created an index for the "clients" table only above the "type field". Adding an ORDER BY on top of a…
-
1
votes3
answers44020
viewsA: receive ajax json POST in php and return to success
For your PHP (report.php) to generate a JSON-like response: <?php //Alteramos o cabeçalho para não gerar cache do resultado header('Cache-Control: no-cache, must-revalidate'); //Alteramos o…
-
1
votes2
answers326
viewsQ: Database to work with nodejs
I’m developing an entire application with Nodejs. The main reasons for using Nodejs are financial/performance. I have not yet worked with database using Nodejs, but I have some doubts, since the…
-
6
votes4
answers4178
viewsA: What is the difference between joining tables by JOIN and WHERE?
They do exactly the same thing, they are equal both in performance and the result obtained, they only differ in syntax. If you want to validate what I wrote above, use the EXPLAIN command: EXPLAIN…
-
13
votes4
answers913
viewsA: Is multiple includes bad for performance?
The include does not slow down the page, but rather the contents of the file that will be included. Performance depends on the contents of your file that will be included, for example, many FOR…
-
3
votes1
answer782
viewsA: Oauth vs Conventional login system authentication. Which to use?
What I will answer is not an opinion, I believe that most programmers will agree, which makes it almost a rule. There are advantages and disadvantages of using Facebook login and a conventional…
-
1
votes4
answers20624
viewsA: Error: Uncaught Typeerror: Undefined is not a Function
Try it like this: $(document).ready(function(){ $("#txtCnpjPesquisa").mask("99.999.999/9999-99"); }); Another thing, you are making duplicate includes, the files with ".min.js" are cleaner versions,…
-
1
votes1
answer100
viewsA: Generate a table from another 5
I changed the query, it was as follows: SELECT m.data, date_format(m.data,'%d-%m-%Y') AS mdata, m.midia_origem, p.source_code, m.campanha, COUNT(m.campanha) AS propostas, SUM(m.custo) as custo FROM…
-
1
votes2
answers97
viewsA: Unknown column 'b.id2' in 'Where clause'
Unknown column 'b.id2' in 'Where clause' The error says that there is no "id2" column in table "tb_buyref", the "b" in your query is only an alias for the table. Checked the table structure?…
phpanswered Filipe Moraes 8,737 -
3
votes1
answer275
viewsQ: Migrating Windows Local Development Environment to Mac
I would like to migrate to Mac, but I have some fears about the local development environment. The question is in relation to Apache, Mysql (and other BD’s), PHP and Node.js. The issues are:…
-
5
votes2
answers2818
viewsQ: Block javascript and sql-Injection attack on the same string
I am receiving data from a form in php via get. I’m handling the information as follows: $search = mysql_real_escape_string(htmlspecialchars($_GET["t"], ENT_QUOTES, 'UTF-8')); With this I intend to…
-
-1
votes1
answer450
viewsQ: HTTP 500 error in Drupal Ajax
Days ago the server made a reboot unscheduled and since then when trying to edit any data in Drupal, the error below is returned. The error happens when I click the button "Customize this page".…
-
1
votes1
answer1217
viewsA: Transfer keys and values from a JSON to PHP variables
Utilize json_decode with the second parameter "true", an associative array will be returned, i.e., items formed by a key pair and value, in which each key has an associated value. An example, where…
-
1
votes1
answer147
viewsA: PHP Achievements/Achievements System
This is very relative and will depend on the flow of users and the tables involved. If there is no way to modify the game script so that it saves the data as the user moves forward, then I only see…
phpanswered Filipe Moraes 8,737 -
9
votes5
answers41336
viewsA: Number formatting (PHP)
Use the number_format function. The default function returns in American format, so the need to pass 2 parameters, in this case the "," and ".". echo 'R$' . number_format($num, 2, ',', '.');…
phpanswered Filipe Moraes 8,737 -
4
votes4
answers43355
viewsA: Check if string has only numbers
Use isNaN to know if the string contains only numbers, if false means it is a number: if(!isNaN(num)) alert("a variavel num é numérica"); isNaN(123) // false, então é numerico isNaN('123') // false…
-
2
votes2
answers293
viewsA: Sort by date in Mysql
There is no need to create another field, it will only "pollute" your database. See, it can be done as follows: SELECT IF(dh_premium_expires<now(),0,1) as premium, dh_premium_expires, score FROM…
-
1
votes5
answers5103
viewsA: Mail() function does not send email
This has happened to me before and I added a header and it worked in my case. Take an example: $headers = 'From: Titulo da aplicacao <[email protected]>'."\r\n" . 'Reply-To:…
-
0
votes1
answer330
viewsQ: Sending authenticated email with Swift Mailer
I have a php file that sends authenticated emails using the Swift Mailer class. I implemented the class on one server but the email used in authentication is from another SMTP server. We entered…
-
16
votes1
answer2380
viewsQ: XSS attacks, how does it happen?
Recently a client was the victim of XSS attacks. We handle all the faulty inputs, but I can’t understand how malicious javascript code was inserted into the files ". js" on the server. How they…
-
0
votes3
answers4703
viewsA: How do a select pick up 8 lines in a row or more where there are common values?
If the lines are equal, make a GROUP BY as follows: SELECT latitude, longitude FROM tabela GROUP BY CONCAT(latitude,longitude) HAVING COUNT(CONCAT(latitude,longitude)) > 7…
-
6
votes1
answer3352
viewsA: Object appears at a certain place on the page
Use jquery + css. Place the arrow inside a div and apply the css so it is always floating on the right side, for example: <div class="seta"><img src="/imagens/seta.jpg" /></div>…
-
6
votes2
answers470
viewsA: Analysis on AJAX code
This is not Long Polling and I do not recommend using the script by the following: A connection to the server is established every 5 seconds, even without any changes to the server. If this were a…