Posts by gustavox • 4,004 points
143 posts
-
1
votes1
answer2644
viewsQ: How to use Sweet Alert before deleting Mysql lines
I’m trying to use the sweet alert to confirm the intention to delete a row from the Mysql table, but I don’t think I know how to do it. Using the alert simple do like this: <a title='Remover…
-
1
votes2
answers612
viewsQ: Doubt about white spaces within PHP code
I’m making the connection with prepared statments to insert many variables, and in some cases it takes me a long time to find the mistakes, and now I put in one here and hit me a question: White…
-
5
votes1
answer254
viewsQ: How to set the path to access files on procedural system
I’d like to know how to use the path in a procedural system, the correct way to define the/the paths, and to access the files, and what is most important to know about. Researching I found more…
-
15
votes2
answers5421
viewsQ: How to validate each data type received from a form?
This subject has several related topics, and generates as many back and forth, each with a different answer. In some cases we have great answers, but no specific question about this question (in the…
-
3
votes1
answer247
viewsQ: How to save data in Mysql using Prepared statments
I’m changing the fields to save date in Mysql, fromvarchar for date, and I was in doubt about the correct way to include the date fields in the database using prepared statments. As DD/MM/YYYY use…
-
4
votes1
answer339
viewsQ: When using each data type of mysqli_stmt_bind_param
According to the documentação: i - corresponding variable has type integer d - corresponding variable has type double s - corresponding variable has type string b - corresponding variable is a blob…
-
8
votes1
answer299
viewsQ: Prepared statements with Mysqli does not require validation of data entry?
I was studying here about security in PHP & Mysqli, and I was left with a question: if I am using prepared statments, still need to validate data entry? For example, I have a field in the form:…
-
4
votes3
answers513
viewsA: How to put the last row number of a Mysql table into a variable
For the record, the problem was that, in addition to forgetting the fetch (which was pointed out by @rray), also had an error in the query as it was passing the wrong field name. After I put the…
-
6
votes1
answer439
viewsQ: How to use Prepared statements with external variables in Mysqli
I have the following code, which I want to use prepared statments: prepare.php: <?php include "../conex.php"; // conecta mysqli_set_charset($mysqli,"utf8"); // Transforma em UTF8 pra gravar…
-
2
votes3
answers513
viewsQ: How to put the last row number of a Mysql table into a variable
I would like to know how to take the last row of a Mysql table, and put this number inside a PHP variable. I tried so: require_once "../../models/conex.php"; $sql = "SELECT * FROM tabela ORDER BY id…
-
2
votes1
answer742
viewsA: To enter a variable, associated with a row of a table field, for a template
I don’t know if it’s the safest way, because I’m passing a parameter through the URL, but I was able to solve it like this: 1 - I created a field in the BD with auto increment; ALTER TABLE tabela…
-
3
votes1
answer742
viewsQ: To enter a variable, associated with a row of a table field, for a template
I’m trying to put together a list of links that point to a template, where one of the variables, with the contents of one of the table fields, should be informed dynamically in the template (being…
-
2
votes2
answers1637
viewsA: Force text to be downloaded in a format accepted by Msword with PHP?
UPDATE I was having some difficulty using Phpword calling external HTML files, and during the search due to some errors I ended up finding this sensational library. The use is quite simple. After…
-
5
votes1
answer336
viewsQ: How to pick up directories recursively?
How do I recursively grab all files *.php? With the code below caught all that are root, but wanted to get from all directories. I tried to use RecursiveDirectoryIterator, or use some functions I…
-
0
votes0
answers37
viewsQ: 'Pdoexception' permission problem
I’m getting a permission error to create the Huge Login: Fatal error: Uncaught Exception 'Pdoexception' with message 'SQLSTATE[28000] [1045] Access denied for user 'root'@'localhost (using password:…
-
1
votes1
answer822
viewsQ: Question on how to calculate time difference with special conditions
I’m trying to figure out the time difference between two dates using the Moment.js, but I need to observe some special conditions: Case 1: If you enter a day in a month, it already counts as "a…
-
3
votes1
answer39
viewsQ: How to check time entry and cancel calculation when come blank
I’m calculating the difference between two times using datetime, but when a time is not filled I need him to do no calculation (the result needs to be 0 or NULL), but he calculates considering…
-
1
votes3
answers1735
viewsQ: How to use if/Else within a function?
I’m trying to create a simple function, to write the title according to the gender selection on the form, but I must be doing something wrong: $sexo = empty($_POST['sexo']) ? "[sexo]" :…
-
2
votes1
answer5409
viewsQ: How to save data coming from the facebook SDK login in the database?
I’m using the facebook api for login, and following the tutorial I have been able to implement, but I still don’t understand how the system works that takes user information. What I need is to save…
-
2
votes1
answer765
viewsQ: How to position two selects within the same div?
I need to put two selects within a single div, one aligned to the left, and the other to the right. I’ve tried using CSS by creating a class to apply to each select, but it didn’t work: select.left…
-
2
votes1
answer1437
viewsQ: How to change the value of a select?
I have a script that checks the difference between two sets of dates, and I want when one of these differences is greater than the other, that the value previously chosen from a certain select…
-
57
votes1
answer3446
viewsQ: How does software licensing work in Brazil?
What is important to know before licensing a computer program in Brazil? I really need to use a license? What is and how the free software system works?
-
54
votes1
answer3446
viewsA: How does software licensing work in Brazil?
WARNING: This community wiki is not 100% ready, and even by its nature wiki, will never be. It was originally written from an extensive research conducted by a lawyer (the author of the question,…
-
30
votes2
answers3477
viewsA: Applying licenses to Github
...it is possible to license repositories[...] Yes. As @Rsinohara said in the comments, Github itself offers the option to choose a license when creating the repository: By choosing a license from…
-
13
votes1
answer2987
viewsA: Can I sell a product by-product under the Apache License 2.0?
Yes. The Apache 2.0 license is a category license permissiva (within this division into categories also exist the recíprocas totais and the recíprocas parciais). Basically, the only requirements of…
-
3
votes1
answer2810
viewsQ: How to use multiple conditions within an if
I’ve tried several ways, grouping with () in all the ways I imagined, creating a variable and calling it in condition etc, but I can find where I’m missing. $(function() {…
-
4
votes2
answers1263
viewsQ: How to search by class (instead of id) in Javascript/jQuery
I’m using a plugin for popular city/state, but I wanted to use in more than one select, so I wanted to use per class instead of ID, but what I tried so far didn’t work. I tried to follow this famous…
-
1
votes3
answers138
viewsQ: How to include decimal in PHP condition
I’m taking a value from a form that comes like this: 1222,22 (no point in the thousand, only with the , decimally) So I’m creating a condition, like this: if ($var1 < 1111,11) { $var2 = 1; }…
-
2
votes2
answers894
viewsA: Javascript does not work if it is placed in the head tag
You can do this with window.load, see below: <!DOCTYPE html> <html> <head> <title>Artistic Pizzeria</title> <meta charset="utf-8" /> <meta name="description"…
-
0
votes1
answer294
viewsQ: How do I track php file execution through the console?
update: actually my problem had nothing to do with this snippet from blockquote down there. I learned how to debug PHP, and I found several errors, but I’m not even going to enter here in each of…
-
0
votes3
answers1096
viewsA: Send mail with form data
HTML does not have native function for automatic sending of email, because it is client side. What mailto does, at most, just open the email client with the information from the form. As I said in…
-
7
votes1
answer301
viewsQ: Are there HTML text editing tags "preferred" by google search robots?
I decided to rewrite some 300 files that I will use in a project, because they were originally written directly on google Docs, and when saved as HTML and try to include with requireor include,…
-
2
votes3
answers880
viewsQ: How to remove file including with include according to conditions
I did a basic search and found nothing. I imagine it must be something simple, and I might be "looking wrong"... So for example: <?php if ($var1 != "qualquercoisa") { include "arquivo1.php"; }…
-
2
votes2
answers71
viewsA: Unexpected behavior when centralizing div
Another way to solve (I was testing here and now I saw Chun’s answer (+1), but I’ll post it anyway :)) is by determining the relative size of the internal Ivs, removing the display:table and the…
-
3
votes3
answers692
viewsA: Inline display does not work
The example site you quoted uses the foundation.css. CSS was missing. See: #sessao-1 { text-align: center; color: #000; font-family: Gabriola; margin-top: 750px; } #sessao-1 h1 { font-size: 3em; }…
-
6
votes1
answer1761
viewsQ: How to validate format and compare two dates to enable buttons
I am using a script* to enable a button when two validations are made. The first one checks the format, and the second one if the initial date is lower than the final one, but I’m having some…
-
2
votes1
answer53
viewsQ: How to manipulate margin of a Flat-UI video
I’m wearing a skin for video Flat-UI, but when I put the video inside a panel, there’s a margin at the bottom that I can’t remove at all. See on FIDDLE (roll the bar of Results down), or in the…
-
1
votes2
answers155
viewsQ: How to modify unfilled date in the form for the current day?
I tried to do with isset, guy: $var1 = isset($_POST["namedocampo"]) ? $_POST["namedocampo"] : date('d/m/Y'); And with if, guy: if ($_POST["namedocampo"] == "") { $var1 = date('d/m/Y'); } But…
-
4
votes1
answer593
viewsQ: How to change the color of a FLAT-UI select without using Less?
It is possible to change the color of a select (from data-toggle select, including Flat-UI options) by CSS without using less?. In this FIDDLE that @dHEKU posted in the comments, the color of the…
-
2
votes1
answer626
viewsQ: Incompatibility between onkeyup and date mask?
I’m having a problem using onkeyup in a date mask which is as follows: when I try to use Backspace to modify the date, I cannot pass the bar (only the button is pressed). The bar keeps disappearing…
-
6
votes3
answers515
viewsA: Company can monitor everything employee does on work computer?
Only by complementing the answer from Onosendai, the Superior Labor Court has been understanding that the email personal employee can not be monitored, but that corporate email, all traffic on the…
-
6
votes2
answers476
viewsA: Copyright and crack
The accepted answer has some flaws. They do not change the conclusion, but it is wrong in some points. The Copyright Act (9.610/98) really applies in part to "computer programs", but it is in the…
-
2
votes2
answers11358
viewsA: How to customize upload file button?
It is not possible to change the value or the description directly in HTML for security reasons, but there are some solutions in CSS or jQuery like the one you have in this FIDDLE for example (see…
-
4
votes1
answer561
viewsQ: How to convert jQuery’s . on function to pure Javascript
Today I started trying to turn a function I’m using into jQuery (which @José helped me implement in this answer) to .on, for pure Javascript, but I’m facing some difficulties. The online courses I…
-
2
votes1
answer1307
viewsA: Difficulties connecting Javascript with HTML
To include Javascript in an HTML page use the tag <script type="text/javascript"> seu script </script>. Anything within these tags will be interpreted as Javascript language. HTML5…
-
6
votes1
answer28619
viewsA: Icons in different sizes with Bootstrap
As said in the comment, these icons you are using are not from Bootstrap, but from fontawesome. Behold here the icons of Bootstrap. This is the basic way to use the Bootstrap icons: <i…
-
1
votes1
answer138
viewsQ: Doubt to automate javascript function
I’m using a Javascript function to show/hide a div according to the choice of a radio, but now they’ve become many, so I’m trying to automate it the way I’m learning in codeacademy. From the code I…
-
1
votes1
answer109
viewsA: How to add time to pass the slider?
In the code you posted you were missing close a block. With the block closing, and changing the show('drop') for fadeIn () you can control the time it will take to appear the div with slow, fast, or…
-
5
votes1
answer12530
viewsQ: How to compare two dates in Javascript or jQuery
I’m trying to compare two dates from fields text, turning them into objects Date, as follows (the first function is to format the field input with XX/XX/XXXX): function formatar(mascara, documento){…
-
6
votes1
answer3133
viewsQ: How to declare several conditions within an if
I have two ifs which take into account 3 conditions, one of which has multiple possibilities. I’m doing it like this, but it’s not working: if (($var1 == $var2) && ($var3 == 1 || 3 || 5 || 7…