Posts by Antonio Alexandre • 3,281 points
107 posts
-
3
votes9
answers41109
viewsA: What is a programming language, IDE and compiler?
I like this topic. Briefly: Programming language: It is the set of rules and conventions that one must follow to write code that will be translated into machine language. Compiler: It is the…
-
3
votes2
answers522
viewsA: Native HTML 5 Progressibar Animation
You can use setInterval to increase the value of the bar. See the example below: <progress max="100" id="myBar" value="0" class="progressBar"></progress> <script> function…
-
1
votes2
answers111
viewsA: How to prevent an image from uploading to mobile?
Passing src by javascript if the screen size is larger than the mobile screen (stipulated at 480px). Or if you start the resized page at a width less than 480, you will not load the image either.…
-
0
votes2
answers111
viewsA: How to prevent an image from uploading to mobile?
Using CSS3 media query only loads if resizing the page, so that’s what you’re looking for. Example - You will load pink div with the smaller view when you click the Run button, and if you are…
-
0
votes2
answers771
viewsA: How to remove a grid column using jquery
Based on Lucas' code (+1), I placed a button passing the column index and turned it into a function: function ocultar_coluna(coluna) { $(document.getElementsByTagName('th')[coluna]).hide(); var…
-
2
votes4
answers3526
viewsA: How to pick a String that is between Javascript tags using Regex
I know the question is already answered, but what if I wanted to get more than one e-mail? These regular expressions are only working for one email. I made the function below, which although not…
-
6
votes1
answer1391
viewsA: Connection with Webservice SOAP WSDL with XML return
Can use simplexml_load_string to convert your xml string to a Simplexmlelement object. Example: <?php $xmlstring= "<?xml version='1.0' encoding='UTF-8'?> <teste> <pessoa>…
-
4
votes2
answers602
viewsA: How to remove mysql records from half an hour (or more) ago
DELETE FROM nometabela WHERE campodatahorainsercao < DATE_SUB(NOW(), INTERVAL 30 MINUTE) Notice the following thing: All that has in the table that was inserted more than 30 minutes will be…
-
2
votes2
answers858
viewsA: Div bootstrap misaligned
This problem of Divs climbing on top of each other is usually recurrent, not just with Bootstrap. Understand the problem here: Normally you have Ivs of several different heights being placed next to…
-
4
votes1
answer816
viewsA: Navigation via HTML or Javascript
Yes, there are indexing problems when using javascript for links. The search engines navigate the site following the anchors and keeping the text that was used in them. If you use javascript not all…
-
1
votes2
answers194
viewsA: Centralize navbar items when viewed on desktop
Nano, I found the menu super cute. First, to center your items when viewed on desktop, you need to split the space and fill it. Note that you have 4 items, so this space division is 25% each, when…
-
0
votes5
answers36368
viewsA: Take value from an attribute in td
I liked the reply of Diego Vieira(+1) because I did not know this attribute date-something that can be created. However, I went a different way, because I saw that the name was already written…
jqueryanswered Antonio Alexandre 3,281 -
1
votes3
answers296
viewsA: How do prepare dynamic and generic with mysqli?
I have now created a generic insertion function using PDO. To test, I created a table with two fields: CREATE TABLE `teste` ( `id` INT NOT NULL AUTO_INCREMENT , `nome` VARCHAR(255) NOT NULL ,…
-
1
votes1
answer110
viewsA: How to find out the rendered size of a curve in Html5 canvas 2d?
Comrade found your question very interesting, I had never worked with the canvas Ezier and I took a test to play. I understand from your question that you want to know the distance from the left…
-
3
votes4
answers150
viewsA: Basic JS exercise: simple text search
The question is already answered, but for those interested can follow another way of locating text elements using string.search that can be adapted to different uses. <script> texto_original =…
javascriptanswered Antonio Alexandre 3,281 -
1
votes2
answers1276
viewsA: I can’t go to another page with the header function
I don’t agree with the way you are doing things, because only redirecting will not give the "Update successfully performed" information to the user, but if you change: if($link) { for: if($link…
phpanswered Antonio Alexandre 3,281 -
0
votes1
answer80
viewsA: Reading array with php
Boy, it looks like you sent the blank form or that your namesake function is modifying your data and leaving them blank. See if it helps you with the code below, which works properly: An html form…
-
5
votes2
answers3515
viewsA: What is the difference of an empty string and NULL in SQL?
Differences: Size it occupies in the bank: The difference is fuzzy, where NULL would take up less space, because NULL is literally nothing and an empty string has at least the information of being a…
-
1
votes3
answers792
viewsA: Add class after the page is loaded
I noticed you are using the plugin http://www.jqueryscript.net/animation/Animate-Elements-In-When-They-Come-Into-View-jQuery-CSS3-Animate-It-Plugin.html <!DOCTYPE html> <html>…
-
2
votes1
answer101
viewsA: n >= 1 in the while condition returns no value
When n reaches 1, n - 1 is equal to 0 and any number multiplied by zero is equal to zero. Therefore fat is equal to 0 when you use n >= 1. I did a search and found the answer to your second…
-
1
votes2
answers52
viewsA: When I create a Form deforms the Button
<!DOCTYPE html> <html> <head> <link href="StyleMain.css" rel="stylesheet" type="text/css"/> <title>Teste</title> <meta charset="UTF-8"> <meta…
-
0
votes1
answer178
viewsA: How to enable the right-click (with the new tab option) on an input or button
With javascript I made a little beast just joke... <script> function detectLeftButton(evt) { evt = evt || window.event; var button = evt.which || evt.button; if(button == 1) { // ação para o…
-
1
votes8
answers7830
viewsA: Is giving a "SELECT" before an "INSERT" a safe way of not having duplicate records?
If you can use SELECT within a transaction, it is safe yes. If you can create a trial, you can pass only the values to it and the trial takes care of doing what you have to do, without needing the…
-
2
votes12
answers28737
viewsA: What are the ways to iterate an array in PHP (without foreach)?
Using do ... while: do { $cliente = current($dados_teste); // acessa item atual com "current" $tabela.= $cliente['nome'] .'-'. $cliente['idade']; // usa os dados } while(next($dados_teste)!==false);…
-
0
votes3
answers68
viewsA: Resize image with php
As the bad mood quoted, although the function saves with the name Rand, her return is Boolean 1 in case she was able to save and 0 in case she gave error. $up will always be 1 if you can save and 0…
phpanswered Antonio Alexandre 3,281 -
1
votes4
answers5196
viewsA: How to save line breaks from a textarea to the database?
Do not use nl2br to save to the bank so as not to dirty the bank with html. nl2br you can use at the time it will display on the screen. Except if your intention is to save html in the database, for…
-
2
votes7
answers13788
viewsA: How to represent money in Javascript?
For those who need a quick solution to solve small problems, follow a few simple functions in javascript: <script> // Abaixo seguem 3 funções genéricas que podem ser utilizadas em qualquer…
-
1
votes2
answers592
viewsA: Accept cents in javascript
Fala Hemerson, Try the following: // com preco ainda como string converte vírgula para ponto preco.replace (", ", ". "); // depois converte para float preco = parseFloat(preco); And in php you’ll…
javascriptanswered Antonio Alexandre 3,281 -
2
votes3
answers71
viewsA: Compiler accusing error I don’t know
Its function sumofDie(value1, value2) although it will always arrive at a time that i will be equal to 6 (in the last interaction), I think the compiler is implying because there is no Return out of…
-
7
votes3
answers218
viewsA: Doubt javascript Function t(n,t,i,r)
I think to complement the answer is worth here a basic explanation of how to create a function in javascript. 1) starts using the word Function followed by the name you want for the function. 2)…
javascriptanswered Antonio Alexandre 3,281 -
1
votes2
answers116
viewsA: Take values from a post form and forward to an html table
I scored +1 for lvcs, but put here tb another answer since your json has an array of objects and call them as array will give an error, because object property has to be called with arrow ( -> ).…
-
3
votes1
answer173
viewsA: Resize in image with PHP
Instead of using: $newwidth = $width * $percent; $newheight = $height * $percent; Change to: $newwidth = 600; $newheight = 315; But the images will be stretched. To put on your facebook meta:…
phpanswered Antonio Alexandre 3,281 -
0
votes3
answers1601
viewsA: Help me with the "Undefined index: referrer in " PHP error
It has the detail of checking with isset, but it also has the detail of setting variable as null. If you are going to use a variable within an if, in this context, it is better to set it to false.…
-
0
votes1
answer155
viewsA: Form submit is not targeting and shaving the value to the php file
Dude I think I know what’s going on. Try the following, instead of using this function the_id(), create a $i variable starting from $i = 1; and inside the loop you put $i++; Will be next: <?php…
-
2
votes1
answer520
viewsA: I need to add a cell phone of an html table dynamically
Comrade, follow a base to help you. I understood your idea of not having to edit the java-script, so it was necessary to concatenate an id with a fixed name to detect the html ids used. When you…
-
9
votes9
answers12142
viewsQ: Search via ajax during input text ( autocomplete )
I did a search using ajax that when clicking a button triggers a request with the term searched and returns with data that fills a combobox html (select). So far so good. However, I found it…
-
2
votes2
answers4963
viewsA: Issue with accentuation in CSV file export
Andre, it seems your scenario is as follows: The php file is saved in UTF8. The csv file being opened is in ansi/iso. As your output will be in UTF8 because your php file is in utf8, you have the…
phpanswered Antonio Alexandre 3,281 -
0
votes1
answer998
viewsA: How to add Padding in Select
William, what happened in your case is that Boostrap has its own styles and its padding with Important is pushing the text in such a way that it goes away. I tried increasing the height using…
-
0
votes1
answer697
viewsA: ERR_CONNECTION_TIMED_OUT ERR_CONNECTION_REFUSED
With just the past information you can’t give a conclusive answer as to what might be causing the slowness in the system, but we can analyze point by point your basic view of your system to help you…
-
1
votes2
answers1260
viewsA: How to insert all array values and avoid $query->execute() with each foreach run?
You need to do three things: 1) Generate the placeholders. Knowing how many groupings of values will be inserted, generate sql with placeholders. It will generate something like: INSERT INTO…
-
2
votes2
answers272
viewsA: Animation manually Jquery
As your question was about an idea of how to make a slider, I made one here that maybe you can adapt to your needs. The idea of this slide below is simple and enough people use sliders so: The…
-
3
votes3
answers490
viewsA: How is a Framework developed?
What is necessary for the development of a Framework? Depends on what your framework is for. There are frameworks for developing different types of software, a game development framework is very…
-
19
votes6
answers64346
viewsA: What is the difference of API, library and Framework?
Summary explanation: API It’s for integrating systems. Someone provides an API so you can integrate your system with the system that provided the API. Or you create and provide an API if you want…
-
7
votes1
answer1116
viewsA: how to pass data to a php function by ajax url?
I know the question is old and you must have realized what you need to do, but in case someone comes here and wants to know an answer, follow me. Javascript code fragment using jquery ajax: $.ajax({…
-
2
votes2
answers101
viewsA: Set a random return to a function
My answer is based on your code and your question, but I would like to stress that I found the line logic that arrow the variable $valid very confusing. I basically used the function Rand(int min,…
phpanswered Antonio Alexandre 3,281 -
2
votes3
answers63
viewsA: Page not printing the results
Read the comments next to the variables. If no action exists the form is submitted to the same page. <form method = "POST"> <table border = "1"> <tr> <td class =…
phpanswered Antonio Alexandre 3,281 -
1
votes1
answer454
viewsA: PHP and Javascript - Sending HTML attachment in e-mail
First there is this class I made based on some functions I found on the internet in 2012: Emailauthenticator.php <? class EmailAuthenticator { var $conn; var $user; var $pass; var $debug; var…
-
1
votes2
answers1528
viewsA: Filter c/ AJAX + PHP
Example of an ajax code: <html> <head> <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script> <script> $(document).ready(function()…
-
2
votes2
answers120
viewsA: Error Showing Next Month
I made a small class to help work with dates that make this calculation. Follow the class and then examples of how to use it and the output that is generated. Datehelper.php : <?php class…
phpanswered Antonio Alexandre 3,281 -
1
votes2
answers1528
viewsA: Filter c/ AJAX + PHP
When I answer a question I usually copy code, paste here on my server and run to debug, but this is the kind of question I can’t do it because it needs created tables and so on. So what I can do is…