Posts by Jorge B. • 11,427 points
255 posts
-
0
votes1
answer462
viewsQ: Upload limit for AWS S3
I’m working with the Amazon S3 and AWS SDK for PHP. Is there a file size limit to send? Is there any simultaneous upload limit? It has given me a lot of these errors when I try to send 20 200MB…
-
2
votes2
answers53
viewsA: Lock btprevious2.setOnTouchListener function
You have to put the verification condition inside the case so that it has effect or not, as you wish. Take the example: case MotionEvent.ACTION_DOWN: if(!verificacao()) { if (handler != null) return…
-
3
votes2
answers289
viewsA: View grouped data
If you don’t want repetition in the column postagem has to make a GROUP BY of that column: SELECT * FROM tec_postagens tp INNER JOIN tec_historico_status th ON tp.protocolo=th.protocolo WHERE…
-
0
votes1
answer186
viewsA: Refresh page without running PHP code again
As stated in this answer just check which button is on: // Verifica se foi feito um POST if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'POST') { // Verifica se o foi com o botão carregar…
-
3
votes3
answers575
viewsA: Run PHP code once
Just before the insertion code check if it was done POST, ie if it was through Submit: if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') === 'POST') { //código de inserção após clicar no botão }…
-
9
votes1
answer2567
views -
2
votes2
answers922
viewsA: How to bypass table tags that are inside the foreach in PHP and HTML
You have to consider all table tags when printing values. From what I have seen do not have the tags correctly, inspect the generated HTML, in browser, and see the result. You will find that you are…
-
2
votes2
answers297
viewsA: Use the return hardware button to another function
If I understand correctly, you don’t have to raise Activity main whenever you return there, just use the methods onRestoreInstanceState and onSaveInstanceState to pass the data from one side to the…
-
7
votes1
answer579
viewsQ: How to guarantee unique access to each user?
How can I ensure that when a user is online, they no longer allow connections with the user login and password, taking into account that if the session expires, you can again allow connections from…
-
2
votes1
answer142
viewsQ: Doesn’t Crontab kill the lawsuits after they’re done?
I’m using the Crontab to run a PHP script every 10 minutes the problem is that the processes are running on the server, that is to say every 10 minutes I have another process running. crontab -e */5…
-
5
votes3
answers2269
viewsQ: What is the most efficient way to select items from a table?
Having the following table: | id | name | email | coutry | +----+------+-------+--------+ What shape more efficient (faster) to select ALL the rows of the table knowing that the table may have 1 row…
-
3
votes1
answer267
viewsA: sudoku problem with rows/columns repeated
Of course you have to check by inserting a value if it already exists in the same row and column before inserting. For that I created the function isValueInLineOrColumn checking whether or not the…
-
1
votes3
answers638
viewsA: Is it possible to make a POST from a file automatically?
With the help of reply from @Math remembered the Curl to create the POST. So I started creating my own script PHP(upload_test.php) where do I post my file(myfile_test.zip) to the gravar.php and keep…
-
6
votes3
answers638
viewsQ: Is it possible to make a POST from a file automatically?
I’m using the Cron to run a PHP script. I want to do a file upload load test for my server and Cron is in charge of this (the server then sends to Amazon). I was thinking of using the…
-
19
votes3
answers1320
viewsQ: What are braces {} in an SQL string for?
What are braces for {} in the following SQL string used in PHP for Mysql? $sql = "INSERT INTO {$table} ({$fields}) VALUES ({$placeholders})"
-
3
votes1
answer1270
viewsA: Dynamic table with PHP
The problem is you’re printing the field value or the modifier every time you check all the $m and ends up printing more than once per field. You can check when there’s match of $m with $b if it’s…
-
2
votes3
answers415
viewsA: Use PHP variable in JS file
Cannot place PHP code in a file .js because PHP does not interpret files with that ending. You can create a script in the PHP file: <script type="text/javascript">…
-
8
votes2
answers4787
viewsA: IF syntax inside an ECHO
You can’t for a if within a echo. The function echo is for printing strings, and you cannot put code (instructions) inside a string otherwise it won’t work. It is appropriate to finish the echo…
-
3
votes2
answers6977
viewsA: Add external icons to Bootstrap
This type of icons worked well in Bootstrap 2.x, now with Bootstrap 3.x it is used <i class="glyphicon glyphicon-cloud"></i> <script…
-
6
votes1
answer3366
viewsQ: Is it possible to create classes with two constructors?
I am making a class of my connection to PHP Database using the API mysqli_ and I came across the fact that I couldn’t put two builders in the same class. The idea is to use the previously defined…
-
3
votes2
answers737
viewsA: How to keep query filters sent via $_POST?
If I understand correctly you lose the values of the consultation and to maintain the values as you go through POST just press the same on input of the consultation, is the example: echo "<input…
-
27
votes6
answers11785
viewsQ: Is there an advantage to using filter_input instead of isset?
I’ve always been used to using the isset to check if an external variable is filled and if you are using it. Example: if(isset($_GET['pag'])) $pag = $_GET['pag']; Now I installed the Netbeans and…
-
1
votes1
answer165
viewsA: Error log by INI and in script
As explained in the PHP manual of set_error_handler function: It is important to remember that the default PHP error handler is completely ignored.…
-
7
votes3
answers4546
viewsQ: How to make a foreach for an array of arrays?
How can I make one foreach for an array of arrays like this: array ( [option1] => 2 [option2] => array ( [name] => "ola mundo" [id] => "123456" ... ) ... ) The array can vary from…
-
1
votes2
answers811
viewsA: Problem with jQuery Validation Plugin
When a verification depends on a user input you should use depends, returning true or false to the cpf according to one condition, in this case the field is empty or not: cpf: { cpf: { depends:…
-
2
votes1
answer84
viewsA: Select saves same data in 2 different fields
The problem is that when you go to get $produto = $_POST["produto"]; this will return you the value of the selected item: value="'.$row['codigo_produto'].'". You Can Create a Field Hidden and play…
-
2
votes2
answers165
viewsA: How to define access levels
For starters I advise you to change the mysql_ for mysqli_ once the version mysql_ will be discontinued. If you want to keep the version with the name of the field $reg["cod_usuario"] instead of…
-
4
votes2
answers508
viewsQ: What is Dénsity and scaledDensity for on Android?
What is the point of Density and the scaledDensity on Android? What use can we give you?…
-
5
votes4
answers1387
viewsQ: How do I know if it’s a tablet or a smartphone?
How do I know I’m working on one tablet or a smartphone with the Android API? Nowadays resolutions, dpi are almost the same thing between tablets and smartphones and it gets complicated to know…
-
1
votes1
answer1090
viewsQ: "Warning: Cannot Modify header information - headers already sent by"
I’m getting the following Warning in PHP: Warning: Cannot Modify header information - headers already sent by (output Started at newclient.php:683) Here is the line 683: ... 682 </div> 683…
-
1
votes1
answer1697
viewsA: Form Multiple Wizard Steps
What I did was create 3 div's hidden content. And depending on the step show only the div and enable and disable the buttons that interest me. HTML: <div class="modal-body"> <div…
-
4
votes2
answers231
viewsA: How do I read an XML file in PHP?
You can use PHP DOM: $dom = new DomDocument(); $dom->load( $file_name ) $tuas_tags = $this->dom->getElementsByTagName( 'tag_principal' ); foreach ( $tuas_tags as $tua_tag ) { $nomeTAG =…
-
1
votes1
answer111
viewsA: Notification with gray background?
What happens is that gray is the default color of the NotificationCompat. You can change the color like this: NotificationCompat.Builder builder = new NotificationCompat.Builder(this)…
-
7
votes2
answers653
viewsQ: How to generate PDF with little memory on the server?
I’m passing a table from my comic to PDF and I’m using the TCPDF. Only that first I have to pass my table to HTML and only then I can pass to PDF, which entails use of a lot memory and I have few…
-
1
votes2
answers314
viewsA: Repeat Block with animation - CSS - PHP
You might as well get one id in HTML each section, and each card and wear it like this: HTML: <div id="card1" class="card"> <section id="section1" class="conteudo1"> Jquery:…
-
2
votes1
answer1155
viewsA: php css table inside div
What happens is you close yours echo before the if. After the { echo $exibe['MedicaValidade']; } you have to do it again echo '</div>. Your code is corrected: echo' <div class="tabla7">…
-
2
votes2
answers1779
viewsA: How to add a class to a <li> when the person is on the link page accessed?
In the menu.php just do: <ul id="menu" class="clearfix"> <li <?php if($verifica['index']==true) echo "class='active'" ?> > <a href="index.php">Início</a> </li>…
-
1
votes3
answers8151
viewsA: How to read a string using input in Java?
Uses the input.nextLine(); to read the line entered by the user. In that specific case you can use the input.next(); because you only want to read a word without spaces. The next() only reads the…
-
3
votes2
answers9331
viewsA: How to change the Text Color of a listview?
You have to create a layout costumed par to ListView, and then use that layout on the adapter. <TextView xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/lisItem"…
-
2
votes1
answer878
viewsQ: How to go from one to one element in the Carousel?
I’m using Boostrap with Carousel to pass the menu elements I have. I want four elements presented at a time and that pass one by one without noticing the effect. With the code I have, the effect is…
-
4
votes3
answers15283
viewsA: How to go to a part of a text on the same page by clicking on a link above
Just for example, using section to place the text you want to link and place a id in that section: <section id="minhaTag"> <!-- o meu texto --> </section> Then just use this id in…
-
2
votes2
answers145
viewsA: Eclipse Android plugin error
To solve the problem just run the eclipse with the flag -clean /Applications/eclipse/eclipse -clean Soen source…
-
3
votes1
answer1624
viewsA: How to create a 1:N and 1:1 relation within the same table?
For standards rules You should have a foreign key in the picture table. But if you can’t have that key you can create a table that links images and promotions by continuing to use the table of…
-
0
votes2
answers353
viewsA: Listview does not display loaded BD data
You must declare your ListView and add the adapter to it: ListView tua_list_view = (ListView) findViewById(R.id.list); tua_list_view.setListAdapter(adapter);…
-
3
votes1
answer1697
viewsQ: Form Multiple Wizard Steps
I’m implementing a step-by-step form (Wizard) and I’m using the CSS of the gathering. Basically I use the Model Bootstrap so that the user cannot log into your account without first completing…
-
6
votes1
answer1101
viewsA: How to make a Listview with components next to the text on each line?
This is simple, just create an item in XML with a TextView and a Checkbox, and then use this item in ListView: Itemlist layout: <LinearLayout android:id="@+id/linearLayout1"…
-
0
votes2
answers675
viewsA: How to modify and save the new modified listview item?
What I do in this case is to have two lists: a list of all items that appear on listView; another list of selected items (lista_selec). Then every time I click CheckBox (true) add the item to…
-
0
votes4
answers129
viewsA: Sort H tags within a page
No, it’s okay to use more than one tag H1. Don’t overdo it, of course, but if you need to use one or two more tag’s H1 no problem, said by an Eng. of Google: Video link…
-
3
votes1
answer1437
viewsA: How to return a string from the method that queries Sqlite?
You can use the Stringbuffer or the Stringbuilder. Be an example: public String getString(String var) { String selectQuery = "SELECT * FROM "+TABLE_STATUS+" WHERE "+KEY_STATUS_KEY+"='"+var+"' LIMIT…
-
1
votes1
answer685
viewsA: Form validation using Jquery validate
The way I found to solve the problem was to check, in PHP, whether a POST, if yes I do a validation. So I get the assurance that every time there is POST the validation shall be carried out. My…