Posts by KhaosDoctor • 2,699 points
108 posts
-
0
votes2
answers66
viewsA: Function with internal call
You can include a System of a direct event in the element without having to include the attribute onclick in HTML as follows: let play let elemento = document.getElementById('button') function…
javascriptanswered KhaosDoctor 2,699 -
0
votes1
answer77
viewsA: How do I get the parent div of that element e.target
Try with e.target.parentElement or e.target.parentNode
-
1
votes1
answer154
viewsA: How is the process of installing the letsencrypt.org certificate on Linux on Apache servers?
Come on: How certificates are generated Let’s Encrypt has a Certification Authority (CA) that signs the certificates generated by the installed Agents on the machines being validated. This CA is…
-
3
votes1
answer11899
viewsA: How to use PHP in Vscode?
Vscode is not an IDE like Phpstorm, so you don’t natively have how to put server data and other facilities that Phpstorm natively gave you. What I do is to have my Vscode with the most recommended…
-
0
votes2
answers875
viewsA: How to update another page that is open in PHP, javascript or jquery
Unfortunately this is not possible if you did not open the tab. The way to update the page would be through a window.location.reload() in Javascript. However, the control of tabs is completely in…
-
0
votes2
answers981
viewsA: PHP/Mysql - Switching from localhost to online hosting
First you need to hire a hosting service. Once she’s been hired then you’ll need to take your files from the site and move up the hosting storage (this is usually done via FTP if you don’t use Git).…
-
0
votes2
answers62
viewsA: WHERE SQL functions
This is an option, as you did not give many details about your architecture or how are your tables, I used generic names: select * from ( select r.username, count(w.registros) as contagem from…
-
1
votes1
answer69
viewsA: Send email after upload is complete?
You have to put all this code here: let destinatario = '[email protected]'; let ass = 'teste com anexo'; let email = 'Teste com anexo'; let mailOptios = { from: usuario, //usuário está definido mais…
-
1
votes2
answers51
viewsA: Problem with fadeOut from jQuery!
You are calling the wrong callback in the wrong window event, try the same as this fiddle here (I made some simple modifications to not use URL): https://jsfiddle.net/5t014jy0/…
-
3
votes1
answer848
viewsA: Processing status in Ajax calls (jquery)
There is a way that makes more or less what you want but could not be used in jQuery. See, jQuery is actually an abstraction of a lot of Javascript functions to make the language simpler and easier…
-
2
votes1
answer108
viewsA: Is it possible to request android applications via the web with php?
Unfortunately it is not possible, this because you are working with a completely different system than a mobile system. What you can do is emulate the android in an application in the OS, within…
-
2
votes1
answer284
viewsA: How to make machine translations?
For angular, there is a plugin called angular-Translate which is excellent and is very fast for what he intends to do. But there are easy modes yes, besides these plugins, there is a specification…
-
0
votes1
answer53
viewsA: Banking integration
Yes it is possible to integrate Access in PHP through PDO, just a connectionString correct. But you can also use CI. See this answer to have a basis of how to configure the connection inside it.…
-
2
votes2
answers312
viewsA: Would it be possible to make a project in html, css, js, and run on a native like android?
Yes, there are what we call hybrid applications. They can be created using frameworks such as React Native, the Ionic or the Nativescript. Some as I’ve said do little more than create a Webview and…
-
3
votes2
answers225
viewsA: Quit my internship and removed me as a collaborator, I lost all my commits in my history
I’m afraid I don’t... As you said yourself, the repository is private, so if you’ve been removed from it, github disregards all your contributions to it. However, you can keep contributing open…
-
4
votes1
answer113
viewsA: Error closing php tag
You forgot to lock the key to the if: <?php require_once('db.class.php'); $usuarios = $_POST['usuario']; $email = $_POST['email']; $senha = md5($_POST['senha']); $objDB= new db(); $link=…
phpanswered KhaosDoctor 2,699 -
0
votes2
answers579
viewsA: How to make Curl between containers?
You will need to use the link, your Docker-Compose only has a container set, I will put an example of a database connection for you to get an idea: version: '2' services: server-front: image:…
-
2
votes1
answer404
viewsA: How to return PHP code with Javascript?
You should reset the button and only after the return of PHP should it be available again. Try it like this: <a href="" onclick="getPhpAjax();" class="text-none"> <button type="button"…
-
1
votes1
answer144
viewsA: Error downloading branch in git
When you clone a project and are switching branches, you can only use git checkout <branch> without needing the -t, because git automatically fetches references and manages tracking. If this…
-
0
votes2
answers630
viewsA: Remove double quotes in codeigniter query Builder
Codeigniter has a second parameter in the Builder query to prevent word escape, see this link with the documentation, but in short you can use something like this: $this->db->select('campo',…
-
2
votes2
answers90
viewsA: problems submitting form
Look, in PHP will not make the slightest difference as you call the select, even because you are doing a post with the data of this form. If you take a look at the fiddle below, basically I…
-
6
votes2
answers2425
viewsA: What is a state machine?
A state machine is a computer science term describing a computer program. If you think about it, a system is a set of states, for example, in the sequence of Fibonacci we have the sum of the last…
-
5
votes1
answer2900
viewsA: What is BLOB in javascript?
Blob is the definition for Binary Large Object, youtube streams binary data in real time, so there is no physical file that is served in the video. With a data stream the video is processed and sent…
-
0
votes1
answer307
viewsA: Css error in Sass
table border-collapse: collapse border-spacing: 0 There’s a space missing here: table border-collapse: collapse border-spacing: 0
-
0
votes1
answer42
viewsA: Domain Forwarding/Mapping
Well, first you need to have a domain that would be meu-sistema.com.br with the type of steering /empresa/1 functioning normally. Once this is done, you can create Canonical Names (or CNAMES) for…
-
2
votes1
answer337
viewsA: What is the most appropriate way to instantiate a database in an MVC standard
Yes, it’s good practice, including this model is a standard known as DAO (Data Access Object), not in its entirety, but what you did there has many characteristics of it. Some considerations of what…
-
2
votes1
answer145
viewsA: Doubt about Mongodb’s relational Schema
To set the ID to an existing value you can do it in two ways. The first is to explicitly declare the _id in his model: const SurveySchema = new Schema({ _id: Number, name: String, pages: [ //um…
mongodbanswered KhaosDoctor 2,699 -
0
votes1
answer444
viewsA: Exists "Require Once" in Javascript/Jquery
This depends on your environment, if you’re using jQuery in webbrowser (for example for a website), you can take a look at plugins like Browserify that make more or less the model of the require…
-
-1
votes3
answers868
viewsA: Run javascript only when accessing a mobile phone’s website
Yes, this is a good way because it does not depend on the screen size, but I believe you can use directly in the condition without having to generate a variable. <script>…
-
2
votes1
answer966
viewsA: Show HTML via PHP or not?
To be honest, neither is good practice. Both do basically the same thing, the performance gain is not so great as to justify this. But the ideal is not to use that kind of approach... If you want to…
-
1
votes2
answers1089
viewsA: Filter with Jquery, Json and Input
Well, I’ll give you a generic example here with a JSON more or less the way you want it. In jQuery, there is a function called grep (same as linux) that serves to filter arrays, since a JSON is an…
-
1
votes1
answer71
viewsA: Form does not perform update
Assuming you have already verified that the page exists. The Submit button needs to be inside the form <?php $id = $_GET['id']; $conexao = mysqli_connect('', '', '', ''); if(!$conexao){ echo…
phpanswered KhaosDoctor 2,699 -
0
votes1
answer253
viewsA: Master detail table, totalizing fields
Whatever, in fact, you can get this sum with a SUM and bring the already chewed data to the application, this gains a little in the performance and ease of programming, since the complexity to…
-
0
votes1
answer202
viewsA: ORACLE RANK() function
Well it seems that your Jay is wrong, you are uniting music, bands and artists and bands, but you are only doing Jay between the bands and the artists, but the songs are nowhere in the Where clause.…
-
3
votes1
answer174
viewsA: Problem with history back java script
When you use the history.back() the behavior is similar to clicking the return button of the browser, why it asks you to confirm the resubmission of the form. If you want to go back to page 1 you…
javascriptanswered KhaosDoctor 2,699 -
2
votes1
answer118
viewsA: Initialize server.js IONIC 1 to run in "production"
Do the following: In his package.json look up the section scripts Add this line (if any replace) scripts: { "start": "ionic serve && nodemon server.js" //Outros scripts aqui abaixo } Ai then…
-
0
votes4
answers724
viewsA: Logical doubt: How to find out if an hour is between the hours interval (independent of the day)
Well, this case is a little simpler if you fix a model of hours, if you are using the model of 24hrs (that the clock starts at 00h and goes until 23h) there just you just count the hours, let’s…
-
6
votes1
answer255
viewsA: How does function pointer work in PHP?
With PHP pointer arithmetic is a bit obscure for developers, precisely for this reason it is a higher level language. It is only possible to reference PHP functions using 3 methods: Functions…
-
2
votes1
answer1927
viewsA: How to post with Request Payload
You need to send a JSON to Habbo’s website, because that’s what it expects of you: $data = json_encode(['email'=>$email, 'password'=>$pass]); curl_setopt($ch, CURLOPT_POSTFIELDS, $data); And…
phpanswered KhaosDoctor 2,699 -
2
votes1
answer72
viewsA: Javascript to delete
No, he can’t erase things from websites and social networks. What you see on the screen is actually a manipulation of what is already downloaded on your computer. You can even delete and change the…
javascriptanswered KhaosDoctor 2,699 -
1
votes1
answer138
viewsA: Javascript Runtime Exception
The mistake ERR_FILE_NOT_FOUND, actually, it is not a JS error, but rather an error that the browser plays so that Voce can debug your code more easily, for this reason Voce will never be able to…
-
1
votes1
answer13921
viewsA: change text of div with jquery
Well, first of all, you can’t have two elements with the same ID on the page, it’s not good practice. Change your input ID to something different valorInput, or use a class. You can use jQuery’s…
-
1
votes1
answer161
viewsA: Include data in Json beyond what comes via Mysql
Basically you can do like this: $emparray = array(); while($row =mysqli_fetch_assoc($result)) { $emparray[] = $row; } $emparray['site'] = 'www.com.br'; $emparray['autor'] = 'Pedro'; echo…
-
3
votes1
answer2475
viewsA: Is there a reliable way to test the internet connection?
There is no "right way", although the use of network interfaces can be really useful and valid, it is not 100% reliable, since it is possible that network interfaces vary from user to user. What I…
-
9
votes1
answer7482
viewsA: What’s the expressjs for?
Express.js is a Node framework that can be compared to Laravel for PHP, it creates route abstractions, middleware and many other functions to facilitate the creation of both API’s and SPA’s. A cool…
-
3
votes2
answers163
viewsA: Convert Switch to IF
I will put the answer, but I make it clear that this IS NOT RECOMMENDED, the switch is much more readable and makes better use of memory than the statements if/else. That said, the following block:…
-
1
votes1
answer46
viewsA: Saving users in BD
I’ll give you a tip of recent experience. I had to do the same thing you’re doing now with Linkedin on a legacy system. I recommend the second option, that is, create a new table where the primary…
-
0
votes1
answer504
viewsA: How do I make a conditional formatting on my php page?
Do so. At the beginning of your page, where you render PHP create an associative array of values and colors: <?php $color = array( 'Inicio' => '#cor1', 'metade' => '#cor2', 'fim' =>…
-
2
votes1
answer236
viewsA: How to see the amount of results with PDO
One of the ways I would use to do this count without affecting the records would be with FETCH_ASSOC. Try to do so instead of FETCH_NUM use $login->fetch(PDO::FETCH_ASSOC); and assign to $result.…
-
1
votes1
answer76
viewsA: Avoid "nervous finger" switch button change
Try using these functions here: $(function() { $('.switch').on('change', function(){ $(this).toggleClass('checked'); var input = $(this).find('input'); input.attr('disabled', true); //desativa o…