Posts by Phelipe • 1,541 points
81 posts
-
0
votes1
answer475
viewsA: Select2 is not entering search
Just set the dropdownParent property with the id of your dropdown. I put an example using bootstrap 4 to give you an idea of how it looks. $('.selectDois').select2({ width: '100%', dropdownParent:…
-
1
votes2
answers302
viewsA: Codeigniter session expires quickly
In the configuration file there is a part to configure the session variables. In this part you find the configuration $config['sess_expiration'] This variable is used to set the time, in seconds,…
-
2
votes1
answer32
viewsQ: Vertical alignment of two elements within a column
I’m trying to make a layout as shown in the image. Two columns, the second being aligned with a text at the top, and another text below. So far, what I have achieved is to align the entire text…
-
1
votes1
answer90
viewsQ: Align element vertically below Navbar
I have a page that I’m going to split into two columns. The right column should be aligned both vertically and horizontally and cannot create a scroll bar. I managed to do this, but as there is a…
-
2
votes1
answer2534
viewsQ: Background with gradient and undulations
I wonder if it is possible to create the image effect below using CSS. Make the gradient is quiet, but I’m having trouble making the ripples. #teste { width: 100%; height: 300px; background-image:…
-
1
votes3
answers1812
viewsA: Pick up part of a URL with PHP Explode
Anything that comes after ? is populated by the super global $_GET, so, if you want to take some parameter in the url you can do as follows: $data = $_GET['data']; This code would return the value…
-
2
votes2
answers177
viewsQ: Smooth height change
I’m making a Navbar where it will decrease the height and change the color in the scroll event. My problem is in making this transition smooth. I managed to do for the color, but not for the height.…
-
0
votes1
answer3741
viewsQ: Regex Phone validation
I am currently using a regular expression to validate phones in the following format: (xx) xxxxx-xxxx It only accepts numbers that have this exact shape. I wonder how to modify the expression to…
-
0
votes2
answers96
viewsA: How to echo $arrayReturn and html code
To give echo in an array you can use the function print_r() <strong> <?php print_r($arrayReturn);?> </strong> Dear want to leave the code pre-formatted on the screen you can do…
-
1
votes2
answers304
viewsA: Reset all fields (input, textarea) of the html page
You can reset all fields using the method reset(). Follow a simple example. function myFunction() { document.getElementById("myForm").reset(); } <form id="myForm"> Primeiro nome: <input…
-
0
votes1
answer81
viewsA: Layout for printing directly on the website
You are using Bootstrap and in your form you are dividing the fields into multiple columns, but when dividing the columns you are using the class: col-sm-x The class col-sm will make your layout be…
javascriptanswered Phelipe 1,541 -
-1
votes5
answers12763
viewsA: PHP - Transforming object into array
To transform an object into an array we can use the function json_decode() passing the second parameter as true that it automatically converts to an array. would look something like $meuArray =…
-
0
votes1
answer80
viewsA: Problem with Ajax URL
You are using the method GET to send data. This method transmits all information through the URL, that is, when you are sending your information through the URL, which can be potentially dangerous.…
-
0
votes1
answer40
viewsA: If there are spaces in folders or images, how is it resolved?
You can swap the spaces for the corresponding ASCII code preceded by %. the code would look something like: <body> <img src="../../pictures/Sample%20Pictures/Desert.jpg" width="400"…
-
0
votes3
answers1286
viewsA: Place div height at 100%
I found the solution with the following code: .main-wrapper { height: 100vh; } .section { height: 100%; background-color: red; } @media (max-width: 768px) { .section { height: auto;…
-
0
votes3
answers1286
viewsQ: Place div height at 100%
I’m putting together a layout using Bootstrap 3 and wanted to put together a layout more or less like this: +-------------+---------------------------------+ +-------------+ + +-------------+ +…
-
0
votes3
answers682
viewsA: Sum of an array and PHP value concatenation
With two functions you can get the sum of the elements. array_column() and array_sum(). The code stays that way. echo array_sum(array_column($data,'quantidade')); As you said your version does not…
-
0
votes2
answers277
viewsA: Codeigniter-friendly URL with emphasis on SEO
You can use the function url_title(). The function takes a string as input and creates a friendly URL string. You take the title of your post and go through this function and use it as part of the…
-
0
votes1
answer493
viewsQ: Loading script asynchronously
I have an administrative system using adminLTE. In the side menu I load all my scripts asynchronously (at least it was expected). However when I load an HTML asynchronously, and inside this file I…
-
0
votes1
answer333
viewsA: Get the last json data in php
We can use the function end() that takes the last element of an array. However We have an object, so first we have to convert that object to array. To do this just pass a second parameter to the…
-
1
votes2
answers1708
viewsQ: Configure stylesheet with PHP
I’m setting up an administrative system and one of the administrator’s options is to control various page color settings. However I’m having difficulty finding the best way to put these settings on…
-
1
votes2
answers41
viewsA: How to make connection alert?
If you want to test the connection in general you can use navigator.onLine. Already if you want to put a timeout on your AJAX calls you can use the parameter timeout (if using Jquary) that accepts a…
-
0
votes2
answers68
viewsA: Static block after the first while result
You can add a control variable. It would look something like $publi = true; while($fetch = $get->fetch()){ echo 'conteudo'; if(publi){ echo 'publicidade'; publi = false; } }…
-
-2
votes1
answer400
viewsA: Parse error: syntax error, Unexpected '}'
When you are opening the PHP tag you put the character >, Remove it and your mistake will possibly disappear. <?php $q = "SELECT id FROM users ORDER BY first ASC"; $r = mysqli_query($dbc, $q);…
-
0
votes1
answer654
viewsA: collect data json print php
You can use the function file_get_contents(). It would look something like: $conteudo =…
-
0
votes1
answer118
viewsA: Get information from a JS-generated page with PHP
the characters being generated are in the variable balancebig and it is displayed on the screen as follows: $('#bnkPrice').text(balancebig); As you want to retrieve the information from this…
-
2
votes2
answers41
viewsA: Best way to replace more than one character in php
You can pass an array with all the parameters you want to remove. $fone = '(01)0000-0000'; $retirar = array("(", ")", "-"); $fone = str_replace($retirar, "", $fone); echo $fone; or, pass the array…
-
1
votes2
answers1078
viewsA: How to count specific characters
You can do it this way. #include <stdio.h> #include <string.h> int main(int argc, char** argv) { char nome[100]; char vogais[11] = {"AEIOUaeiou"}; int cont = 0; int existeVogais[10];…
-
1
votes3
answers592
viewsA: Doubt PHP function - mb_strlen
The second parameter is the character encoding you are using. Most likely you will want this parameter set as UTF-8, If you want to better understand the function I suggest you take a look at the…
-
3
votes1
answer307
viewsA: How to join two tables in a JSON
You can use the UNION to join the two tables. SELECT Empresas.id, Empresas.nome, FROM Empresas UNION ALL SELECT imagens.idEmpresa, imagens.url, FROM Imagens WHERE Empresas.id = imagens.idEmpresa…
-
2
votes3
answers3212
viewsA: Force the User to enter a minimum number of characters
I used a very simple regular expression function to check if the date is in the correct format, if it is sending the form, otherwise it will not send. Follows the code function formatar(mascara,…
-
1
votes1
answer65
viewsA: How to make a button lock when clicking?
Here is the code. I assumed that you will send the error data to a script via ajax. To animate the button I used the Font Awesome. Note that in the modal success callback function I gave a return…
-
1
votes1
answer428
viewsA: Ajax returning Undefined
The superglobal $_REQUEST returns information from superglobals $_GET, $_POST and $_COOKIE. In your first example you are sending this data via GET, I mean, by the url. And everything worked fine,…
-
1
votes1
answer35
viewsA: limiting a date field to only numbers
Just add the code below that checks the hexadecimal value of the pressed key, if the value does not correspond to a number it does not enter what was keyboard: if (event.keyCode < 48 ||…
-
4
votes2
answers448
viewsA: Algorithm problem over percentage
Your rate and total are defined as int, but she’s a float. Change this and your algorithm will be working perfectly. float populacao,taxa,total; int conta; populacao=20.000; taxa=1.05; for…
-
3
votes2
answers1725
viewsA: How to increase number to fractional power?
You are already using the mathematical library that brings several functions to work with mathematical calculations. To do the potentiation you can use the function pow Here’s an example of how to…
-
10
votes2
answers765
viewsA: What does if(variavél){ /*action*/}mean?
Comparison structures like the if expect boolean values (TRUE, FALSE). But with the evolution of languages the concept of what is true or false has been broadened. so let’s take an example var teste…
-
0
votes1
answer479
viewsA: How to use two navbar-right classes on the same page?
You’re wearing the same ID in both navbars. Just exchange these two lines. data-target="#navbar2" and change the representative ID <div id="navbar2" class="navbar-collapse collapse"> Below is…
-
0
votes1
answer64
viewsA: System error after it went up to server
As the comments pointed out above, perhaps it lacks some experience in programming. On line 12 you are checking if the query returned any data. To do this it is not necessary to make $results >…
-
0
votes2
answers6278
viewsA: Spacing between images
Just put a margin on your div. I created the class espaco that puts a 60px margin above and below the div. Follow the code below. .espaco{ margin: 60px 0; } <link…
twitter-bootstrapanswered Phelipe 1,541 -
1
votes2
answers44
viewsA: Help with HTML form
You can put another input into your form with the ID and hide this field. something like <input type="hidden" name="id" value="2"> No value you play the ID you need.…
-
1
votes2
answers464
viewsA: Access values within an array
To access the id variable you can do as follows: echo $data[0]['id']; This array is multidimencional, that is, to access more "internal" information of the array you can go adding ['kay'] with their…
-
1
votes1
answer37
viewsA: Site content covering navigation bar
Simply add the z-index property to your class topbar. The z-index property specifies the stack order of one element, i.e., which element must be "in front" of the other. Similar to the layering…
-
0
votes2
answers295
viewsA: How to read JSON data sent by javascript in PHP
To recover data from your form, you can use the function serialize(). Below is an example of how to use: function enviaDados(form){ var dados = document.getElementById('form');…
-
0
votes1
answer108
viewsA: show user by informed Codeigniter plate
Follow the code below In Model, we are selecting everything from the table matriculas where the column matricula is equal to a parameter we are passing to the function. The method will return FALSE…
-
1
votes1
answer842
viewsA: Combinatorial Analysis - Generate n! arrangements
My response was inspired by this post, case you want further explanations. I used three functions to get the answer. function buld_char(valor){ for (var i = 0; i < valor; i++) { lista.push(i+1);…
-
1
votes2
answers842
viewsQ: Change position of two characters in javascript
When using the language C, we can easily swap two characters of a place string, just do: aux = str[i]; str[i] = str[j]; str[j] = aux; For example: "ABCD" would look "ABDC" however, I’m having a hard…
javascriptasked Phelipe 1,541 -
2
votes3
answers2980
viewsA: AJAX Return Handling with JQUERY
As you did not put an example of your return I will assume it does not do so. One of the ways to do this is to return a JSON in the following format: { "retorno": "x", "dados":"seus dados vão aqui",…
-
2
votes2
answers923
viewsA: What is the difference between querySelectorAll() and getElementsByClassName()
getElementsByClassName returns DOM elements live and any subsequent change made to these DOM elements will be reflected in the list. querySelectorAll does not return live DOM elements. Subsequent…
-
1
votes1
answer41
viewsA: Exercise PHP Language
It is not the purpose of the site to solve the question but rather to ask questions. But it seems you are new so I will answer your question. We can define this class in many ways, but I chose to…