Posts by Luis • 656 points
46 posts
-
1
votes0
answers24
viewsQ: Block right access to file called by Ajax function
I’m adding layers of protection to a small system I own in PHP. In the requests via ajax, for example, I use the following code below to prevent people directly access the files that are called via…
-
2
votes1
answer30
viewsQ: Query returning users who have a set of records from another table
I developed a small system in PHP and Mysql that aims to store and manage users and their respective courses. I searched some forums and pages in Google, but I did not find any information to help…
-
0
votes1
answer35
viewsQ: Optimize querie that returns the set of records of multiple tables
I have custom to use the following querie structure to return the amount of table records from my mysql database: SELECT (SELECT COUNT(tab1_codigo) FROM tabela1 where alguma coisa) AS total1,…
-
2
votes1
answer51
viewsA: Event change of select within Modal ceases to function after reopening it
Barter $( "#idDivModal1 #campo_pagamento" ).change(function() for $('body').on('change', "#idDivModal1 #campo_pagamento", function()
-
0
votes1
answer51
viewsQ: Event change of select within Modal ceases to function after reopening it
I have a select inside a modal window that displays or hides an input field according to the option selected by the user. Example: if option=1, it shows the input. if option=2, it hides the input.…
-
1
votes1
answer43
viewsQ: How to use require/include inside the repeat loop?
What is the most appropriate way to return the dynamic content of a PHP script, loaded via include within a loop? Below are more details: pagina1.php -> returns the name of the companies…
-
1
votes1
answer491
viewsQ: Mysql query using INNER JOIN with HAVING
I have two tables in Mysql. The first table curriculo has as ID cur_codigo. The second table envio possesses env_codigo as ID and env_curriculo as a foreign key to cur_codigo. The table envios…
-
-1
votes1
answer61
viewsQ: Error Javascript Code When Using Keyup Event
I am using the keyup event to call a javascript function, and thus format the typed content within my input. However, it does not work properly as expected. The idea is: put only the first letter in…
-
0
votes0
answers26
viewsQ: How to disable Google Chrome input autocomplete
I am aware that there are already other questions like this one here in the community. However, I realized that the solutions pointed out are no longer working. And it makes sense, because the…
-
0
votes1
answer71
viewsQ: Display Mysql search results according to the sequence shown in the in clause
How do I sort the results of a query as a sequence displayed in the In clause? That is, the order of the lines must respect the same order of values indicated in this clause. Example: sql = select…
-
2
votes4
answers134
viewsQ: Mysql query involving Profession and Note information registered in the same column
Consider a table with the following structure: the column contract code corresponds to a foreign key from another table. It is a contract code. Each contract has basically 4 records in this table in…
-
-2
votes1
answer31
viewsQ: Get domain name dynamically in htaccess file
I have a. htaccess file with several instructions. I would like to make it more dynamic, that is, make it more optimized for other sites without having to edit it. Lines like the ones mentioned…
-
0
votes0
answers37
viewsQ: Questions with IP function
I use the following function below to search the user’s IP, regardless of the type of connection or device it uses. function get_client_ip() { $ipaddress = ''; if ( isset( $_SERVER[ 'HTTP_CLIENT_IP'…
-
-2
votes1
answer76
viewsQ: Running PHP commands saved in Mysql
I would like to know how to save and execute PHP code saved in my Mysql database. I have already created a basic structure for registering instructions. My question is about how to manipulate the…
-
0
votes1
answer54
viewsQ: Saving PHP code saved in Mysql
What is the best way to save small PHP codes in the Mysql database, so that they could be viewed eventually, along with texts saved in HTML in the database?
-
1
votes2
answers611
viewsQ: Updating multiple Mysql lines and fields
I built a Mysql Query in order to update a field in several rows of my Mysql table. It was as follows: update produtos set (nome) = case codigo when 5 then 'teste 1' when 6 then 'teste 2' when 7…
-
1
votes3
answers80
viewsQ: Doubt about instructions that can be implemented in Hibernate
Technical Course Test Question of Java Programming Language: What instructions can be used in Hibernate? a- JDBC b- JPA c-SQL d- JNDI…
-
0
votes0
answers66
viewsQ: Doubt about JSP page by calling
If I consider that an application has run a JSP page through the call http://localhost:8080/application/list.processes Which of the alternatives is correct? a - Pode existir um servlet acessando um…
-
-1
votes1
answer48
viewsQ: Considering a BD that is based on ODBC, what is the function of the JDBC in this case?
What is the purpose of JDBC in a comic based on ODBC?
-
1
votes1
answer16
viewsQ: Restarting indexes for each new client
I need help from you. I have a small system that allows the registration of companies, and each one can contain one or more members. See a summary of the tables: //Tabela Empresa emp_codigo (chave…
-
0
votes1
answer438
viewsQ: How to include a PHP variable inside a saved text in Mysql
I am trying to insert PHP variables inside a text that is saved in my Mysql, so that they are automatically read in my application. First, I will explain my reality: Printing page: <?php…
-
1
votes1
answer91
viewsQ: Error with Arraylist data display
While recovering data from an arraylist by means of the "for" command, it displays the following message: Note: I could not identify where the error is. What do you think is wrong? package…
-
0
votes1
answer76
viewsQ: Doubt with algorithm and vector
help me solve the following algorithm. In this case, it is a vector of 20 positions. My doubt is what values would be stored in vector A? for (i=1, A[0]=1; i< A.lenght; i++) A[i] = A[i-1]*2;…
-
2
votes2
answers691
viewsQ: Problems capturing input when opening modal
I am trying to capture the value of a modal input as soon as it is opened. I did it as follows, but it did not work: $('#modal').on('show.bs.modal', function (e) { var var_tipo =…
-
0
votes2
answers123
viewsQ: How to generate search result shortcode for a PHP system in a PHP page?
I have a PHP system that does some registration and data listing. To explain what I would like to implement, I will simulate some codes below: $conexao = mysqli_connect(localhost, root, 123456,…
-
0
votes3
answers249
viewsQ: Disable button in modal window using Jquery
I have a modal window with a button, and I would like it to be disabled when pressing the button (a tag), and present "Wait..." Look at my code: //#idDivModal4 -> modal //.btn-enviar-lembrete…
-
0
votes2
answers838
viewsQ: Problems with Modal Bootstrap and Deletion of Records
I have a page with n records and, for each of them, there is their respective Delete button. By pressing it, a modal bootstrap is opened by asking whether or not to confirm the action. When…
-
5
votes2
answers1846
viewsQ: Open dynamic button modal pressed via ajax
I’m having trouble opening a modal by means of a button dynamically pressed via ajax. The following jquery code below opens the modal normally, considering that the button to be clicked was not…
-
1
votes2
answers624
viewsQ: Submit form using modal bootstrap
I’m trying to submit a form contained in modal boostrap, but I don’t know how to perform this action. Look down at my code: Pagina Principal: <div id="idDivModal4" class="modal fade"> <div…
-
0
votes1
answer56
viewsQ: Working with arrays and conditions
I have three arrays received via POST: [campo_habilita] => Array ( [0] => Habilitado [1] => Habilitado [2] => Habilitado ) [campo_nome] => Array ( [0] => Nome 1 [1] => Nome 2…
-
0
votes2
answers87
viewsQ: Div disabling jquery find next element
Friends, I have the following question: The following code below locates the next element from the select clicked: https://jsfiddle.net/cmftasor/ Works perfectly. The problem is that by including…
-
1
votes0
answers54
viewsQ: Button returned via ajax does not work
Friends, I have a question about data recovery through ajax requests. I usually use ajax for data search. The problem arose when I decided to search for elements of type button and checkbox, as I…
-
3
votes1
answer615
viewsQ: Default date to maturity - PHP
I’ve researched this issue here at the portal, and although there are similar questions, I haven’t found anything in the sense I need. On google also found nothing that exactly assists in my…
-
1
votes2
answers235
viewsQ: Limit 1 line in queries with primary key queries
One of the best practices on optimization of Mysql queries, dictated in an internet source, says that it is important to limit as 1 the queries that already display only one line. For example, if…
-
1
votes1
answer87
viewsQ: Optimizing a Mysql table with 40 fields
Hello, people! I have a table in Mysql with 40 fields, it is a system of resumes. I am optimizing both the table and the queries performed in PHP. The point is that to perform searches for specific…
-
2
votes0
answers72
viewsQ: Should fields in the order by clause be indexed?
I’m reading a lot about using indexes in Mysql. I noted that it is really necessary to know how to use it at the right time and in the appropriate columns in order to make the queries faster and not…
-
3
votes2
answers485
views -
2
votes1
answer203
viewsQ: Indexes in primary key columns
I know that each case is a case, and that there are no ready-made rules on the creation of indexes. In my case, considering that the primary key of each table of my bank is used in wheres of my bank…
-
2
votes1
answer29
viewsQ: Searching Array of variables via Ajax and inserting in their due inputs of a form
I have a form that searches and fills, via ajax, the name of the person and year of birth (in their respective fields), all this from the Cpf typed by the user. It’s something like this: Digite o…
-
1
votes0
answers50
viewsQ: How to make separate sorts in tables with Left Join?
I need the following help from you. First, see below my current query: sq1 = mysqli($conexao,"select * from tabela1 TBL1 left join tabela2 TBL2 ON TBL1.codigo=TBL2.codigoestrangeiro LEFT JOIN…
-
2
votes2
answers115
viewsQ: Converting two Mysql selects to one
I have a little doubt about Mysql. I have the following Mysql query: sq1 = mysqli($conexao,"select * from tabela1"); $tr1 = mysqli_num_rows($sq1); Then I make the famous bow: for…
-
1
votes1
answer401
viewsQ: Sript PHP with secure connection on all pages
I developed a small system in PHP that performs the registration of resumes. Host at Hostgator. On the contracted plan, I am entitled to a free Private SSL, so I requested the installation of the…
-
0
votes1
answer93
viewsQ: Form destination page via GET with custom link
I have a form that sends data via GET, forwarding the data to the page busca2.php, as shown below: <form action = "busca2.php" method = "GET" id="formulario"> When submitting the form, the…
-
4
votes2
answers713
viewsQ: Question about data loading via Modal Bootstrap
Hello, friends. Once again I need your help. I am migrating my small system to Bootstrap. I am implementing modal windows in various parts of the system. I believe that one of the advantages of the…
-
1
votes2
answers2246
viewsA: Delete record from Modal Bootstrap window
Do it this way: <a class="btn btn-primary delete" id="<?php echo $codigoform;?>">Apagar experiência</a> Note that I removed the call from the modal through button. And by jquery,…
-
0
votes1
answer30
viewsQ: Updating session ID for added security
for me to keep my session data more secure, I can update the session id on each page by staying as follows: if (!isset($_SESSION)) { session_start(); session_regenerate_id(); } This will overload…