Posts by Edson Horacio Junior • 1,568 points
46 posts
-
1
votes2
answers671
viewsA: Display different message in case of timeout
Call via AJAX the PHP file that does this processing, and then scan the response’s HTTP status code to see if it occurred timeout: $.ajax({ type: 'GET', url: 'processamento.php', cache: false,…
-
4
votes1
answer1091
viewsQ: Best way to go through a Hashset
I’m used to programming in PHP and now I’m studying Java, and the Collections API is something new and very interesting for me. I searched the internet and easily found several ways to go through a…
-
3
votes1
answer36
viewsA: pick private user id of a session
In the file you’re giving the unserialize($_SESSION['usuario']) need to have class definition pojoUsuario also. A tip is to include the file that defines this class, for example: require_once…
phpanswered Edson Horacio Junior 1,568 -
1
votes3
answers1431
viewsA: Page showing interrogation and bench showing accent?
You should check which ENCODING is using in HTML and the database, and making the necessary changes to use it ENCODING both of us. The most recommended currently is to use UTF-8 to prevent headaches…
-
2
votes2
answers69
viewsA: Merge a Feature with multiple commits over time into another project
Complementing the @Marcelfelipe response You can also use Cherry-pick with multiple commits if they are in order, for example, consider commits A - B - C - D, with older A and younger D: git…
gitanswered Edson Horacio Junior 1,568 -
2
votes2
answers69
viewsQ: Merge a Feature with multiple commits over time into another project
Has a Feature tenis with multiple commits over time, and need to merge this another project. Consider this time line: - x - tenisV1 - x - x - tenisV2 - x - tenisV3 - x - x - x - x - x - tenisV4 I…
gitasked Edson Horacio Junior 1,568 -
0
votes2
answers295
viewsA: Find out if smartphone (Android and iOS) has Automatic Time Zone enabled using ngCordova
I created a ngCordova plugin to solve this, currently only supports Android, because iOS does not programmatically provide the date and time settings of iPhone. How to use…
-
0
votes2
answers295
viewsQ: Find out if smartphone (Android and iOS) has Automatic Time Zone enabled using ngCordova
An Ionic v1 app needs to know if the smartphone (Android and iOS) has Automatic Time Zone enabled, I imagine this is done using ngCordova, how can I do this? For some actions in the app, I need to…
-
4
votes3
answers73
viewsA: Do you have any "parse" commands for jquery?
Use regular expression to remove anything other than numbers and virgula var teste = 'R$10,00'; teste = teste.replace(/[^0-9\,]/g, ''); Change vírgula for ponto and turn the value to float, so you…
-
10
votes2
answers7796
viewsQ: Use timestamp with or without Timezone in postgresql?
Use timestamp with or without Timezone in Postgres? The web application will be used in different countries, so I will have to deal with different time zones. The system has data entry from several…
-
1
votes1
answer68
viewsQ: DNS change used by a domain
I have an X domain that uses two NS, a master and another slave1, from the Equinix datacenter here in Brazil. I will change this domain to use other Amazon NS, how long does it take to take effect?…
-
3
votes4
answers1233
viewsA: What is the correct order to use the PHP header and ob_start functions?
The PHP documentation does not talk about or recommend anything about it. It is known that headers are sent when the first byte is sent to the browser, so for the sake of good practice, I recommend…
-
2
votes2
answers686
viewsA: Distinguish equal fields in a SELECT with LEFT JOIN
You will need to name these specific columns manually to be able to "pick them up" after the while. Example $sql = BD::conn()->prepare( "SELECT a.campo1, a.campo2, a.campo3, a.campo_igual as…
-
0
votes4
answers1114
viewsA: How to create multiple folders with mkdir
Your code had concatenation problems in the $pathNameX variables, I fixed and reused the variables for ease. <?php $nome_user = "Joaquim Sauro"; $tipo = "FGTS"; $categoria = "Abertura"; $pdf =…
phpanswered Edson Horacio Junior 1,568 -
1
votes1
answer74
viewsA: What makes a source code an easy to maintain code?
Some factors, such as: readability clear and objective comment outspoken among others There are several development methodologies that aim to facilitate maintenance and deliver other advantages, go…
-
9
votes4
answers2820
viewsA: What is the difference between "notice" and "Warning" in PHP?
A notice is a warning that means probably you shouldn’t be doing what you’re doing, but I’ll allow it anyway. A warning is a message stating that you is doing something wrong and it is likely that…
phpanswered Edson Horacio Junior 1,568 -
2
votes1
answer282
viewsA: Foreach multiplying results coming from the database (PHP/Wordpress)
Some of these tables you gave Jan is causing this duplicity, need to figure out what it is and use group by correctly. To find out, it is interesting you add in SELECT the primary key of each LEFT…
-
3
votes2
answers43
viewsA: Problem with '.data()' and its value within an if
When you compare something you need to use == or === (Strict comparison). The = is to assign value to some variable.
-
3
votes2
answers1172
viewsA: Postgresql changes letter with accent
This is because strtoupper failed to turn the accented letter to uppercase, in this case use the mb_strtoupper in place. $nome = mb_strtoupper($cliente->getNome(), 'UTF-8'); $cpf =…
-
0
votes1
answer50
viewsQ: What are the advantages of providing metadata when inserting object into S3 AWS?
In the AWS SDK for PHP v3 the method putObject receives several parameters, such as Contenttype, Contentencoding, etc. In its simplest form, I can insert an object only stating Bucket, Key and…
-
-1
votes1
answer297
viewsA: I cannot enable Opcache in PHP 5.6.30
I discovered that php was not reading php.ini that I was changed, which is very strange because there is no other php.ini in the entire system. To resolve, I created a symbolic link in the directory…
phpanswered Edson Horacio Junior 1,568 -
-1
votes1
answer297
viewsQ: I cannot enable Opcache in PHP 5.6.30
I am using Ubuntu 16.04 and I compiled PHP 5.6.30 using the --enable-opcache flag, even though it is not necessary in this version. In php.ini, I’ve already added lines…
phpasked Edson Horacio Junior 1,568 -
8
votes1
answer10928
viewsQ: What’s the difference between @Yield and @include on Laravel?
I’m learning Laravel 5.3, @yield and @include seem very much the same to me, the only difference I know is that @include injects the variables of father and may also include other variables. What’s…
-
2
votes3
answers105
viewsA: How to reuse this js in other elements
You are associating an anonymous Function to the element click event with id btn. The id is should be a single element on the page, there can’t be two or more elements with equal Ids, otherwise…
-
0
votes3
answers918
viewsA: How do I make the OPTIONS list of a SELECT transparent?
You need to make the background color of the option transparent too, example select option { background-color: x; } Once this is done, the white color of the option will be visible.…
-
11
votes2
answers239
viewsA: What could justify the jump of a number in a versioning system?
The vast majority of projects adopt this versioning pattern, which basically consists of (taken from the site itself): Given a MAJOR.MINOR.PATCH version number, increment the: Major (Major): when…
versioninganswered Edson Horacio Junior 1,568 -
2
votes4
answers366
viewsA: What’s the difference in using sprintf in relation to using variables within the string?
Visibility sprintf can facilitate understanding and improve visibility of a code snippet, take into account the examples below with small variables: // exemplo 1 $ch =…
phpanswered Edson Horacio Junior 1,568 -
8
votes2
answers413
viewsA: What is the difference between "memory_get_usage" and "memory_get_peak_usage"?
memory_get_usage is the amount of memory being used at that time. memory_get_peak_usage is the maximum amount of memory achieved during the entire execution of the script.…
phpanswered Edson Horacio Junior 1,568 -
2
votes1
answer517
viewsA: Fatal error: Call to a Member Function exec() on a non-object in
The way you’re wearing it Connection::exec($sql); it tries to execute a query on an object that does not exist, because you closed the connection up there, so you should only close the connection…
phpanswered Edson Horacio Junior 1,568 -
0
votes1
answer96
viewsA: Rules for Validation of Parameters established in PHP Database
Well, from what I understand your question is more conceptual than practical, you’re looking for the best way to make these validations. In structured programming, I would do the following: A…
phpanswered Edson Horacio Junior 1,568 -
2
votes2
answers124
viewsA: Is there any way to toggle with attributes in jQuery?
Just like toggle doesn’t, but it has the .attr() adding an attribute and the .removeAttr() that removes.…
jqueryanswered Edson Horacio Junior 1,568 -
1
votes3
answers1052
viewsA: Validation of MVC forms - PHP
Validation in the view is only used to avoid an "invalid" request, but this validation should not be trusted since the user can change it. The most reliable validation is done on the server, this…
-
0
votes2
answers1495
viewsA: Cannot use Object of type Pdostatement as array
$link is not an array to be handled the way you did, it is an object Pdostatement then you have to handle it differently. Try $link->fetchColumn(0), this is his documentation, this command will…
phpanswered Edson Horacio Junior 1,568 -
3
votes2
answers1401
viewsQ: How to mount a SELECT with ordered nonexistent numeric column
I want to make a SELECT with some existing columns in the database and add a ordered numerical column starting at 1 for each line (I don’t want the ID). I’m using Postgresql 8.4. Example: SELECT…
-
4
votes2
answers226
viewsA: Select checked on return
To do this, you need to return the selected value to the select page, suppose you return it in the variable $selecionado $selecionado = $_REQUEST['st']; On the page, you apply the following change…
-
0
votes2
answers409
viewsA: dynamic value inheritance of a child input (unordered list)
Just add in the if the condition to ignore the element itself being changed. PS: You were running the same selector 3 times, this has an unnecessary cost pro browser, I saved the result of this…
-
1
votes2
answers1020
viewsA: How does the pagination with PHP + AJAX occur?
In paging, the SELECT used in the bank needs to use LIMIT to indicate how many records it is to search for and OFFSET to tell you how many records to skip. On the link you posted doesn’t tell you…
-
1
votes3
answers719
viewsA: How to get tickets that were open in May?
Just add in the WHERE clause the condition to ignore "closed tickets", from what I saw in the comments, you said they are closed when state_id = 'closed' then just add state_id != 'closed' as below:…
-
5
votes3
answers1372
viewsA: How to not allow repeated INSERT by giving Reload on the page?
As @Inkeliz said, you can check if the record already exists before entering. Another thing I do and recommend is: after an insert, redirect to the listing of what was entered, for example, if a…
-
1
votes2
answers146
viewsA: View report separated by date groups
First you need to ensure that data is already sorted by date. According to your test array, we have the following array: $data = array( 0 => array( 'data' => '2015-02-05', 'refer' =>…
-
6
votes2
answers1363
viewsA: Submit from several sources with AJAX, one at a time
The button will no longer send the form, in place the jQuery will capture every time it is clicked. For this, add in the Buttons class the value bt_form <button class="btn btn-block btn-primary…
-
1
votes1
answer1924
viewsA: PHP Mysql: Comparing Data Between Two Tables
From what I understand is to display the dozens of hits of all games in a given contest, if that is the case you can filter the contest in SELECT $sql = "SELECT * FROM SORTEIO INNER JOIN JOGOS…
-
0
votes2
answers237
viewsA: Problem with codeigniter registration
Probably your PHP script is erroneously adding "redirect" as a select column, and that column does not exist in the table users in the database. Just you fix that part of the script that error will…
-
0
votes2
answers91
viewsA: Secure authentication between different systems
I know two ways to do this: using SSL in communication (more secure) implementing security measures yourself (in case you don’t know implement SSL and want to save time) Implementing security…
-
4
votes3
answers92
viewsA: Error in sql server
You can use % to indicate that you don’t care what comes after him. Note: To use this operator you need to use like Examples are: Search all lines where campo begins with 1234 SELECT * FROM tabela…
-
1
votes2
answers379
viewsA: Is it bad practice to overwrite declared variables as a function parameter?
No problem. Within a function, any value change in a variable normally passed $variavel, will only have effect within the context, which in this case is within that function. An occasion when it…