Posts by Bacco • 93,720 points
1,184 posts
-
10
votes3
answers1008
viewsA: How to improve my code (many If’s and Else’s)
One of the things I didn’t understand in your code is why you’re using two comparisons by if. Supposedly one test in each is enough, because if any of the comparisons is true, you won’t get to the…
-
6
votes1
answer136
viewsA: String array conversion
There are several ways to do this. Here are some possibilities: Version 1 $saida = ''; $cola = ''; foreach( $minhaarray as $chave => $valor ) { $saida .= $cola.$chave.'#'.$valor; $cola=':'; } See…
-
4
votes2
answers1218
viewsA: Increase Size Field Balls for Password
With CSS you can basically change font and size: <input style="font-size:18px;width:85px;font-family:Lucida Console" type="password"> but it is unpredictable what will happen from browser to…
-
21
votes6
answers21826
viewsA: How to remove auto-fill inputs?
In principle, the solution would be simple, to put the autocomplete="off" so much on the form how much in the input: <form name="meuform" id="meuform" method="post" autocomplete="off"…
-
4
votes1
answer3736
viewsA: How do I give an echo without breaking line?
A great technical repair 1 is to use the set with the parameter /P to avoid line break. Both batches then produce the desired effect: @echo off for /L %%a in (1,1,3)DO echo|set /p="%%a " and @echo…
-
1
votes2
answers1503
viewsA: Facebook Login localhost
Here is a very simplified example of how to use the facebook API for PHP, which is here: <?php require '../src/facebook.php'; $facebook = new Facebook( array( 'appId' => 'PONHA SEU APPID…
-
2
votes1
answer486
viewsA: Write a Dword value to Decimal in the Windows Register
In fact you are the one who is adding a zero in front of the text, in this line: My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\MinhaChaveCriada", "DECIMAL" & Dec, Numero,…
-
7
votes2
answers300
viewsA: Loop with "for" in a form with equal field sets
$campos = array( 'nome', 'curso', 'idade', 'sexo' ); $lista = array(); for( $i = 1; $i <= 5; $i++ ) { foreach ( $campos as $campo ) { $lista[$i][$campo] =…
-
6
votes3
answers4377
viewsA: window.close does not work
You can’t use it window.close in windows that have not been opened by the script in question, and that’s exactly what the message is saying. Remember that you have the self.close() in the case of…
-
3
votes3
answers1199
viewsA: Selection of fields that repeat in the Mysql database
If I understand the question: SELECT * FROM tabela GROUP BY assunto Exchange the assunto by the desired field. Then you can add the details you need, such as WHERE, ORDER BY, etc, but use the right…
-
3
votes3
answers7456
viewsA: Button Submit turn a normal link
If you really need a link Just use this format: <a href="#" onclick="document.nomeDoSeuForm.submit(); return false;"> Applying to your case: <a href="#"…
-
4
votes1
answer613
viewsA: PHP Ziparchive function does not work with more than one file
Important to check whether the file is actually being saved in full when closing: if ( $zip->close() ) { echo 'Arquivo fechado com sucesso'; } else { echo 'Problemas no fechamento'; } Another…
-
4
votes2
answers436
viewsA: PHP instruction executed directly by Mysql
There is how you perform external functions in Mysql, but it is a tedious and complicated maintenance job. It’s a lot easier for you for an entrance crontab or in the task scheduler run the desired…
-
8
votes2
answers19648
viewsA: Line break encoding ( n) in Javascript Alert()
Neither UTF-8 nor ISO-8859-1 encoding interferes with characters from 0x00 to 0x79, and this includes control characters such as tab, cr, lf and others. The problem with your code is incorrect use…
-
4
votes2
answers1483
viewsA: How should I subtract arrays
Follows a function that "merges" arrays, subtracting items with equal keys in both: function subtrai_array( $arr1, $arr2 ) { foreach ( $arr2 as $chave => $valor ) { if( array_key_exists( $chave,…
-
15
votes2
answers4983
viewsA: How do I let the bottom of the page degrade with Javascript?
With pure CSS As an alternative suggestion to what was asked, follows a much simpler solution, which dispenses with the use of JS, with a pure and relatively simple CSS: body { background-image:…
-
8
votes2
answers1047
viewsA: Application separate authentication server
One of the ways to simplify is for your application server to use something similar to the following stream: The application generates a hash and directs the user to the login with this parameter…
software-architectureanswered Bacco 93,720 -
4
votes1
answer1535
viewsA: How to redirect a URL always with bar (/) at the end?
RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !index.php RewriteCond %{REQUEST_URI} !(.*)/$ RewriteRule ^(.*)$…
-
8
votes2
answers970
viewsA: Time between (between) "start time" and "end time"
Summary of Mysql documentation: CURRENT_DATE() and CURRENT_DATE are synonymous with CURDATE() mysql> SELECT CURDATE(); -> '2008-06-13' mysql> SELECT CURDATE() + 0; -> 20080613…
-
11
votes2
answers256
viewsA: How to solve special situations of unnatural value for a domain?
All situations, like almost everything that allows for this type of discussion, have advantages and disadvantages. Here’s a sketch of some of the most common ones I come across. Note that I am using…
-
1
votes1
answer53
viewsA: How do I define using a class (center-block) in media-querie?
You could use a CSS preprocessor, such as LESS, to include the class in your media query, such as in this example, but it can be exaggeration depending on the project. One possibility to simplify is…
twitter-bootstrapanswered Bacco 93,720 -
6
votes1
answer953
viewsA: How do I leave a dash item in the middle? With <del>?
If it’s just a menu with mouseover: You don’t even have to use the <del> 1 nor the <strike> if only for a visual effect. See an example with CSS: CSS: a { text-decoration: none; cursor:…
-
7
votes1
answer6107
viewsA: How to generate a PDF contract using PHP directly?
To convert HTML to PDF, we already have another question on the website, in this show how to generate a PDF directly from PHP. Using the class FPDF, which is written entirely in PHP and released for…
-
2
votes1
answer674
viewsA: Listview does not repeat records
Follow a solution using an auxiliary list to avoid scanning the TListView whole. You can optimize the code later, according to the practical use you will make. Exchange the Colunas[2] by the column…
-
3
votes1
answer822
viewsA: How to force the download of a file, which is stored in the database
Probably $arquivo is coming with special characters at the end. Experiment using the function trim to clear these characters: header("Content-Disposition: attachment; filename=".trim( $arquivo) );…
-
9
votes5
answers5370
viewsA: How to apply ! CSS import via jQuery?
You can use it this way: $(".prodMenor:eq(6)").css("cssText", "margin-right: 0 !important"); Caution: in this case you need to set all the desired properties. See more in…
-
4
votes1
answer295
viewsA: Reorder position in a sequence via Mysql
In addition to its solution to reverse the position of two items, which is this: UPDATE chamado SET sequencia = sequencia + 1 WHERE cod = 1 UPDATE chamado SET sequencia = sequencia - 1 WHERE cod = 2…
-
3
votes1
answer126
viewsA: How to record variables from this array?
To take an item from a multidimensional array, just use more than one index. Examples: $teste1 = $array[0]['subitem']; $teste2 = $array['item']['subitem']; Note correct use of upper and lower case…
-
6
votes3
answers392
viewsA: String contains a certain word
To find out whether the whole word is in the string, you can use it like this: procuro = "tchau" dentrode = "oi\ntchau\nhi\bye" string.match( "\n" .. dentrode .. "\n", "\n" .. procuro .. "\n" )…
-
4
votes1
answer107
viewsA: Print does not return table values
The problem is you want to iterate on one set as if it were a simple table. One possibility to adjust the code is to restructure the data as a table, to iterate by numerical index (pokecatches[x]):…
-
4
votes6
answers1855
viewsA: How to create link with Hover showing strokes on the sides
I have prepared a version where you can control various traits of the dash and other elements with CSS, not to be limited to the width of the "minus sign" or other characters, and have precise…
-
4
votes1
answer113
viewsA: Select specific items within a while loop
For example: $i = 0; while .... { if ( $i++ % 3 == 0 ) { // selecionado } else { // não selecionado } } Or even: $i = 0; while .... { echo '<article data-id="..."'.( $i++ % 3 == 0 ? '…
-
2
votes3
answers660
viewsA: Position of a text relative to the top line
A possible solution would be to use absolute positions, but any difference in the fonts used would mess up its layout. With a small HTML adjustment, you can solve the problem: <div…
-
8
votes2
answers26487
viewsA: Best way to make a script to logout
An additional issue in this Logout, in addition to what has already been mentioned by @Papacharlie, is that any link out to the logout page complicates the user experience. The way it is, just an…
-
3
votes1
answer10495
viewsA: How to check a radio button
Here is a simple example of how to read the Radio Button in PHP. HTML: <form action="recebe.php"> <input type="radio" name="teste" value="um">Um<br> <input type="radio"…
-
3
votes1
answer104
viewsA: Error in an sql in the Laravel
Null is not a value, but "unknown value", and therefore cannot be compared with normal values. in place of "tb_combo_produto"."deleted_at" = null utilize whereNull('deleted_at')…
-
5
votes1
answer984
views -
6
votes1
answer64
viewsA: Search all records for a respective year and month
SELECT * FROM tbl_ocorrencias WHERE YEAR( data ) = 2014 AND MONTH( data ) = 8
-
5
votes4
answers405
viewsA: Hover does not work in div
If I understand correctly, you want to apply the class .produtosHover in .produtos? If this is it, you must use it addClass and removeClass, for show and hide work on existing elements only.…
-
6
votes2
answers3095
viewsA: Reading txt file with multiple columns to insert in Tlistview
I was based on a reply from Sozão to propose a way to read a file directly in a TStringlist, because the list can already be accessed "exploded" (using indexes). var Linhas: TStringList; ... Linhas…
-
5
votes1
answer745
viewsA: Explodes in Delphi
A possible technical repair1 is to use a Tstringlist: var Colunas : TStringlist; begin Colunas := TStringlist.Create; Colunas.Text := StringReplace('00:46:30@21/08/2014@Carlos dos Santos@São Paulo',…
-
1
votes2
answers1885
viewsA: Website images do not appear on iphone or iOS tablet
Make sure your PHP is sending the mime-type correct in the images: <?php header("Content-type: image/png"); ... The type is necessary for browsers to know what that information is being served.…
-
6
votes5
answers1449
viewsA: Sorting in query - Leave last registration in first and then sort by a field
Possible solution: SELECT id,nome FROM usuario JOIN (SELECT MAX(id) AS ultimo FROM usuario) AS dummy ORDER BY id != ultimo, nome Explanation: The subquery (SELECT MAX(id) AS ultimo FROM…
-
11
votes3
answers8188
viewsA: Validity of a QR Code
I have a QR Code that leads to a link. This link, I suppose, will be on the air until 2015. Of course, when the link doesn’t exist, this QR Code will get you nowhere. That’s basically it. It will…
-
6
votes3
answers326
viewsA: How to make a function where every time a variable is called is increased by 1?
To do this in a variable: $num = 0; echo $num++ ; echo $num++ ; echo $num++ ; echo $num++ ; Using passage by reference: function add_um( &$num ){ $num++; } $num = 0; add_um( $num ); echo $num;…
-
3
votes1
answer964
viewsA: Ubuntu Server 12.04 rcuos processes
Your update must have turned on any of these flags: CONFIG_RCU_NOCB_CPU CONFIG_RCU_NOCB_CPU_ALL CONFIG_RCU_STALL_COMMON CONFIG_RCU_USER_QS What is interesting is that apparently only in 13.10 they…
-
5
votes3
answers7805
viewsA: Font does not accept accentuation
This is not a CSS problem. The problem is found in the font character set. The solution would be to find an internationalized version of the desired font, or to use another one that you like and…
-
4
votes3
answers248
viewsA: Display images from right to left
Apparently what you want is something like this: #includeload{height:300px;width:100%;} #align-rodape{position: absolute;margin-top: 150px;} #pagina-projetos{min-height: 100%;display:…
-
7
votes4
answers1111
viewsA: How to delete the database registration if the user does not activate it by email within "X" hours?
Just use a query immediately before the checker that simply deletes all records that have passed a certain time, and whose asset is zero. If you do this query in a separate PHP file, you can use…
-
4
votes1
answer937
viewsA: Problem with 8 digit hexadecimal colors - Android
Both colors and opacities in the "web format" are usually interpreted as 00 to ff, 0 to 255 to the decimal. Multiplying 0xFF (255) by 0.87 gives a value close to 0xDD (221), so the black in the…