Posts by Samuel Fontebasso • 938 points
37 posts
-
1
votes2
answers110
viewsA: List Files by Extension - PHP
After validation of @Anderson Carlos Woss in a comment on your question, the problem you are facing should be mitigated by paying attention to the following points: Your text editor creates files in…
phpanswered Samuel Fontebasso 938 -
1
votes1
answer387
viewsA: Problems with table linkage in the Standard
The foreign key data format must be equal to the external value (primary key) which is related. It is common for the user table primary key (blog.users.id) to be created using the method…
-
2
votes1
answer73
viewsA: Problem when using query
The most important thing to note in the error message: Access denied for user '[meu usuario]'@'192.168.1.1' (using password: YES) This error indicates that the user in question is not allowed to…
-
1
votes1
answer169
viewsA: How to enable PHP utf8_decode
Install the module php5.6-xml and restart the Apache: sudo apt-get install php5.6-xml sudo service apache2 restart If the problem persists, try enabling the module xml2enc: sudo a2enmod xml2enc…
-
2
votes1
answer69
viewsA: Update page when entering data in database
You are trying to achieve a goal through an inappropriate path, when a message is sent, the script that is loaded is only to the user who sent the message (the request is only from a user). When you…
-
3
votes1
answer168
viewsQ: Access token storages (JWT token)
I am facing the need to store the access token of a user who logged in through a method with Oauth2, this JWT token will be used for my frontend application, written in React, make calls to an API…
-
1
votes1
answer54
viewsA: Product quantity increasing as you update the page
At the beginning of your code $idProduto exist in the session you are incrementing it, just remove it. Of if(!isset($_SESSION['itens'][$idProduto])) { $_SESSION['itens'][$idProduto] = 1; }else {…
-
1
votes2
answers571
viewsA: How to convert jpg images to webp using php?
You can use Imagemagick with PHP for this task, but native webp support may not be ready. To ensure this install the library libwebp-dev, on Ubuntu: sudo apt install libwebp-dev Compiling…
-
0
votes1
answer66
viewsA: Dynamic checkbox with Ajax and PHP
On the client side (browser) it is with Javascript that you can trigger new web requests and then run another PHP script that updates the information in your database. Introduction to AJAX is a good…
-
0
votes1
answer243
viewsA: Login system with error
session_start() should always be the first thing to run in your application, if it runs after or is duplicated, this error will appear. Erase that: // Se a sessуo nуo existir, inicia uma if…
-
0
votes1
answer892
viewsA: Take data from bank and compare CODEIGNITER
To have the result in a row the method is the result and not row Change that line: $data = $query->row(); To: $data = $query->result(); Complete code: public function loginUsuario($usuario,…
-
1
votes1
answer46
viewsA: How to use several sites in Ubuntu Dedicated Server?
To host multiple applications on a server you need to configure Virtualhosts on Apache. With this, you have a website in each folder and points each of the domains to a different Directoryroot.…
-
1
votes1
answer142
viewsQ: Insert in Mariadb giving timeout
What are the reasons that the simple Insert described below would take so long that it even gives timeout on the server? INSERT INTO wkvmk_postmeta (post_id, meta_key, meta_value) VALUES(904,…
-
1
votes1
answer1032
viewsA: C# Windows Forms - Getting the ID of a Logged-in User
Believing that the page that has to register the car is the MenuEmpresa pass user login which is the variable empresa per parameter at the time of constructing the object MenuEmpresa: In the login…
-
2
votes3
answers399
viewsA: Transforming DD/MM/YY into PHP timestamp
http://php.net/manual/en/function.strtotime.php $timestamp = strtotime('12/25/17'); Notice that I reversed the position of the day and month, is the reversed North American standard of being. And to…
-
1
votes2
answers850
viewsA: webservice php+json
It is on the way, but deviated at the time of creating the JSON that is sending.. To encode something in JSON with PHP you must pass an array as parameter. Change the first lines for this, test and…
-
2
votes1
answer32
viewsA: Line changes color when value is false
It’s not very stylish, but you can put an ngClass in each column (td) on a ternary condition. <tbody> <tr *ngFor="let user of users" > <td [ngClass]="user.active == false ? 'bg-gray'…
-
4
votes1
answer770
viewsQ: How to remove a page from Ionic 2 / 3 navigation
In a hybrid application with Ionic 3 I have 3 pages that are part of the process of buying a product. The process is as follows: The user is in the cart and click on "Choose payment method" In case…
-
3
votes1
answer648
viewsA: Alternatives to Firebase FCM?
Two good options: https://aws.amazon.com/pt/sns/ https://onesignal.com/ Currently I use Onesignal, it is free and has no limit of access to resources or amount of notifications…
-
0
votes1
answer256
viewsA: How to call a class within a function
The library’s Utmz class Jflight/Gacookie needs to be instantiated and needs a string that represents the Google Analytics cookie to boot. I don’t know the context that is using this library, but…
phpanswered Samuel Fontebasso 938 -
2
votes1
answer1205
viewsA: Passing a variable in a modal bootstrap
Assign a class to your edit link and an attribute with the user id, when a click happens you recover the associated user id that element that was clicked and does what you want, I mean, make an AJAX…
-
0
votes1
answer34
viewsA: Submit form with event when checking radio buton bootflap
If your radio button is "overwritten" after the page has finished loading and you want it to be so, or there is no easy change, assign the click event to the element that is "above" of your radio…
-
2
votes3
answers1776
viewsA: Deselect radio type input
Only the function to enable/disable the first "radio input" $(function() { var check1 = 0; $('input[name=isgift]').click(function() { if($('#isgift1').is(':checked')){ check1 = 0; } if…
-
0
votes1
answer149
viewsA: Optimize Codeigniter code
If this is inside a controller then it’s not very good. What would I do: 1º - Create a model to deal with the bank (maybe already do this): application/models/Acordo_Model.php defined('BASEPATH') OR…
-
2
votes1
answer151
viewsA: error while trying to download file in codeigniter 3
Validate if your . htaccess is configured and working. It should direct calls to index.php, but if accessing an existing file it should not direct to the index. Ensure that the lines below exist in…
-
2
votes1
answer254
viewsA: How to set up PHP FTP - Help
To access a server in the middle of the connection use the library phpseclib. However, this way you will not be able to use the native FTP functions of PHP, you will have to work as if you were on a…
-
2
votes1
answer89
viewsA: Tricky problem
Try this code: #include <iostream> using namespace std; void imprimeRecursivo(int numero, int final) { if(final <= numero) { for (int i = numero; i >= final; i--) { cout << i; }…
c++answered Samuel Fontebasso 938 -
1
votes2
answers658
viewsA: Check return ajax, works only the first time
Some good practices I defined as my rules with AJAX: Always send data through an object no matter the type of request (GET/POST/PUT...) Always work with JSON data return With just these two items,…
-
1
votes1
answer3976
viewsA: Error in Wordpres JQMIGRATE: Migrate is installed, version 1.4.1
It is not an error, it is information that Wordpress is using jQuery’s migration script to ensure compatibility with previous versions. See the answer to this question:…
-
1
votes1
answer14
viewsA: How to have appwidgets in apphibrium?
To have access to any native feature of a hybrid app you need a plugin. How to create your own plugins: https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/ List of Cordova plugins:…
-
1
votes1
answer5430
viewsA: Run Curl command in an HTML/JS application
These are some steps that go from frontend to backend: First you need the PHP script that makes the request for the API of this third party let’s call it chat.php and assume that you are staying…
-
3
votes3
answers1086
viewsA: Storing an attribute’s value in a variable in jquery
Try this: $(function(){ $('a.nav').click(function(){ var classes = $(this).find('i').attr('class'); var classe = classes.charAt(0); }); }); However, this does not solve if the name of the class you…
-
1
votes1
answer191
viewsA: Passing parameters via AJAX
You are concatenating a variable that does not exist (email): window.location.href = "ConfirmacaoCadastro.jsp?email="+email; Declare the email variable with the email id input value: success:…
-
0
votes2
answers1041
viewsA: How to optimize plot calculation on "broken" values
Register in the database 3 decimal places, then use the function number_format to round to 2 decimal places when recovering the database values before summing. Run this example and see: $parcela =…
-
0
votes1
answer153
viewsA: How to configure multiple systems in a domain?
Each system with its own subdomain and a VirtualHost for each one: <VirtualHost *:80> ServerAdmin [email protected] ServerName sistema1.meusite.com.br DocumentRoot…
-
4
votes1
answer1496
viewsA: How to make an Alert in php
Send parameters with query string to index.html and in index add the Alert script. <?php unset ($_SESSION['login']); unset ($_SESSION['senha']);…
phpanswered Samuel Fontebasso 938 -
1
votes1
answer853
viewsA: Insert information into bank with AJAX
Apparently the request to your script has been made successfully, but it is returning a different result from 1. Change the url and pass the data through the attribute data and use the method POST…