Posts by Frederico Moreira • 189 points
34 posts
-
-2
votes1
answer19
viewsQ: List and count results that repeat within an array
I have the following table ID| nome | Tipo 1 | Teste, João, Maria | Indicação 2 | Teste, Maria, José | Projeto de Lei 3 | Maria, José, João, Teste | Indicação 4 | Maria, João, José | Denúncia I…
-
0
votes1
answer74
viewsA: Build dynamic menu with PHP
I managed to arrive at the result that I hoped creating a new function to generate the submenus, this way it was like this: <?php $items = array ( 1 => array ( 'parent' => '0', 'tit_pag'…
-
-3
votes1
answer74
viewsQ: Build dynamic menu with PHP
I’m trying to dynamically assemble a menu with submenus with data coming from a database table, but I couldn’t get a result that worked. I have this code to create the menu and submenu on another…
-
-3
votes1
answer179
viewsQ: Check whether person is of legal age, if yes delete it
I need to make a query in MYSQL database to verify if a user is of age based on their date of birth compared to the current date. If yes the user should be deleted from the database.
-
1
votes1
answer46
viewsQ: Include CSS class via jQuery when checking CPF
I have the following code of a form that when leaving the CPF field is made the validation of the CPF. I would like if the test is unsuccessful to include the "has-error" class in the div where the…
-
0
votes1
answer32
viewsQ: Disable paging link if already on the corresponding page
I have the code below and wanted to add the class disabled when the user is on the page he clicked on. For example: if the user clicks on page 3 the link on page 3 would have the class disabled so…
phpasked Frederico Moreira 189 -
1
votes1
answer519
viewsQ: CSS Effect: Floating label in Form does not work without required attribute
I’m using the floating effect on a form to move the label when the user clicks input or select. The problem is that the resource only works if the attribute required is present. This is a problem…
-
1
votes2
answers730
viewsA: Check URL from Document.referrer
It was enough to put: if (!ref){ ref = 'site.com.br'; } That worked
javascriptanswered Frederico Moreira 189 -
0
votes2
answers730
viewsQ: Check URL from Document.referrer
I have the following situation. When the user accesses the site: www.site.com.br I check if there is the sc=2 parameter at the end of the URL, if there is he can access the site, if there is no it…
javascriptasked Frederico Moreira 189 -
0
votes0
answers120
viewsQ: Search via GET does not return results correctly
I’m having a problem with a GET search. I have the following code: <?php //envio o charset para evitar problemas com acentos header("Content-Type: text/html; charset=UTF-8"); include_once…
-
2
votes1
answer21
viewsA: Script does not save full word if it has accent
I found the mistake. The page where the form was with charset=iso-8859-1 I switched to UTF-8 And it worked
-
0
votes1
answer21
viewsQ: Script does not save full word if it has accent
I have a script that works very well on my Dashboard, but I put it on another page and is not working. When a word has accent, eg: "Natalia" the system is saving in bd only "Nat" excluding the rest…
-
3
votes1
answer226
viewsQ: Exchange %20 for + in GET search
When I do a search via GET through a form the url looks like this: test.com.br? search.php? q=Phrase%20what%20am%20searching I’d like to keep it that way: test.com.br? search.php? q=Phrase+what+am…
-
0
votes1
answer114
viewsQ: Sort query by Mysqli relevance
how the query below could be ordered by relevance and then by date? $query = $mysqli->prepare( "SELECT `id`, `titulo`, `foto`, `descricao`, `slug`, `data`, '' as `local` FROM `noticias` WHERE…
-
1
votes1
answer298
viewsQ: Search and display of results 2 tables mysqli/php
I wanted to do a search in 2 tables (news and photos) and then display the results of this query below. But the fields I have in each table are different and I’m not able to elaborate a way to…
-
1
votes4
answers1201
viewsQ: Check for parameter in javascript URL
I have a URL that may or may not contain parameters in it. Ex: www.site.com.br/?id=1 or www.site.com.br. I need to check if there is a parameter in this URL and with that I can add one more at the…
-
0
votes2
answers570
viewsA: Save data in Localstorage and then check if it exists in another page
It worked when I did it this way: if($(myEmail == singleMail)){ if(approved == true && categoria == 'PLF'){ // Cria um item "Prof_AMC" com o e-mail do usuário…
-
0
votes2
answers570
viewsQ: Save data in Localstorage and then check if it exists in another page
Good afternoon person. I need to save a data in Localstorage and then check if this value exists on another page, I tried here but it didn’t work. First I define the value of the "variable" Prof_amc…
-
1
votes1
answer401
viewsA: Create Slug across MYSQL database
This is how I did it. I created a file and put it on the server. <?php include "chama_bd.php"; $query = $mysqli->prepare("SELECT `titulo`, `id` FROM `noticias`"); $query->execute(); $slug=…
-
0
votes1
answer401
viewsQ: Create Slug across MYSQL database
I have an older MYSQL database and in it I have a news table and I needed to create a "Slug" column to save Slug from the news. Therefore, I would like to create an automatic Slug for all records…
-
1
votes1
answer235
viewsQ: Return previous page by adding parameter in URL - Javascript
Good afternoon, people, I’m racking my brain here and I couldn’t find a solution. What I need is this. If a user accesses a url for ex: www.site.com.br/produto it should be redirected to another…
javascriptasked Frederico Moreira 189 -
1
votes1
answer445
viewsQ: Cron command without using password to access MYSQL database
Good personal day, lately I’ve been receiving warnings related to a cron I created on 1 site to update certain data from a mysql database table. The error is as follows: Warning: Using a password on…
-
0
votes0
answers235
viewsQ: Create thumbnails of multiple images in one folder at once
Good afternoon guys, I need to create thumbnails of all images contained in a certain folder and save inside a Thumb folder Ex: "Photos" folder with multiple JPG images If the Thumb folder does not…
-
1
votes1
answer114
viewsQ: Problems padding CSS MENU
I have a small aesthetic problem in 1 dropdown menu. The problem is this, I increase the padding in CSS (bottom and top) and the change only occurs in the last "li" menu. I have tried several times…
-
0
votes3
answers411
viewsQ: Pick last element attribute date from a list
Good morning guys, I’m riding a sisteminha that by clicking a button I add a <li> in the last record of the line, but each <li> has a data-id numerical for differentiation, i.e., I would…
-
0
votes2
answers2173
viewsQ: Pick data-attribute from a selected option by clicking on button
I wish that by clicking the button I could pull the value and data-dado of the selected option. I tried with the code below, but it didn’t work: $("#botaoexemplo").on("click", function() { var valor…
-
0
votes1
answer368
viewsA: Grafico google Analytics en Dashboard administrativo
After much struggle and research I managed to solve, in case someone else needs I made the following command: <?php // Carrega a biblioteca do Google API PHP. require_once __DIR__ .…
-
0
votes1
answer368
viewsQ: Grafico google Analytics en Dashboard administrativo
Good afternoon, you guys. I’m breaking my head to pull some data from google Analytics and play on an administrative Dashboard so that the customer can track the accesses to your site. I’ve been all…
-
0
votes3
answers149
viewsQ: Find a certain number inside a mysql string
Good morning, everyone. I’m having a question I can’t seem to solve. In a given table of a BD I have a column that saves a string as follows: 1,2,3,4,5 Line 1 11,22,33,44,55 Line 2 Now I need to do…
-
0
votes1
answer119
viewsA: Dismember variable, taking part of the text
I managed to make it work in the following way in case someone else has the same problem: <?php $string = $ativos_u; //aqui eu pego string vinda do BD $array = explode(',', $string); //aqui…
-
2
votes3
answers1645
viewsQ: Search Database By Selecting Select Options
good morning. I have a little problem I’m having trouble solving. The situation is as follows: I have 2 selects (State and city), I would like that when selecting a state the system did a search in…
-
0
votes1
answer119
viewsQ: Dismember variable, taking part of the text
I have a multiple select that saves the following format in the database: 1-Azul,2-Verde,3-Vermelho,4-Preto,5-Branco Now I need to dismember this variable to show the result, but I need to remove…
-
1
votes1
answer84
viewsQ: MYSQLI error with _GET attribute - Fatal error: Call to a Member Function error() on a non-object in
I got a problem and I don’t know how to fix it. I am using MYSQLI to query a database using GET to get the name of the table where the query should be made. BD connection code: $hostbd =…
-
0
votes0
answers33
viewsQ: Create thumbnail with Plupload
I’m trying to create thumbnails while uploading images using Plupload but without success, saving the thumbnails in one folder and the real images in another. I found this link in English that says…