Posts by RpgBoss • 957 points
57 posts
-
1
votes1
answer50
viewsA: Is there any way to verify this file?
See if that’s it: <?php $termo = "dast"; $ponteiro = fopen("nome.txt", "r"); $linha = fgets($ponteiro, 4096); if(strpos($linha,$termo) !== false){ echo "Econtrado"; }else{ echo "Não existe"; }…
-
0
votes1
answer53
viewsA: FILTER AND COLOR CSS
Tried to separate CSS for printing and page? CSS3: @media screen { pre{ color:blue; } } @media print { pre{ color:#000; } } Browsers without CSS3 support: <head> <link rel="stylesheet"…
-
1
votes2
answers92
viewsA: I can’t change the color of a div, I think I did something wrong that is preventing it (the div I speak is the .div_barra_search)
Color it is receiving, but it has no content inside it, so do not expand, you can set the size by CSS as in the example below: .div_barra_pesquisa{ display: inline-block; width:100px; //Largura…
-
2
votes3
answers827
views -
1
votes1
answer64
viewsA: I get ghost emails before the test email
I believe that when you open the page an email has already been sent, when you press send it sends a filled, thus totaling two. That’s why your IF is confused for the code, including because of this…
-
2
votes2
answers765
viewsA: Update PHP function every second
You will have to create a separate PHP (cpu.php): $load = sys_getloadavg(); echo $load[1]; In the header (HEAD) of HTML: <script> window.onload = cpuUsage(); function cpuUsage(){ var xhttp =…
-
-2
votes1
answer59
viewsA: Trouble finding the error!
In the code you posted said a key lock } at the end of the code to end the first function: var $K2 = jQuery.noConflict(); $K2(document).ready(function(){ // Generic function to get URL params passed…
javascriptanswered RpgBoss 957 -
3
votes3
answers1577
viewsA: Percentage mask
The logic works like this, taking into account that there are 3 users: If user A is adding value, it will have to add the existing value of B and C to see what is left for it. If it’s B, it’ll add…
-
1
votes1
answer2144
viewsA: Button to force Download without showing your way
You can make PHP pass the file to itself and change the header can make the download automatic: pdf.php In the attribute filename= you set the download name for the file that is different from the…
-
1
votes1
answer41
viewsA: Registrar Histórico
I did so in a very similar request: History with last accessed links The solution would be cookies, but if you won’t save anything on the server you can also use localStorage (Limited to 5Mbs). In…
-
0
votes2
answers323
viewsA: Prevent css changes with javascript
The staff may find strange, but I’ve been through it, in my case it was not change but capture this DIV join in the DOM when reading the whole body of HTML. I believe he wants to modify the content…
-
0
votes1
answer25
viewsA: Wanted to separate some data in php
There’s an error right at the beginning of the code: <?php if(isset($_GET['acao'])){?> That sign at the end ?> closes the PHP TAG, that is, what comes next will only become HTML text. To…
-
1
votes1
answer322
viewsA: Form does not direct to another page when using MPDF
Let’s see, even though your HTML form has 2 buttons submit should work. Your PHP is correct, what I understand is that PHP will change the header of Function.php for MIME-TYPE by the API itself,…
-
3
votes1
answer231
viewsA: Use of picture tag
You have written the content of the MEDIA attribute twice, it confuses the functioning: min-width:min-width:1440px Correct: min-width: 1440px I believe that the MEDIA attribute works equally CSS3,…
-
0
votes3
answers399
viewsQ: Capture Form - More Correct Way
Formerly I called a specific form per creation ID in the body of the document: document.forms[0] Only then did I understand what the attribute is for NAME in these cases, but I was in doubt, for…
-
2
votes1
answer2498
viewsA: Open link with another browser
I only know of one method that forces the user to use the default browser. On your site you will have to put javascript code that checks the browser used, if it is IE of any version will not do…
-
0
votes4
answers146
viewsA: Change button link according to an option
function trocarPagina(){ var f = document.forms['seguir'].turma || document.forms.seguir.turma var o = f.selectedIndex; console.log(o); if(o == "1"){ window.location.href =…
-
0
votes1
answer695
viewsA: OG image in several sizes
I did some tests and noticed that anywhere you share a link with Opengraph images should always have equal width and height, whether large or small. What can be done is to set the header to width…
-
0
votes3
answers1607
viewsA: Take the width of a text?
Look, I saw that using clientWidth you can get the size of the element where the text is: Element.clientWidth - Web Apis | MDN But you have to define with CSS the position with Fixed. var text; var…
-
0
votes2
answers271
viewsA: Undefined when trying to use the received valid JSON
Look, the data should be counted like this: Object.keys(data).length // retorna 2 Dice: Object.keys(data.dados).length // retorna 1 For simplicity you can do it like this: var tmp =…
-
1
votes2
answers1254
viewsA: Favicon not showing
I know you’ve explained the reason, but just to reinforce, each browser can operate in a different way, so there are TAGS correct for each this ranging from computers to smartphones. I searched and…
-
0
votes1
answer320
viewsA: Change the directory where the folder will be created
You are giving a path that only the servidor can access directly: **/var/www/**html/wordpress/wp-content/themes/busiprof/img or **/var/www/html/**wordpress/wp-content/themes/busiprof/img Probably…
-
0
votes2
answers47
viewsA: How to add values from several strings to another without this string losing its value?
Put an operator in front of that: str += alfa+i+","; I believe that part of the job can go after the for and not inside: res = codigos.concat(str);…
-
1
votes1
answer31
viewsA: Problems trying to list csv
The code is correct, I would do otherwise but the code would be too big. Is the server you’re running on your machine? Maybe it lacks part of the directory path (PATH), a level above probably does…
-
0
votes2
answers65
viewsA: What is Javascript Graphics?
Are Apis to generate graphs with statistics in a practical and fast way based on information you want to pass. They are great for community systems and download portals, or other purposes, just like…
javascriptanswered RpgBoss 957 -
0
votes1
answer47
viewsA: type radio with different names
There is no way, you have to give the same name to each, the name is the category of the item and not the value, the value is what PHP will receive, type, you what changes is the value. That is to…
-
0
votes1
answer116
viewsA: Error in PHP form I receive the form without the information
In the form change the method to POST: <?php mail("[email protected],[email protected],[email protected],[email protected],[email protected]","Assunto","Corpo"); ?> There are…
-
4
votes2
answers923
viewsA: Inside For (Explanation)
First of all I advise never user document.write. About For, it works as a listing, if you make a listing inside an item from another list this will end before. Through this example you will see the…
-
0
votes2
answers611
views -
3
votes3
answers197
viewsA: Why does parseint return Nan?
There is no attribute VALUEthen soon the function will not find, look in the console (F12 key) to see the error that causes. Replace with innerHTML: function aparecer() { const elemento1 =…
-
2
votes2
answers719
viewsA: How do you put this in the ascending order?
Put this before the foreach sort($new_data, SORT_NUMERIC); Reference (PHP4, 5 E7): PHP Sort…
-
1
votes1
answer429
viewsA: setInterval does not work properly
Edited So the difficulty is to restart the function by TIMER in javascript? If you try to use setTimeout: var tServ = <?php echo $rS; ?> + 3; function mudarHora() { var dt = new Date(); var…
-
1
votes1
answer472
viewsA: History with last accessed links
As far as I can remember window.history in modern browsers was restricted by security, as you said yourself, the solution would be cookies, but if you will not save anything on the server you can…
javascriptanswered RpgBoss 957 -
0
votes2
answers288
viewsA: How do I make iframe "clickable" anywhere on the page?
Unable to load the IFRAME before the page itself unless that page is dynamically generated by Javascript. Under IFRAME, you can use video embedding so it appears that the video is running directly…
-
1
votes1
answer231
viewsA: Php variable in meta tag
Look, from what I’ve seen you want to share the songs by the site’s own buttons, apparently this is going to be an Android app made in HTML5, it’s not necessary to follow the Title or Description,…
-
-1
votes4
answers9949
viewsA: Load image via javascript
Javascript function imageOption(){ document.getElementById("imageoption").src = "images/hyperx-option.png"; } HTML <body onload="imageOption()"> <img class="razer" id="imageoption" src=""…
-
1
votes3
answers1395
viewsA: Mandatory completion
From what I understand this your code you meant required to be completed by the user and not by PHP. So let’s understand the dynamically generated HTML options, even if they were static values. You…
-
0
votes2
answers550
viewsA: (javascript) Taking value from a very complex html structure
If you have the basis of this structure you can use document.getElementsByTagName('table') and then to select use brackets (e.g.: [0],1), and to find the TR in question repeat the process:…
-
0
votes2
answers705
viewsA: How can a javascript code update the server’s direct time?
The fact is that pulling in real time without reloading the page can lock the Script if the server in question falls, so I’ll show you how to order the date and time by PHP with AJAX and without the…
javascriptanswered RpgBoss 957 -
0
votes3
answers1959
viewsA: How do I restrict access from a page to logged in users?
At the beginning PHP code of the file Grupo de Estudos 2018 place the following condition: if($_SESSION['nivelSession'] != "2" || $_SESSION['nivelSession'] != 2){ /* Redirecionar usuários que não…
-
2
votes1
answer203
viewsA: Update images without the need to update the entire website
On improvements to the code I wouldn’t advise using document.write, because it will delete the site and keep only the photo, the best would be that each image had its own ID and you traded it for a…
javascriptanswered RpgBoss 957 -
1
votes2
answers703
viewsA: How to style elements within the <textarea> tag?
I’ve seen several systems of Syntax Highlighting that I understood that is the case, I could explain to you how to create your own, make the textarea become invisible by CSS and behind him having a…
-
0
votes1
answer69
viewsA: CACHE MANIFEST does not update files
I read part of the CACHE MANIFEST documentation and it seems to have many possible settings. But the most precise way I know is by manipulating conditions if you create a script like this inside the…
-
0
votes3
answers1236
viewsA: Is it possible to know which website my link was clicked on?
I will not know how to post a better solution than the ones mentioned below, but in a hosting that I have to know where the links come from in each place that I posted I put in the URL itself,…
-
-1
votes2
answers148
viewsA: Update in database table
Try to close the TAG input: $tabela1 .= '<td> <input type="checkbox" name= "Estado" value="Concluído"</td>'; Thus: $tabela1 .= '<td> <input type="checkbox" name= "Estado"…
-
0
votes3
answers2595
viewsA: Disable a select option by clicking a button
Change the type attribute from Submit to button and with onclick event call the JAVASCRIPT validator. I used pure Javascript because I don’t know if you are using any library. function…
-
1
votes7
answers4789
viewsA: Force input with a dot instead of an html comma
Look, if you’re working with pennies, you can use JQuery with that system: Jquery Mask Money Include both *.JS in the header of the HTML, then create the function that will check, it will not only…
-
0
votes2
answers124
viewsA: Registration form
User JAVASCRIPT, I will use an example form. I made a more simplified method, using a single BOLEAN variable to tell if there is an empty field or not. Making it TRUE (valid) by default and a…
-
4
votes2
answers345
viewsA: Error when using replace
Try to make the number a string: $(this).data('qtde').toString(); $(this).data('qtde').replace(/\./g, "");
-
1
votes1
answer505
viewsA: IPV4 only with PHP with ipv4/ipv6 link
I was able to figure out why some websites get IPV4 even using IPV6 at the same time and my hosting does not, the routes used may vary from the server where the PHP script was hosted, so there is…