Posts by Jorge B. • 11,427 points
255 posts
-
1
votes1
answer685
viewsQ: Form validation using Jquery validate
I’m here with a problem validating my form, every time I change the country I reload the page: <select class="form-control" id="pais" name="pais"…
-
3
votes3
answers4401
viewsA: How to break lines when sending an email?
It’s not because of <br> which is in the box of spam. The line break depends on the content-type that you are using to send the email. You can use Content-Type: text/plain; charset=utf-8 so…
-
11
votes3
answers138
viewsA: Does every DIV have a relative position?
Wrong, in HTML a position by default (by default) is position: static; Reference: W3C…
-
2
votes4
answers430
viewsQ: PHP class for interaction with Mysql BD
Does anyone know any PHP class for Mysql integration, using the function mysqli_* and Prepared statements? I have these two examples: Mysqlidb Mysqli Database…
-
1
votes1
answer945
viewsA: Android Gridview Layout
The way I do this is very simple, I fill the background of Gridview with one color, the items with another color and add the spacing between items, and then you have a grid with limits, like table.…
-
2
votes1
answer4309
viewsQ: Android minSDKVersion and targetSDKVerion
What’s the difference between minSDKVersion and targetSDKVerion? Androidmanifest.xml: <uses-sdk android:minSdkVersion="14" android:targetSdkVersion="19" />…
-
5
votes4
answers425
viewsA: Query BD and show all results except the first
You can do with the MIN mysql: $query = mysql_query("SELECT * FROM tbl_galeira WHERE id > (SELECT MIN(id) FROM tbl_galeira) ORDER BY id ASC");
-
4
votes3
answers3508
viewsA: How to make a site multilingual?
Well the solution I adopted, after much study and conversation here at the office, was gettext with poedit. Here’s a tutorial where I guided myself: PHP and Javascript Internationalization using…
-
4
votes2
answers2761
viewsA: PHP value rounding error
If you make a var_dump($valor); the result will be : float(485) This is because you are using in the function sprintf the d and you should use f, because the variable $valor is a float. d - The…
-
0
votes2
answers980
viewsA: Enable fields from the completion of a previous field
With or without Bootstrap what I usually do in this type of forms is to do everything on the same page, using only PHP. And with the onChange change the form action. <form action=""> ...…
-
11
votes3
answers3508
viewsQ: How to make a site multilingual?
I have a site made in PHP, now I came up with the obligation to make the site multilingual. I need to translate titles, menus and error messages. User added texts do not need to be translated. I’ve…
-
5
votes1
answer761
viewsQ: What is the best way to read an XML in PHP and insert it into the Database?
I am reading XML files of about 50M of information (a hundred thousand records, could be more), and I have two classes implemented XML reading one DOM and another SAX. I’m having a problem in terms…
-
5
votes1
answer354
viewsQ: Is it possible to run a query (Insert) and only then check if it is duplicated?
I am reading an XML file and at the same time insert the entries in the BD. My code is like this: foreach($itens as $item) { ... if ( ! $stmt_insert_item->execute ( ) ) { if (…
-
3
votes1
answer47
viewsQ: Maxrequestlen error while uploading files
I’m working in PHP and doing upload files, when trying to make a upload of 60M get the following error: mod_fcgid: HTTP request length 16784592 (so far) Exceeds Maxrequestlen (16777216) I have my…
-
0
votes1
answer1232
viewsQ: ADB does not recognize Android 4.2.2 in Ubuntu
I’m working on Ubuntu 13.04, and I just got a tablet with Android 4.2.2 directly from a manufacturer and I’m not getting ADB to recognize the tablet, and consequently I can’t do debug. I’ve tried…
-
2
votes2
answers272
viewsA: Sort by upload date after a readdir
You can use the function filemtime() to know the recording date of each image. Which can be used as key to sort the images, using uksort(), before they are processed. See also: fileatime() - date of…
-
5
votes2
answers456
viewsQ: Creation of tables with Database scripts
In my application I have to create a table for each user, tables are created the first time when the user uploads a file and with the name table_$id_user. And the only way I see to create so…
-
2
votes1
answer114
viewsA: Galeria Fotografias
To change the positioning of the buttons you have to label, I changed that: #slideshow-wrap label:not(.arrows):not(.show-description-label) { ... /*bottom: -45px;*/ top: 0px; ... } As for changing…
-
5
votes2
answers6653
viewsQ: Mysql Commands out of Sync; you can’t run this command now
I have a class Import (PHP) which is used to read XML files and insert into the BD. First I got the class builder Import that creates a new connection mysqli: ... $this->mysqli = new mysqli(…
-
2
votes1
answer1455
viewsA: Mysql time tables
What happens is that PHP closes the connection anyway at the end of script, so if we want to check that we are doing everything right we can for example make a select in this same table just below…
-
2
votes2
answers1625
viewsA: How to make an empty select to pull all results from column
You can do it through PHP this way: $nome = $_POST['nome']; $tipo = $_POST['tipo']; $vida = $_POST['vida']; $forca = $_POST['forca']; $query = "SELECT * FROM WoH WHERE NOME LIKE '%".$nome."%' AND…
-
2
votes1
answer1455
viewsQ: Mysql time tables
I am here studying the temporary tables of Mysql, and I am creating some temporary tables. I am using the mysqli, according to the manual, the temporary tables are erased after the connection is…
-
5
votes2
answers38817
viewsA: How to define the dimensions of an HTML page?
You can use the attributes height (height) and width (width) in pixels or percent in the style of body or by CSS. But it’s good practice to be in CSS. In the CSS: body { height:200px; width:100px; }…
-
4
votes2
answers312
viewsA: PHP : Upload File
The problem is in PHP configuration (php.ini): post_max_size = 8M If the size of the posted data is greater than post_max_size then the superglobal $_POST and $_FILES are empty. Here is the tip to…
-
9
votes2
answers312
viewsQ: PHP : Upload File
I’m here with a problem making one upload of an XML file in PHP. I have a form that allows me to select a file: <form id="upload" action='' method='post' enctype="multipart/form-data" >…
-
41
votes3
answers57228
viewsQ: What to use require/include/require_once/include_once?
I am developing an application in PHP and would like to know when and why to use require or include or require_once or include_once? I also noticed that you can make these shapes and it works:…
-
1
votes4
answers4178
viewsA: What is the difference between joining tables by JOIN and WHERE?
There is no difference except by the code itself. In relation to performance also has no difference.
-
1
votes3
answers3315
viewsA: PHP session expires before time
Here’s my session job: function sessionTimeout($time_out)//em minutos { $time_out= 60*$time_out;//passa para segundos ini_set('session.gc-maxlifetime', $time_out); if…
-
5
votes1
answer275
viewsQ: Mysql Transactions written in the same table
On seeing this answer I was left with this doubt: If we have 2 transactions to be treated at the same time, in the first (A) we are writing in table x, in the second (B) if we try to write in table…
-
9
votes3
answers1225
viewsQ: Mysql Transaction When? How? Why?
I’ve been reading the question What is a Mysql Transaction for? and I was left with many doubts on this subject. When we should use transactions? Why should we use transactions? How we should use…
-
2
votes2
answers4662
viewsA: Check repeated character and value in string array
First you can make a comparison of each string and check if there is any other record with that value your example. Or you can do it another way that I just remembered: List jtLista =…
-
19
votes7
answers5450
viewsA: How to write easy-to-maintain, readable code?
The question is what other techniques can be used to improve the readability of a code? In my view it can be a conjugation of everything that has already been said. All are valid. I think these are…
-
4
votes2
answers6785
viewsA: Open device gallery
Here’s an answer based on SOEN: public class BrowsePictureActivity extends Activity { // Este é o código de ação que usamos no intent, // Desta forma sabemos que estamos a olhar para a resposta da…
-
2
votes3
answers5992
viewsA: submit form from a select
Just use the onChange : <form action="" method="post" name="menuForm" onchange="this.form.submit();">
-
3
votes2
answers352
viewsA: Showing one icon to directory and another to other files
You can check if it is directory or not: if (is_dir($dir)){ }
-
2
votes1
answer2723
viewsA: Data update Sqlite Android
The way to fetch the Edittext variable inside the update event, for example: Button btnAtualiza; @Override protected void onCreate(Bundle savedInstanceState) { ... btnAtualiza = (Button)…
-
1
votes1
answer3097
viewsA: How do I calculate Euclidean distance
You can do it like this: public int distancia(Ponto p){ //algoritmo que calcula distancia entre (this.x, this.y) //e (p.getX(), p.getY()) passados como argumento Ponto p. }…
-
1
votes4
answers1496
viewsA: jquery datepicker error does not work
I use 2 datepicker also, what I chose to do was to create in the script 2 functions, one for each Picker: $('#datepicker1').datepicker({ ... )}; $('#datepicker2').datepicker({ ... )};…
-
2
votes1
answer76
viewsA: Query php shows no expected result
Just add one ( after Where and close ) before and, so you can apply and to all previous possible cases. Select * From tb_trabalhador WHERE ((AlvaraNumero = 0 or AlvaraNumero is NULL) or…
-
7
votes3
answers2818
viewsA: Check Mysql Connection Existence in PHP
You can check like this: <?php if(is_resource($connection) && get_resource_type($connection) === 'mysql link') { //esta conectado. } else { //não está conectado } ?> or simply this one…
-
8
votes2
answers4852
viewsQ: Send sms from a mobile device via HTML5/javascript
I am creating a WEB application for mobile device that will be downloaded in one of the stores, with a mini WEB server integrated and that works on any operating system(iOS, android, Windows8, etc).…
-
1
votes2
answers491
viewsA: Query Select Option PHP
It depends a lot on what is selectable or not, what is mandatory, etc. From what I understand of the question I would do so: $sql = "SELECT * FROM bd_table"; if (isset($_POST['estado'])) {…
-
0
votes1
answer3192
viewsA: Change radio button properties from select
See if this is what you want? [EDIT] Here’s an update with the whole problem: http://jsfiddle.net/q3N95/17/ See if that’s what you wanted, anything at all, just ask. <input id="d1"…
-
7
votes1
answer1002
viewsQ: How to pass variables between PHP pages via Javascript?
I was doing a search in PT and EN on how to pass variables from one page to another via Javascript, although I found a lot of information continued with the doubt of which is the best way to do it.…
-
1
votes2
answers597
viewsA: Data-Tables misaligning table title and body when scroll is applied
From what I understand the behavior is normal, since you’re doing the scroll body of the table and not the table itself. If you repair the scroll vertical does not include the header table. That is,…
-
0
votes2
answers527
viewsA: My website was cloned?
The question is a bit subjective, but by my knowledge, you can "clone" at least the look of the site changing some things, because you have access to css, at the javascript and to the html from the…
-
0
votes2
answers315
viewsA: Why are you giving Segmentation fault in my Assembly inline?
To write the instructions in 64 bits it is necessary to use the suffix 'q': "movq %rsi,0x8(%rsi)\n" Except for stack operations (pop, push, call, Ret, enter, Leave). I hope I’ve helped.…
-
0
votes1
answer624
viewsA: Synchronize Listview Ids with database
Depending on the items you have in ListView it would be better to have even associated objects. That is, each item in the list would be an object and that object would have the ID coming from the…
-
0
votes3
answers1419
viewsA: Make Backspace when pressing "+" key
Try making a return false; Example: function openSearchCliente(e) { var unicode = e.keyCode ? e.keyCode : e.charCode; if (unicode == 43) { popupSearchCliente.Show(); //Abre pop up return false; } }…
-
1
votes1
answer808
viewsA: Navbar bootstrap disappears in certain size
I have so my navbar and works perfectly: <div class="container"> <div class="navbar-header"> <a href="index.php" class="navbar-brand">Início</a> <button…
twitter-bootstrapanswered Jorge B. 11,427