Posts by Rafael Salomão • 2,027 points
94 posts
-
0
votes3
answers38
viewsA: How to apply style to a group of selectors
$('div.mudar_cor').hover(function(){ $('div.vermelho').css('color','red'); }, function() { $('div.vermelho').css('color','black'); }); <script…
cssanswered Rafael Salomão 2,027 -
1
votes1
answer39
viewsA: HTACCESS gets GET, but prevents receiving POST
Your rule apparently is built wrong. RewriteRule ^([a-z0-9-]+)/?$ index.php?id_cotacao=$1 [NC,L] You are saying that any url that starts with characters that can contain azinho and Zezinho, numbers…
-
2
votes1
answer137
viewsA: Generate random emails
following by its array of clients... function gerarEmail() { let dominios= ['@gmail.com', '@outlook.com', '@bol.com.br'] for(var i=0;i<clientes.length;i++){ let label = clientes[i].nome.split('…
-
1
votes1
answer157
viewsA: How to customize htaccess-friendly url by passing only Slug as visible parameter?
It seems to me that your htaccess rule has a syntax error my friend. You did : Rewriterule /([[a-Z0-9-]+)/? $ text.php? id=$1 [NC] Is opening a [ without closing it, the right would be: RewriteRule…
htaccessanswered Rafael Salomão 2,027 -
0
votes1
answer136
viewsQ: How do I validate access to an API for only the licensed domain?
I’m looking for original ideas on how to validate access to a php API for only the domain that paid for the license, since SERVER['HTTP_REFERER'] unreliable. I created a json activation key and…
-
8
votes1
answer178
viewsQ: How to improve this: Hell callback?
I am finishing the development of an ad system, the system uses the redis server to save data and display campaigns directly from ram memory, since the pathology of these systems require a lot of…
-
1
votes4
answers3077
viewsA: How to prevent refresh after Ubmit on the same page?
The logical and easiest way would be to perform this post request with Ajax! What would keep the selection of fields as the user chose. But if you are submitting to the same page, you can access the…
-
1
votes1
answer54
viewsA: Direct via . htaccess a query string
I set up that rule: RewriteEngine on RewriteRule ^cliente([0-9]+).sistema.com.br$ http://www.sistema.com.br/acesso/$1 [P] I added ([0-9]+) any number from 0 to 9 can be one or more characters, then…
htaccessanswered Rafael Salomão 2,027 -
2
votes2
answers1174
viewsA: Change the color of a cell according to the value
I’ll have to invent names to help you because you didn’t post the sql code as the column names that return the database values. So I see your bow While Answer with the line numbers corresponding to…
-
1
votes1
answer57
viewsA: Similar rewriterule problems in htaccess URL
Your rule is not correct, you should mark the beginning using the character (^) and the end of the expression ($) as below: RewriteRule ^odata/entre-em-contato$ entre-em-contato.php [L] The…
-
1
votes1
answer84
viewsA: Error with serialize() + PHP function
I copied your code and tested, what’s wrong is you set the type of the element button as Submit, to perform an ajax request, the property should actually be set as BUTTON as below: <button…
-
3
votes1
answer41
viewsA: Url forwarding by company
If I understand correctly, you just need to add this rewrite to your htaccess: RewriteRule ^([a-z0-9]+)$ pastasistema/index.php?empresa=$1 [L] Any url starting with characters from ([a-Z0-9]+)…
-
2
votes1
answer44
viewsA: Difficulty choosing the correct Strings function
Every interaction of your loop foreach the variable $key will receive the index value of your array and the variable $value shall receive the amount contained. Then you need to check the first…
phpanswered Rafael Salomão 2,027 -
1
votes1
answer163
viewsA: Mount check box with values 1 and 0 angular
When you do this request by GET to get the checkbox value within the request’s Calback function is where you need to set the value to the field. The onchange event is only called when the user…
-
0
votes1
answer191
viewsA: PHP - While function
It is good to always assimilate the code with interpretive text so as not to confuse this beginning, in the case below: do = Faça While = Enquanto Create the new user and decrease the variable…
-
0
votes1
answer37
viewsA: Update the remainder of a table from the data contained in a row
I found it curious that it didn’t work, even though it was declared with two separate banks, in his question he did not make it clear whether he needs to do this by relating two tables in different…
-
1
votes1
answer328
viewsA: How to get value from a SQL in php?
Gustavo, I’m taking into consideration that your connection to the database is correct. There would be need of that loop While. <?php $buscaValorTotalSaldoInicial=$pdo->prepare('SELECT…
-
3
votes2
answers132
viewsA: How to do SEO in practice
None of the answers assigned below are absolute truth. All you asked depends on business rules of each search engine, are just everyday perceptions acquired day by day. Question 1: On a dynamic…
seoanswered Rafael Salomão 2,027 -
2
votes1
answer43
viewsA: doubts with Mysql somatorio
The question is a bit confusing, but if I understand correctly you want to add all the records contained in the table contamov correlating with the primary id of the table crecpa. In this case I…
-
2
votes1
answer3383
viewsA: SQL AS COMMAND
The sql AS command does not generate a new column. It only serves to create an alias (shortcut) for some attribute of your table or result of an expression in the querie. It is very useful when we…
databaseanswered Rafael Salomão 2,027 -
1
votes1
answer188
viewsA: Typeerror: $(...). tableToJSON is not a Function
Maybe you didn’t include the jquery or jquery.tabletojson.js on your page. Open your Developer console by pressing F12 on your browser, and make sure there are no JS loading errors. I set up a test…
-
0
votes2
answers1941
viewsA: Count lines with javascript
I will try to give an explanation for you to understand what you did, for your answers I believe you wrote but did not understand. The setTimeout will execute the code contained in its function,…
-
8
votes4
answers9952
viewsA: Error: Another git process seems to be running in this Repository
You need to try to delete the index.lock file on your .git directory. This problem occurs whenever you run two git commands simultaneously, maybe one from the command prompt and one from the IDE.…
-
7
votes2
answers3822
viewsA: Create my own Push mail server
Implementing Progressive Web APP on your domain. Requisítos Mínimo: The domain must be over https (ssl encryption). The domain must have a valid manifest file. The domain must pass a browser audit…
-
1
votes1
answer4213
viewsA: Read JSON file by Javascript
You will need to request your json using the object Xmlhttprequest thus below: var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 &&…
-
0
votes1
answer363
viewsA: Directing subdomain (htaccess) to Codeigniter
You need to go to your DNS configuration (cloudflare, register.br, godaddy, dynadot) and add an alias to your subdomain within the existing domain DNS configuration. Also, within the vhost…
codeigniteranswered Rafael Salomão 2,027 -
1
votes1
answer513
viewsA: Grouping Data Preferably-MYSQL
The solution we found was to do a subquery using the INNER JOIN filtering by state id and grouping by field marcas_id and then sorting the time table by marcas_id in external querie grouped by the…
-
5
votes1
answer8559
viewsA: What is the ajax error function for?
It serves so that if there is a request failure with the backend you have a scope of error handling allowing to provide feedback to the client interface. The function takes three arguments: Request…
-
1
votes3
answers381
viewsA: Uncheck all checkboxes by going back to the previous page
As you did not inform if you are using jquery as a framework in your project I am considering that yes, otherwise edit the code your needs <input type="checkbox" checked='true' class='check'…
-
1
votes1
answer104
viewsA: Detect if pwa has been added on desktop
If you want to detect opening by PWA could try this code in javascript that tries to detect if the site was opened in standalone mode. function isRunningStandalone() { return…
-
0
votes4
answers110
viewsA: message : "div is not defined"
Since you are including Jquery try this: $(document).ready(function(){ var div = $('#minha_div'); div.css( "display", "none" ); resto do seu código.... }); Remove your onload and try $(Document).…
javascriptanswered Rafael Salomão 2,027 -
0
votes1
answer699
viewsA: Read a php file
To better understand the problem, you can add a debugger to your code this way. <?php foreach(new DirectoryIterator('C:\xampp\htdocs\testtoclassificados\log') as $fileInfo){ echo "<pre>";…
phpanswered Rafael Salomão 2,027 -
0
votes1
answer93
viewsA: I changed the address of the http page to https and now it’s giving error
This error indicates that your page header has already been sent. Warning: Cannot Modify header information - headers already sent by (output Started at /home/akaua982/public_html/wp-config.php:1)…
-
1
votes1
answer258
viewsA: Error while removing table in Postgresql
The command su in bash is used for lifting as super user (root) and keep the user as administrator after executing the command. Already the command sudo bash runs the command as administrator then…
postgresqlanswered Rafael Salomão 2,027 -
2
votes1
answer114
viewsA: DOUBT About the use of SELECT and Standard Tables
The relationship you are trying to establish is not clear. If I understand correctly I believe that this is a 1:1 relationship between the tables. Then you could release an SQL this way: SELECT…
-
0
votes2
answers811
viewsA: Create barcode with imagecreate and html
You could use the html2ps is the solution I know to generate an image of your html. html2ps index.html index.ps convert index.ps index.png You will need to install on your server and run with exec…
phpanswered Rafael Salomão 2,027 -
0
votes2
answers941
viewsA: Error to log in to php site
Francene, check whitespace before opening your php. If this message is showing up indicates that the response header has already been sent to the browser, and therefore it is not possible to attach…
phpanswered Rafael Salomão 2,027 -
10
votes1
answer5004
viewsA: How to remove Input type="number" buttons
Locking by css. input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { /* display: none; <- Crashes Chrome on hover */ -webkit-appearance: none; margin: 0; /* <-- Apparently some…
-
1
votes3
answers978
viewsA: Form data is not being registered
Mariana, if you are sending javascript to the client’s browser it is necessary to send the correct header, in case before your echo do this : header('Content-Type: application/javascript'); if…
-
0
votes1
answer121
viewsA: How to print php variables inside a JS?
Follow these steps: First read your JS to a php variable, using the function: file_get_contents. $js = file_get_contents('caminho para seu js'); Inside your JS where you want to print the values…
-
0
votes1
answer139
viewsA: Error in the past
Gabriel, the user of eco_portaluserh does not have permission to execute the command ALTER, you need to run a GRANT using a user with permission level. thus: GRANT ALTER ON database.* TO…
-
1
votes1
answer1072
viewsA: How to configure my htaccess?
You must create your file .htaccess from /var/www or tb can create in subdirectories within the root stipulated in your httpd.conf <Directory /var/www/> Options Indexes FollowSymLinks…
apacheanswered Rafael Salomão 2,027 -
3
votes4
answers506
viewsA: Ajax, limit time even giving Reload on page
You need to call api/follow.php also in the onready of the page; ie while reloading the page it checks the status of time again and hides or not your button. VerificarSeguidores = function(){…
-
1
votes0
answers90
viewsQ: Asynchronous nature of nodejs, loop for com querie mysql
Inside an upload route in the nodejs I have it: router.post('/uploads',function(req,res){ //Omitido algumas instruções para melhorar o entendimento. InsereMidia = function(midia){…
-
0
votes1
answer67
viewsA: My SQL always adds 24 click to each access instead of 1
Just try it, without the while: <?php if (!empty($idcategoria)){ $guiacomercial_cliques=mysqli_query($con,"Select cliques FROM cliquesgc WHERE categoria =".$idcategoria); if…
-
4
votes1
answer88
viewsA: What’s wrong with my code?
You should clear the interval as soon as your condition is satisfied. Thus: var myVar = setInterval(function(){ // definir condição. if(n == 5){ // limpe o interval para parar a execução.…
javascriptanswered Rafael Salomão 2,027 -
1
votes1
answer886
viewsA: Error while restoring database using mysql folder
Please follow this at your own risk, I will not be responsible for further data loss! If the corrupted table is not important your file . ibd (ibdata) can be removed. In your case I noticed that…
-
0
votes1
answer50
viewsA: Select saved shows inputs through ID
Do it like this: When loading the page run an ajax by posting the id to a php script, then retrieve the id value in your php by the variable $_GET['id'], inside it make a select in the database…
-
1
votes1
answer211
viewsA: Problem with date.Timezone php.ini
To resolve this problem you need to check some settings: Follow to your home folder, which points to localhost and add this script: <?php phpinfo(); ?> Save the file as config.php then run in…
-
1
votes3
answers634
viewsA: How to read key and value from a json string?
Wouldn’t it be better to use json_decode, once it is in json format. Do so: $json_string…