Posts by Jorge B. • 11,427 points
255 posts
-
3
votes2
answers180
viewsA: Addition of multiple items
The problem is you’re using the same name for all check boxes. You should use name different, or a array. Example with array: <select name="categorias[]"> And then you can go category by…
-
3
votes1
answer513
viewsA: php does not recognize the file field
Because it’s not $_POST['anexo_msg'] and yes $_FILES['anexo_msg'] and to see what’s inside you can make a var_dump($_FILES['anexo_msg']). To see the file fields you can do so: $file_name =…
-
4
votes1
answer631
viewsA: Read a string with scanf()
Just ensure that when one appears \n he stops reading: while((scanf("%c", &caract) == 1) && ((caract >= '0') && (caract <= '9')) && caract != '\n') Ah for the…
-
3
votes3
answers403
viewsA: Only first row of table being displayed!
To use all the data you see from the Database you have to print it in all the iterations of the while, that is, while there are lines coming from the Database you print the table lines in HTML. echo…
-
2
votes1
answer287
viewsA: Isn’t it right to connect the database only once and then go through the records?
Yes, the correct thing would be to establish the connection only once. Just don’t put the connection in the constructor and do the part. Or as @chambelix said, use the bd variable as Static. And in…
-
3
votes2
answers786
viewsA: Dynamically assemble URL parameters
You can do it with a simple GET: $categoria = $_GET['_categoria']; $cor = $_GET['_cor']; $tamanho = $_GET['_tamanho']; then just check that the fields are filled in: $url = "Location:…
-
5
votes2
answers699
viewsQ: How to send a SOAP in C?
How do I send a C SOAP? I have a Web Service that consumes SOAP and have to send that SOAP in C. How can I do that? Is there an API or I have to create a library?
-
2
votes3
answers154
viewsA: Optimization of PHP functions for database querys
I don’t use PDO, use mysqli_ but anyway it is an optimization of a generic insertion or update function: /** * Insere dados numa tabela. * * @param string $table nome da tabela * @param array $data…
-
2
votes1
answer66
viewsQ: How to fetch a file from an internal server?
I have a server running at home where I keep some files. I wanted to have on my page, which is on an external server, a way to fetch these files. Does anyone know how I can do this in PHP?
-
2
votes2
answers1526
viewsA: Hidden fields appear/are modified with a select Multiple
You can use a simple Javascript to do what you want. To do that you can do the Submit from the form, to the page itself, whenever you change your select as follows: <form id='formId'…
-
3
votes1
answer299
viewsA: How to leave navigational arrow centered on flexslider
If you change the bottom of 15px for 150px you get the desired effect: .flex-direction-nav { position: absolute; right: 0px; bottom: 150px; <---------------------AQUI…
-
2
votes2
answers2981
viewsA: "Undefined variable" error
Your problem is in the variable $id that is assigned after it is already being used in SQL. If you change places, you’ll figure it out that problem: $id = $_GET['id']; $sql = "SELECT * FROM cliente…
-
2
votes1
answer344
viewsA: Grid System Bootstrap
What I did was put a row in each image+text set of the last set of images: <div class="col-xs-4"> <div class="row"> <!-- Adicionei esta div para juntar imagem e texto --> <div…
-
3
votes3
answers12679
viewsA: How to change the color of the boot via code on android?
You can change the color of the button like this: Button botao = (Button) findViewById(R.id.botao); botao.setBackgroundResource(R.color.Red); The color has to be in the…
-
3
votes1
answer316
viewsQ: How to delete cookies from a website?
I have a website http://www.meusite.com which creates several cookies with different domains such as: http://tracker.meusite.com and http://w3.meusite.com. How can I do in Javascript to delete the…
javascriptasked Jorge B. 11,427 -
11
votes2
answers55591
viewsA: Limit html input
To limit the input the numbers just change the type of text for number: <form action="#"> <input type="number" name="Dia" min="1" max="31"> <input type="submit"> </form>…
-
3
votes1
answer999
viewsA: Round up instalment values for the first instalment
Just divide 200 by 3 that gives 66.67, remove the decimal part, is then 66. And then add to one of the parcels the rest of the division 200 by 3. Basic example: <?php $value = 200; $prest = 3;…
-
2
votes3
answers98
views -
7
votes2
answers518
viewsA: Data Structure - C Double Chained List
I don’t understand why you don’t use the aux (penultimate) which is the percorre->ant, which in turn will be the new last on the list. while(percorre -> prox != NULL) { aux = percorre;…
-
4
votes1
answer767
viewsA: Create and manipulate multidimensional associative array
If the idea is to have a list of Cars it’s easier to create a Car or Vehicle object with the attributes you need, for example: class Carro { private String nome; private int portas; private String…
-
5
votes2
answers137
viewsA: Error in my C Program
This program is correct. What is wrong is the way AP thinks. The while(nValoresLidos == 0) that is to say: As the scanf not read, in this case, a %d gives reading error! For example if you type:…
-
7
votes1
answer1796
viewsA: Change the value of a vector in a function
You got some wrong things in that code: You need to initialize the character map before using it; You cannot assign a string to a character; char map[][1] = "gabriel"; Code: #include <stdio.h>…
-
1
votes2
answers85
viewsA: Problems with Insert in an Android project in Java
The problem is on line 42 of RepositorioUsuario in function salvar: long id = db.insert(NOME_TABELA, "", valores); Because if you don’t initialize the database, it’s not enough to declare it:…
-
11
votes3
answers4136
viewsA: Program does not read scanf
I found several errors in this code: lacks the #include <time.h>; has exhaust characters \ in the middle of printf; cannot use '10' there in the array since '10' is 2 characters; Be careful…
-
16
votes2
answers1963
viewsA: What is the purpose of the free() function?
The function void free(void *ptr) serves to free memory previously allocated by functions calloc, malloc, or realloc. It shall be used in all cases where the use of a previously allocated memory…
-
2
votes2
answers164
viewsA: My Sessionhandler does not allow me to log in
I decided to put a condition if($data=='') return false; Bruno’s Sessionhandler in case the data is empty: public function write( $id, $data ) { $query = sprintf( 'INSERT INTO %s (id, data) VALUES…
-
1
votes1
answer1106
viewsA: Change "Character" and "collation" settings
That’s very simple, just change the Character and collate of your server 2 database: ALTER DATABASE tua_Base_de_Dados DEFAULT CHARACTER SET latin1 COLLATE=latin1_swedish_ci; And as you say in this…
-
2
votes1
answer106
viewsA: Insertion of PDF
If your idea is to get the file name like this $new_texto = strip_tags(trim($_POST['new_texto'])); does not work because it is a file. Should you or enjoy the $nome instead of $new_texto: $new_texto…
-
29
votes1
answer12710
viewsQ: How to read from stdin in C?
How should I read characters, digits and strings stdin? getchar; fgetc; fgets; getc; scanf; I’m here trying to read from the console and there’s always something wrong with reading it. I have tried…
-
1
votes2
answers194
viewsQ: Segmentation fault: Linked lists in C
I’m playing a little C here and I found that in the second insertion I do through the console that the lista loses the first pointer(pointer) created in the first insertion creating a Segmentation…
-
3
votes2
answers4172
viewsA: Read comma-separated file data in C
Here’s a little explanation in the code of how to do. #include <string.h> #include <stdio.h> struct Eletro { //os teus campos }; struct Eletro eletro[100]; int main() { const char s[2] =…
-
2
votes2
answers164
viewsQ: My Sessionhandler does not allow me to log in
I’m using this sessionHandler as my sessionHandler. The problem is that since I am using it I cannot initialize/close the session. index php. include_once( 'sessionHandler.php' ); $sessionHandler =…
-
3
votes1
answer1628
viewsA: Spinner with states and cities?
Just create table (Sqlite) with states and other with cities, interconnected by a foreign key and the respective clear objects. Of course we should already have the states and cities already…
-
3
votes1
answer140
viewsA: Nullpointerexception on login screen
The problem is on this line: Intent intent = new Intent(this, PrincipalActivity.class) Like you’re not inside a Activity, then the this ends up being your object Dao and not the context of Activity…
-
2
votes2
answers83
viewsA: Networkonmainthreadexception error
This exception occurs, as I said very well, when trying to do an operation on the Thread main. You have to run your code in a AsyncTask: class RetrieveFeedTask extends AsyncTask<String, Void,…
-
0
votes2
answers77
viewsA: Print array in a file
That’s because you’re recording out of cycle for, just tape in: $base_hndl = new SQLite3($dir.$base); $requete = "SELECT * FROM contact ORDER BY id desc"; $resultat = $base_hndl->query($requete);…
-
0
votes1
answer75
viewsA: ICS file (Icalendar)
The fact of storing in the downloads and not in the root has to do with the configuration of your browser and not with PHP. For the part of the download with link it’s easy to just put a reference…
-
18
votes4
answers2486
viewsA: How to make this arrow in CSS
You can do it with CSS with two shapes, a rectangle and a triangle. And so you can put the size you want of the arrow. #triangle-right { width: 0; height: 0; border-top: 50px solid transparent; /*…
-
2
votes3
answers365
viewsA: How to use multiple $_GET in PHP through a URL
Just make a condition with the use of the function isset that checks that the variable is defined and is not null. if(isset($_GET['c'])) echo "<div class='campo1'>" . $_GET['c'] .…
-
1
votes2
answers89
viewsA: Text comparison
What you have to do is remove all spaces or points from TWO strings: $var1 = str_replace(".", "", $var1); $var1 = str_replace(" ", "", $var1); $var2 = str_replace(".", "", $var2); $var2 =…
-
1
votes1
answer685
viewsA: ADB Eclipse error
Try doing these steps: Closes the Eclipse Ends the adb.exe process in Task Manager (Windows). At the command line goes the folder of the Android SDK and the directory platform-tools . Run the…
-
0
votes2
answers372
views -
2
votes1
answer2014
viewsA: super.onBackPressed() or Finish()?
When you call super.onBackPressed() at all times within the onBackPressed() means that you are assuming the default behavior of the button back of the device, i.e., "back up" that terminates the…
-
5
votes2
answers959
viewsA: How to compare the value of a Hashmap<key, value> with a variable?
It doesn’t work because you have to start Iterator again because in the second while the Iterator is at the end of HashMap: //quero printar se a nota do aluno é maior que a média, mas não funciona…
-
1
votes1
answer1135
viewsA: Listview with checkbox, select all and none button
Just create a layout with checkbox and put it before the list. And by clicking on this checkbox by all checkbox to true in your MyCustomAdapter: novacheckbox.onclick() { int item=0; while ( item…
-
0
votes1
answer201
viewsA: Make Listview background color invisible when using scrollbar
You have to have it in your XML LisvView the parameter: android:listSelector="@android:color/transparent" and also the parameter: android:cacheColorHint="@android:color/transparent"…
-
5
votes1
answer2360
viewsA: Sqlite relationship between tables
The problem is you’re defining two PRIMARY KEY on your table. And it can only have A PRIMARY KEY per table. -- ----------------------------------------------------- -- Table `Jogos` --…
-
3
votes2
answers664
viewsA: Phone book with database
To do this you will need to do a survey (SELECT) in the Database and use the LIKE to check if there is a word in that field. $sql = "SELECT id, name FROM lista_telefonica WHERE nome LIKE '%$valor%'…
-
2
votes1
answer649
viewsA: How to call a class from an event?
To start a new Activity you just have to create a Intent and invoke the new Activity: Button botao = (Button) findViewById(R.id.voltar); botao.setOnClickListener(new OnClickListener() { public void…
-
2
votes2
answers299
viewsA: Sudoku does not print answers on screen
You are misreading the file, and typing as well. Because you are reading the | and the -. Do you understand? Your file has to only have numbers to read and write, like,: easy file 0240 1003 4002…