Posts by Woton Sampaio • 1,461 points
103 posts
-
0
votes2
answers78
viewsA: Problem with Login
Change the login form, do so: $query = "SELECT * FROM `Cadastro` WHERE usuario = '$usuario' AND senha = '$senha' "; if($con->query($query)->fetch_all()){ //Usuário existe echo 'Existe'; }else{…
-
0
votes1
answer50
viewsA: Mysql query with AJAX
If it’s just to check if the user exists, just do this: $tLogin = $_POST["tLogin"]; $tSenha = $_POST["tSenha"]; //Conectando ao banco de dados $con = new mysqli("localhost", "root", "root",…
-
0
votes3
answers3185
viewsA: How to connect my android application to an external database
First of all, you will need a connection class, I use this in my projects with help with php: public class Conexao { public static String postDados(String urlUsuario, String parametrosUsuario) { URL…
-
1
votes1
answer42
viewsQ: References to several Edittext
It is possible to reference several elements at one time? Ex: An array with all tags and another with Edittext: public class Main extends AppCompatActivity { String[] tags = {"edit1", "edit2",…
androidasked Woton Sampaio 1,461 -
2
votes2
answers54
viewsA: Change array structure in php
I think I have a better way to organize this, because I think the way you want it will be very complex to work with the array, but as the preference is yours, here is the code: $entrada = array(…
phpanswered Woton Sampaio 1,461 -
1
votes2
answers64
viewsA: Is it possible in PHP to recover part of a string using the same notation as Python?
In php you do so: $texto= 'Uma frase qualquer!'; //O primeiro parâmetro é de onde começa, o outro é onde termina echo substr($texto, 0, 10); It is also possible to do: echo substr($texto, -10);…
-
1
votes2
answers248
viewsQ: Call method by class or by instance?
What would be the most correct way to call a method of another class? It is more correct to create the object: private MinhaClasse minhaclasse; minhaclasse = new MinhaClasse(); To then call a…
-
-1
votes1
answer46
viewsA: How to put a specific variable in Session
Try to make a constant: session_start(); define("nome", "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]"); $_SESSION['url'] = nome;
phpanswered Woton Sampaio 1,461 -
0
votes1
answer41
viewsA: <select> in php
Take a look, I used bootstrap and jquery: <!DOCTYPE HTML> <html lang="pt-br"> <head> <meta charset="UTF-8"> <title>Twitter clone</title> <!-- jquery - link cdn…
phpanswered Woton Sampaio 1,461 -
0
votes1
answer918
viewsA: How do I take the value of a checkbox selected on mainActivity3 and 4 and display this selected item in a textView in main Activity1?
To get the checkbox value, you check if it is checked and assign a reference value, e.g.: [x] Beer: String valores; if(cerveja.isChecked()){ valores += "1"; } If you have another check you add the…
androidanswered Woton Sampaio 1,461 -
1
votes1
answer48
viewsA: Change site color with jquery
About js not changing the source code on the console I can’t help you, but about changing the color with jquery just assign a class equal to all elements you want to change color and do this:…
jqueryanswered Woton Sampaio 1,461 -
0
votes1
answer282
viewsA: Return the last Array date
Just take the size of the array, its size is the index of its last value var t = data.list.length; console.log(data.list[t].date); I think that solves But if you want to take the last date and not…
-
0
votes2
answers177
viewsA: Create combo with names within input value
Try this: <label for=""><h5><strong>Colaborador</strong></h5></label> <select name="Colaborador" required> <option></option> <?php…
-
-1
votes3
answers785
viewsA: PHP result on the same screen
Do it like this bro: <?php if(isset($_POST['valor']) && isset($_POST['txmensal']) && isset($_POST['periodo']) ){ $v = $_POST['valor']; $tm = $_POST['txmensal']; $p =…
-
1
votes1
answer277
viewsA: How to print the result of a php function from another page?
Put the html page together with the php file and do this: <?php //função para gerar respostas echo $CODNOME; if($_POST['CODNOME'] == "001"){ $msg = "mensagem1"; } else if($_POST['CODNOME'] ==…
-
1
votes2
answers526
viewsA: Connect class database
Do so: <?php class Perguntas { //Deixando a variável $mysli publica, ela pode ser acessada por qualquer um, //caso queira que ela seja acessada apenas na class, você pode deixa-lá como //private.…
phpanswered Woton Sampaio 1,461 -
3
votes1
answer155
viewsA: findViewById(2131230729) what are these numbers?
When you reference with the findViewById(), and put R.id.input, that id is a whole, all ids of its application take the reference of the id by a whole. This reference comes from the R.java, That’s…
-
1
votes2
answers526
viewsA: Sent String in PHP page to another HTML page
Includes the file on your page and calls the variable or whatever it is, ex the placeholder the input text: <!DOCTYPE html> <html> <head> <title> </title> </head>…
phpanswered Woton Sampaio 1,461 -
1
votes1
answer320
viewsA: Operation of the die() function
No, it cannot replace the Return, the Return is the answer about what happened inside the function, because in home of exception you must treat it where called the function, an example is when…
phpanswered Woton Sampaio 1,461 -
1
votes1
answer72
viewsA: Asynctask result
Simplest form: Create a connection name class as follows: public class Conexao { public static String postDados(String urlUsuario, String parametrosUsuario) { URL url; HttpURLConnection connection =…
-
4
votes3
answers376
viewsA: NSA Challenge - "Thirteen men and a shipment"
$max = 1000; while ($max > 0) { if($max%11 == 0 && ($max-5)%12 == 0 && ($max-3)%13 == 0){ echo $max; } $max--; }
-
1
votes2
answers1841
viewsA: How to send java post information to a php page?
To send and receive data create this class in your project: public class Conexao { public static String postDados(String urlUsuario, String parametrosUsuario) { URL url; HttpURLConnection connection…
-
0
votes2
answers66
viewsA: Help with Multi Array
Database: PHP: <?php $mysqli = new mysqli("localhost", "root", "", "teste"); $meuArray = array(); //Add dados: $i = 0; if ($sth = $mysqli->query("SELECT * FROM Categorias")){ while ($row =…
-
0
votes1
answer187
viewsA: (PHP MYSQL)
Come on, to divide you need the initial and final hour, it’s always being one bigger than the other. <?php $hora_inicial = strtotime("10:00:00"); $hora_final = strtotime("14:00:00"); $intervalo =…
-
2
votes1
answer55
viewsA: Enable content after a date
In php you can check when opening the page: <?php //Data atual $date = date('Y-m-d'); if($date >= suadata){ // não faz nada; }else{ //O die vai fazer o script morrer se a data for menor que a…
-
0
votes1
answer106
viewsA: Store data on the device
In my projects I create an initial Activity with start name, in it I check if there is something saved in the cellular memory to do the automatic login, note my example: public class start extends…
-
0
votes1
answer53
viewsA: HOW TO IMPLEMENT THIS FIXED TAB BETWEEN ACTIVITIES?
You will need to use tabs, look at the example below: No build.Radle: dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile…
-
0
votes3
answers1812
viewsA: Pick up part of a URL with PHP Explode
The explode will turn $url_cod into an array, to pick up what is before just put: $parte_url = $url_cod[1]; //Ou [0] para oque vem antes For the '&' you use the same system Or if you want to get…
phpanswered Woton Sampaio 1,461 -
0
votes0
answers41
viewsQ: Load Fragments on part of the screen?
I wonder if it is possible to type a tablayout system only in part of the screen. ex: Where green, blue and orange are the buttons of the Tabs, and the red part would be the loaded Fragment, so by…
-
1
votes2
answers146
viewsA: Remove accent on search using android searchview
Do it like this: @Override public boolean onCreateOptionsMenu(Menu menu) { MenuInflater menuInflater = getMenuInflater(); menuInflater.inflate(R.menu.busca, menu); MenuItem menuItem =…
-
1
votes0
answers52
viewsQ: Routine with Firebase
It is possible to set up a routine for a firebase database? In hosting websites and dbs we usually have the option to leave a php file or other, for example, that every x hours run your script, I…
firebaseasked Woton Sampaio 1,461 -
2
votes0
answers86
viewsQ: Precision Radius - Googlemaps
It is possible to identify when the radius of precision is small? In the examples below when I open the application it is very far from my location, with a very large radius, in the next the radius…
-
0
votes2
answers974
viewsQ: How to capture date value with Datepicker
I have a Datepicker in my project and would like to know how to get the value of the chosen date after selecting it. I know that on the calendar: calendarView.setOnDateChangeListener(new…
-
3
votes2
answers64
viewsA: PHP variable problem with pelicas
Do it: <?php $cota = '946.9"1968/1975" AMA Ant'; echo "<input type='text' value='" . $cota . "'/>";
-
0
votes1
answer1050
viewsQ: Adjust image inside button
Does anyone know how to adjust the image to the size of the button without it being cropped? Button: <Button android:id="@+id/funcionario" android:layout_width="fill_parent"…
-
3
votes1
answer79
viewsA: Start an Activity from an item in the bottom navigation (menu bar)
Statement: AHBottomNavigationViewPager viewPagerBottom; AHBottomNavigation bottomNavigation; To start on the chosen Fragment do this on Oncreate or where it has already identified the items:…
-
1
votes1
answer71
viewsA: How to list BD query
I see my example in db: Code: <?php $mysqli = new mysqli("host", "user", "senha", "db"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n", mysqli_connect_error()); exit(); } $count =…
-
0
votes1
answer177
viewsA: Query works in phpmyadmin, but does not work in PHP
Look, I did it like this: On the bench: In php code: <?php $mysqli = new mysqli("host", "user", "password", "db"); $id_post = 1; $check_in = strtotime('2018-02-12') ; $check_out =…
-
0
votes2
answers39
viewsA: Mysql Query with multiple tables
It does so, in the main table you have the user id, in the other tables you make a field with the name idcli, at the time of Insert, this idcli gets the user id of the main table, then to recover…
-
0
votes1
answer39
viewsA: Make calls through an icon on the website by the webwiew of the app
Add to Manifest: <uses-permission android:name="android.permission.CALL_PHONE" /> In the code do: ligar.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) {…
androidanswered Woton Sampaio 1,461 -
0
votes1
answer327
viewsA: php, bring multiple rows from one linked table to another single id table
From what I understand, you want to search the data with the same id as the other table, is that right? If it is you can use: <?php $mysqli = new mysqli("host", "user", "password", "db"); if…
-
-1
votes1
answer57
viewsA: How to Insert an indeterminate amount of users into an SQL Database?
If you want when the person fills it create a new table with specific fields you do: <?php $mysqli = new mysqli("host", "user", "password", "db"); if (mysqli_connect_errno()) { printf("Connect…
-
0
votes3
answers864
viewsA: Search two Mysql tables and select rows with a common element
I didn’t quite understand your question, but in php I would do so <?php $mysqli = new mysqli("host", "user", "password", "db"); if (mysqli_connect_errno()) { printf("Connect failed: %s\n",…
-
1
votes3
answers1395
viewsA: Mandatory completion
Make the logic that if it is empty or does not contain the expected data, show the message asking to fill in. If it’s Html5 you can use <input type="text" name="nome_do_campo" required>…
-
0
votes0
answers589
viewsQ: How to pass data from Activity to Fragment
I’ve seen some posts about but I couldn’t figure out how to pass a string from one activity for a fragment I got the main: public class MainActivity extends AppCompatActivity implements…
-
0
votes1
answer42
viewsA: PHP constructor does not identify variable value
RESOLVED -> <?php require_once('usuarios.v.php'); class User extends Usuarios{ public function __construct($conta){ include 'identifica.php'; parent::__construct($conta); } }…
-
0
votes1
answer42
viewsQ: PHP constructor does not identify variable value
Could someone tell me why in "Parent::__Construct('$bill');", if I put a variable there it does not identify it? I tried anyway, it only works if I type the name of the table, this $account comes…
-
1
votes1
answer73
viewsQ: How to check if there was an error in the POST
I need to check if there was any error in the reply of onPostExecute or gave time out on the server, because sometimes it gives some error in the process and this method does not even start, as I…
-
0
votes2
answers927
viewsA: Android Studio does not recognize images
Take a look at the format of the image, maybe they can be in a format that the android studio can not read, always try to use . png, to change the format you can use photoshop or any other program…
-
0
votes3
answers48
viewsA: How to store which Navigation Drawe item I selected
Put a variable that when you click on such an item it takes such value, eg: clicked on item 1 the variable arrow 1, then you make the app save this data in localstorage, when it opens again load the…