Posts by Kenny Rafael • 6,698 points
139 posts
-
2
votes2
answers238
viewsQ: Generate Image Thumbs Before Uploading
I am looking for a solution without plugins that manages Thumbs of the selected images on <input type="file"/>, preferably with Javascript or at most jQuery. The idea is to have something like…
-
1
votes2
answers1623
viewsA: Query delete with Join mysql
The problem is that you can’t in a UPDATE, DELETE, or INSERT reference the same table in a subquery, but there is a solution: DELETE FROM mdl_forum_discussions WHERE id IN ( SELECT…
-
2
votes1
answer1313
viewsA: Check if a certain value exists within an array
Despite being a duplicated issue by the requested content, the error is specific to the way you are mounting your if, which should be as follows: $array = array("0","1","2","3");…
phpanswered Kenny Rafael 6,698 -
1
votes1
answer708
viewsA: How to upload images after scroll when in view-port?
Either you use some Javascript developed to do this effect or you use some plugin ready, I suggest the Lazy Load: <script src="jquery.js"></script> <!-- jQuery necessário -->…
-
7
votes2
answers1217
viewsA: Which index (php or html) loads when both are present?
In the case of an APACHE server, you determine the order via the directive DirectoryIndex in his httpd.conf: DirectoryIndex index.php index.phtml index.html index.htm There is also the possibility…
-
1
votes2
answers732
viewsA: Conflicts with jquery in the Adminlte template
I believe this problem is actually being caused by a conflict related to the method autocomplete, see well: Are you adding the jquery-autocomplete/jquery.autocomplete.js, that has the method…
jqueryanswered Kenny Rafael 6,698 -
2
votes2
answers87
viewsA: SQL + Left Join
If your field is one date, just filter with a simple operator: SELECT p.idProduto, p.descricao as 'Produto', YEAR(v.dataVenda) as 'Ano' FROM Produto p LEFT JOIN Venda v ON p.idProduto = cp.idProduto…
sqlanswered Kenny Rafael 6,698 -
3
votes2
answers82
viewsA: Font reponsive with css
An alternative for you to have full control of resizing your sources is to use the media queries of css: @media screen and (min-width: 480px) { p {font-size: 12px;} } @media screen and (min-width:…
-
2
votes3
answers2849
viewsA: Grab button id pressed
Add a class and put the event in it to catch the id button: <? while ($linha = mysqli_fetch_array($ids)) { $query = ("select * from componentes where id_principal = ".$linha[0]." "); $componentes…
-
0
votes2
answers100
viewsA: How do I not repeat the value of an html cell
In the loop display, you can feed a array and check if the value has already been displayed before: @{ List<String> used = new List<String>; foreach (var item in Model) {…
-
2
votes1
answer143
viewsA: Select with subquery
This error occurs because your query returns more than one result, which is not possible since you want to put it in a column of your main query, what you can do is put a limit to return only one…
-
2
votes1
answer199
viewsA: Login with PHP using PDO
That’s what we call a if ternary. What comes after the assignment (=) and before the ? is a condition for attributing what comes before or after :. ? == if : == else In a practical example you can…
-
1
votes2
answers639
viewsA: Event onClick is not working!
In your case, just enter the bind in the sequence: $.getJSON('pagina.php',function(data){ $.each(data,function(){ html = '<li class="qf b aml">\ <button class="bseguir"…
jqueryanswered Kenny Rafael 6,698 -
3
votes3
answers2196
viewsA: Check that the values of an array are all the same PHP?
There are some ways to do this check, for example: if(count(array_unique($minha_lista))){ //... } or even: if($minha_lista === array_fill(0,count($minha_lista),$minha_lista[0])){ //... } Here the…
-
1
votes1
answer839
viewsA: Cron on Linux minute and day of the week
What you need: * 18,0-6 * * 1-5 wget http://192.168.6.80/sistema.php The Cron reads all files and checks whether the current moment is compatible with the range indicated in the txt. In that case: *…
-
0
votes2
answers79
viewsA: Stop Mutiplos clicks on Ubmit!
I’d do it this way: <h4>Cadastro de Nome</h4> <form id="cadUsuario" method="post"> <label>Nome:</label><input required type="text" name="nome" id="nome" />…
-
1
votes2
answers476
viewsA: Focus with selected text
The .on() is currently expendable, suffice (as documented) before the .trigger() the following code: $(".autofocus").focus(function () { $(this).select(); }); You can still perform directly in the…
-
2
votes2
answers775
viewsA: Mask problem in jQuery
You can do it this way: $('#input-custom-field3').focusOut(function(){ //você pode alterar aqui o seletor para alguma classe, para validar todos os campos de data var valid = true; var date =…
jquery-mask-pluginanswered Kenny Rafael 6,698 -
1
votes1
answer72
viewsA: PHP, error making query
The problem is that its parameters are reversed, change as follows: if($result = mysqli_query($sql3, $link)) { //... }
-
0
votes2
answers1666
viewsA: How to create an array with months
It is enough that after calculated the month, convert it into text: function convert_date($before){ return DateTime::createFromFormat('!m', (date('m')-$before))->format('F'); } Then just use it…
-
2
votes2
answers3568
viewsA: PHP - Parse error: syntax error, Unexpected 'public' (T_PUBLIC) in
Is missing close one {} in its first function! public function getUrlcliente($cliente_id) { $parametro = "cliente_id=" . (int)$cliente_id; $url_cliente = $this->db->query("SELECT DISTINCT…
-
1
votes1
answer491
viewsA: Compare Dates - PHP - Codeigniter
Try this: foreach ($teste as $row) { $data_validade = date('Y-m-d', strtotime($row->data_validade)); echo $data_validade; $data_atual = new DateTime(date('Y-m-d')); $diferenca =…
-
5
votes2
answers1008
viewsA: How to Customize Simple Page Arrows?
According to the documentation of Laravel 5.3 you can customize the view as follows: Running the command of artisan to transport the view pagination standard for resources/views/vendor/pagination:…
laravelanswered Kenny Rafael 6,698 -
0
votes1
answer473
viewsA: Select multiple checkbox with foreach, coming from the bank in Aravel?
The parameter is received as an array, just give a implode() in the data to concatenate: public function store(RequestProduto $request) { $data = new Produtos; $data->nome_visivel =…
-
2
votes2
answers236
viewsA: While Ajax Jquery
Make the following changes to your code: Select: public function selectInfoClienteTask($fantasy){ try { $stmt = $this->conn->prepare("SELECT tasks.*, DATE_FORMAT( tasks.Delivery , '%d/%m/%Y' )…
-
3
votes2
answers29
viewsA: validation filter_input php
There is nothing wrong with your condition, what is interesting to note is the following, the PHP already considers a condition as false in the following cases: null 0 array() "" Whereas you do the…
phpanswered Kenny Rafael 6,698 -
0
votes1
answer56
viewsA: Position search response on inputs
The point is you’re returning a html in his ajax that already brings all the data at once, and for each .html(), you print the same, in case, 3 times. You need to choose from the two one: Return a…
-
2
votes1
answer455
viewsA: A white bar appears in the right margin causing the appearance of the horizontal scroll
You have two problems on your site, the first is in the portfolio session, your images are exploding, to fix add the following rule in your css: .img-responsive { margin: 0; } The second problem is…
bootstrapanswered Kenny Rafael 6,698 -
0
votes4
answers11013
viewsA: Validate phone number with optional ninth digit
You can use the following rule: $exp_regular = '^(\(11\) [9][0-9]{4}-[0-9]{4})|(\(1[2-9]\) [5-9][0-9]{3}-[0-9]{4})|(\([2-9][1-9]\) [5-9][0-9]{3}-[0-9]{4})$'; $ret = preg_match($exp_regular, $phone);…
-
0
votes1
answer737
viewsA: Recovering images from database using PHP+MYSQL
Try it this way: $con = new mysqli("localhost","roberto","",""); $query = "select imagem from FOTOS_PRODUTOS where id = 1"; //não precisa de () aqui $result = $con->query($query); $imagem =…
-
0
votes0
answers641
viewsQ: Detect "download event"
I am providing a link to download XML files: <a href="http://exemplo.com/link" download=""> Baixe o XML do pedido </a> However, because it is a bit slow processing, due to the number of…
-
2
votes1
answer750
viewsA: Exchange data-src for CRS
In your case it can be this way (Solution with jQuery): $('#teste').attr({ src : $('#teste').attr('data-src'), }) .removeAttr('data-src') ; Basically, you will create a new attribute and remove the…
htmlanswered Kenny Rafael 6,698 -
0
votes1
answer160
viewsQ: Problems with encoding SQL Server 2008
I am performing a query in an Sql Server database, but the special characters are returned as follows: MAR�O instead of MARÇO I was able to fix using the function utf8_encode(), but I do not want to…
-
1
votes2
answers1280
viewsA: Insert a Date Range
You can use a function to return all dates between start and end before entering in the database: function createDateRangeArray($strDateFrom,$strDateTo) { // formato esperado: YYYY-MM-DD…
-
1
votes2
answers1603
viewsA: Load content from another jquery file
What must be happening, is that you do the bind of the event on load of the page, however it is only inserted after this, thus being without any action, what you have to do, is bring along with it,…
-
-1
votes1
answer989
viewsA: Problem with Carousel Bootstrap
There is a parameter for the carousel that you must set for him to give a autoplay, in case the interval: $(function(){ $('.carousel').carousel({ interval: 2000 }); }); If that’s not enough, which…
bootstrap-3answered Kenny Rafael 6,698 -
0
votes2
answers566
viewsA: Display selected input value
I believe that’s what you need according to the description of your image, I just didn’t put any warning, but I imagine you were just wanting to test... $("#principal").on('change keyup paste',…
jqueryanswered Kenny Rafael 6,698 -
1
votes2
answers59
viewsA: How do I delete previous value using javasript
In cidades you don’t need to link two events .change, and then to replace the values just change the method .append for .html: $(function(){ $("#estados").change(function(){ var id = $(this).val();…
-
3
votes2
answers296
viewsA: Hide half an icon on a Card
Here is a base, now just adjust as you want to use, colors, sizes, positions, etc... .icon-card { font-size: 102px; position: absolute; top: -17px; right: -1px; width: 41px; overflow: hidden; color:…
-
1
votes1
answer58
viewsQ: Return numbers from a String
I am a programmer PHP and giving maintenance on a project Java I found myself with the need to return only numbers contained in a certain String. I found no questions about it in Sopt and found in…
javaasked Kenny Rafael 6,698 -
3
votes1
answer58
viewsA: Return numbers from a String
Solution found in Soen: str = str.replaceAll("\\D+","");
javaanswered Kenny Rafael 6,698 -
2
votes1
answer201
viewsA: Forward button and back ajax
You need to adapt some things in your code, but more important than solving this single problem, is you better understand the concepts of client-side and server-side, because clearly you’ve mixed up…
javascriptanswered Kenny Rafael 6,698 -
4
votes1
answer2080
viewsA: Change default font
Ideally, you do not edit the source code of bootstrap, so avoid messing with things you wouldn’t like. To work with another standard source, you can do as you did on the html: <link…
twitter-bootstrapanswered Kenny Rafael 6,698 -
4
votes1
answer140
viewsQ: Convert Stack Trace to String in JAVA
What would be the best way to convert Stack Trace from a Exception in String?
-
5
votes1
answer140
viewsA: Convert Stack Trace to String in JAVA
I came across this need and doing a web search I found that one great solution on Soen, which allows you to obtain such important information as String, without having to import other libraries: try…
-
3
votes2
answers343
viewsA: Error installing JWT/Laravel
This error refers to dependencies on this library that you don’t have, try editing it composer.json as follows: "require": { "phpseclib/phpseclib": "*", "namshi/jose": "*", "tymon/jwt-auth": "0.5.*"…
-
3
votes1
answer196
viewsA: How to make a structure with Divs of the same id
First of all, a ID has that name because it means that it is a unique reference, to create an identifier for all your divs, you must use a classe, an example referring to what you requested could be…
-
1
votes1
answer623
viewsA: UPDATE in another table when updating a record does not work - CODEIGNITER - MYSQL
Your error is in this update: $sql = "UPDATE vendas set lancamentos_id = lancamentos_id = ? WHERE idVendas = ?"; In addition to containing syntax error using x = x = x, your lancamentos_id in querie…
-
0
votes1
answer241
viewsA: Identify a given url and change href property with preg_match_all
You can treat before forever have http in the url as follows: function checkUrl($text){ //primeiro garantindo que todos vão estar iguais $find = ['http://www.meusite.com.br',…
phpanswered Kenny Rafael 6,698 -
3
votes1
answer74
viewsA: Problems with PHP POST
The mistake is in yours adiciona-produto, the attribute name is in the option, when you really should be in select, see: <select id="selecionar-categorias" name="categoria"> <?php…