Posts by Ricardo Mota • 2,905 points
98 posts
-
2
votes2
answers1898
viewsA: Perform function from the same class
It would look something like this: 1° class editar { public function selecao_editar(){ $this::update(); } function update(){ //FAÇA ALGO } } 2° class editar { public function selecao_editar(){…
-
1
votes1
answer144
viewsA: Count number of questions in an XML file
You’re just taking the first block of disciplina because of the exact reference. foreach($xml->avaliacao->disciplina->questao as $listar => $valor) You need to do 2 foreach if you want…
phpanswered Ricardo Mota 2,905 -
0
votes1
answer60
viewsA: Follow Focus sequence after reloading page
You can use JS to solve your problem. Would look like this: $(function(){ //Declara variável var focus_ok; //um laço para cada elemento 'input' $( "input" ).each(function( index ) { //se o elemento…
-
1
votes1
answer363
viewsA: Hide directory with htaccess
You can use 301 redirect in that case. It would look something like this: redirect 301 /novo/empresa.php http://www.seusite.com.br/empresa.php I hope I’ve helped. Update How is it not a url just,…
-
2
votes1
answer4421
viewsA: Tag thead pinned at the top and tbody with scroll bar in table in HTML
There are already some solutions to this Renan. Here are some interesting: Using in conjunction with JS: // Change the selector if needed var $table = $('table.scroll'), $bodyCells =…
-
1
votes2
answers73
viewsA: Random Array between Specific Values
You can do it like this: array_rand //Criando array $a = array("red","green","blue","yellow","brown"); //Número máximo do rand $max = (count($a) - 1); //Resultado randômico echo rand(0, $max);…
phpanswered Ricardo Mota 2,905 -
1
votes3
answers1216
viewsA: View image in Javascript
You can use this function for this: /** * Determine the mobile operating system. * This function either returns 'iOS', 'Android' or 'unknown' * * @returns {String} */ function…
javascriptanswered Ricardo Mota 2,905 -
3
votes2
answers97
viewsA: Laravel 5 Querybuilder, simplified collection results
In that case you want a list of id’s. It would look something like this: $ids= DB::table('minha_tabela')->pluck('id'); You can see it on documentation here. I hope I’ve helped.…
-
0
votes2
answers3313
viewsA: How to work with CSS labels
I don’t quite understand but from what I understand you want this: label{display:block;} form{width: 200px;border: 3px solid #4e4e4e;padding: 15px 15px;border-radius: 3px;}…
-
1
votes1
answer91
viewsA: Route order in Laravel 5
I will comment on the points I found, and already tell how it could be: Routes //Essa é a única rota de que você precisa; Route::get('/', function () { return view('indextemplate'); });…
-
0
votes2
answers45
viewsA: Clauses and JS message
You can solve your problem like this: <?php $DsTpVeiculo = "Cavalo Truck"; if($DsTpVeiculo == 'Cavalo Truck'){ $NrPlacaCarreta = "Meu preenchimento de input;"; ?> <td><input…
-
1
votes2
answers114
viewsA: Sending email to multiple recipients
You can solve your problem like this: var inputs = $('input[name="email[]"]'); inputs.on('change', function () { var str = []; var control = 0; inputs.each(function () { if (this.checked) {…
-
11
votes2
answers19261
viewsA: calculating days between php dates
You can do it like this: <?php $data_inicio = new DateTime("2016-07-10"); $data_fim = new DateTime("2017-07-10"); // Resgata diferença entre as datas $dateInterval =…
phpanswered Ricardo Mota 2,905 -
3
votes1
answer250
viewsQ: How indexing works with searchers using Angular JS
How searchers index displayed content with angular? I researched it and found that apparently Google reads Javascript according to this matter. But that’s really true? I was browsing and look what I…
-
2
votes1
answer33
viewsA: Error while running Function on another file
There are some errors in the code. It should look something like this: File structure SeuProjeto |--inserir.php |--class //folder |-------Envio.php With that your code would look like this:…
phpanswered Ricardo Mota 2,905 -
4
votes1
answer3418
viewsA: Delete folder and contents with php
You can use this PHP function that erases the folder and its internal files: function delTree($dir) { $files = array_diff(scandir($dir), array('.','..')); foreach ($files as $file) {…
phpanswered Ricardo Mota 2,905 -
0
votes2
answers2482
viewsA: How to send form data with onChange event to php
You can call the function so too: $(document).on('change', "[name='sexo']", function(){ getState(); });
-
0
votes2
answers1348
viewsA: Create an image with dynamic text overlay and send by email
To do the insertion of text you can do easily with JS. It would look something like this: $(function(){ $('#provider').keyup(function(){ $("#receiver").html($(this).val()) }); });…
-
1
votes1
answer86
viewsA: Change values depending on the selected checkbox number
You can do so according to your rules: var inputs = $('input[name="dias[]"]'); inputs.on('change', function () { var str = []; var control = 0; inputs.each(function () { if (this.checked) {…
-
0
votes1
answer104
viewsA: Error inserting record in child table with PHP
I believe the error is in $index When you do the foreach the index becomes a counter and not the regional value. Try to change the $index for $valor as in the example below. Or $valor['id'] if it is…
-
0
votes2
answers134
viewsA: Select in table records with Mxn relation
In this case your table is structured like this: |-----tb_usuario-------| |id - nome - flag_ativo| |----------------------| |--------tb_regional------| |id - nome - login - senha|…
-
2
votes2
answers501
viewsA: Text alignment problem within select and input
You can try it like this: .form-field{ min-width: 350px; height: 25px; border-radius: 0px; border: 1px solid; font-size: 13px; padding: 3px 6px 3px 6px; line-height: 30px; } label{min-width:…
-
0
votes1
answer5269
viewsA: Stylization of div in CSS
You can do it that way: .trap_section{ position: relative; width: 500px; border: none; margin-top: 100px; } #trap_top1{ position: absolute; top: -80px; border-top: 80px solid transparent;…
-
4
votes4
answers1313
viewsA: How to organize alphabetically a select obtained through a JSON?
@Marcelo an alternative is to sort with a js function. It would look something like this: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>…
-
1
votes1
answer37
viewsA: Jquery Mobile - Resources
Yes it is possible. Just do the custom download on this link: http://jquerymobile.com/download-builder/…
-
0
votes2
answers3050
viewsA: Is it possible to have a ternary without the Else block?
You can make it simpler in some ways: first if($total < 10) $total_gerente = 10; 2nd if($total < 10) : $total_gerente = 10; endif; 3º if($total < 10) $total_gerente = 10; I hope I’ve…
-
1
votes1
answer1499
viewsA: How to put a dropdown menu on a navigation bar using bootstrap?
If you are using bootstrap just follow the official documentation. It would look something like this: <script…
-
4
votes1
answer377
viewsA: Mount table with div
It would look something like this: .container{display: block;} .container img{float: left;margin-top: 7px;margin-right: 10px;} .container p{margin: 5px 0px;} <div class="container"> <img…
-
-3
votes2
answers155
viewsA: $_post error do not know where I’m going wrong!
In this case your form should look something like this: label{min-width: 135px;display: inline-table;} <form action="cadastro.php" method="POST"> <label…
-
5
votes3
answers605
viewsA: How to get a String size correctly using UTF8?
I suggest updating the settings. It would look like this: setlocale(LC_ALL,'pt_BR.UTF8'); mb_internal_encoding('UTF8'); mb_regex_encoding('UTF8'); $string = "PAÇOCA"; echo strlen($string); echo…
phpanswered Ricardo Mota 2,905 -
1
votes2
answers2126
viewsA: How to increase the size of the icon by hovering the mouse over a list
Ready. I changed some classes and styles: .social { margin: 0; padding: 0; } .social ul { margin: 0; padding: 5px; } .social ul li { margin: 4px; list-style: none outside none; display:…
-
1
votes2
answers222
viewsA: Error with fetch_assoc, how do I correct? echo does not return desired value
You do not need parameters in fetch_assoc() You can do it like this: $mysqli = new mysqli('localhost', 'root', '', 'mydb'); $sql = "SELECT * FROM times WHERE id = $id;"; $query =…
phpanswered Ricardo Mota 2,905 -
2
votes1
answer43
viewsA: Width caculum with jquery
Well, some considerations: Some attributes were accented as 'promotions'. This is not good and you may have future problems with it. The validation$ulPromo.width() > $promo.width()I don’t quite…
-
2
votes2
answers127
viewsA: How to check if at least 1 checkbox has been selected?
With this you check each one. And you can do what you want next. if(isset($_POST['carrosbr'])) //faça algo if(isset($_POST['carrosin'])) //faça algo if(isset($_POST['corp'])) //faça algo…
phpanswered Ricardo Mota 2,905 -
0
votes1
answer45
viewsA: Assign an Arttigo in more than one php category
In this case your tables in the bank should have more or less this structure: |--------artigo----------| |id - titulo - nome - etc| |------------------------| |---categoria---| |id - nome - etc|…
-
2
votes1
answer38
viewsA: Get team names on different tables!
Try this Marcos Paulo: SELECT locais.nome_locais as Local_do_Jogo, (SELECT times.nome_times FROM times where times.id_times = tabela.mandante_tabela) as mandante, (SELECT times.nome_times FROM times…
-
0
votes2
answers508
viewsA: How to save several radiobuttons in Mysql database?
Thiago When you submit the form the amount sent is only that of the radio selected. That’s because the radio group has the same name You can test like this: <form action=""> <p>Pergunta…
-
2
votes2
answers728
viewsA: Swap elseif code for switch case
You can try it like this: $num1 = $_GET['num1']; $operator = $_GET['operator']; $num2 = $_GET['num2']; switch (true) { case !is_numeric($num1) && $operator == '/': case $num1 == ''…
-
0
votes1
answer81
viewsA: Delete symbol from the last position of a string, optimally with PHP
I believe the second option is more optimized. $string = "minha_string_com_simbolo_no_final_"; print preg_replace("/\W$/", "", $string); Because it is a regular expression whose purpose is to…
-
4
votes3
answers418
viewsA: Is it possible to keep an object in a session variable?
Yes it is possible. Even you don’t need to use any additional function. It would look something like this: CLASS PERSON <?php class Pessoa{ public $name; public $idade; function count(){ echo…
-
0
votes2
answers661
viewsA: TEXT Inside a button - Materialize CSS
@Jonatas Almeida put the code to analyze. You need to enter the Materialize classes to work. It would look something like this: <link rel="stylesheet"…
-
0
votes2
answers986
viewsA: What is the best practice for integrating external content into my website?
You can use the file_get_contents function of PHP. This function reads all the contents of a URL and returns to a string. It would look something like this: <?php $url =…
-
1
votes2
answers1077
viewsA: Laravel Authentication Several Different User Types
Laravel already has what it takes for multiple authentication as of version 5.2. See this very simple video that explains in detail: https://www.youtube.com/watch?v=VuUX3NHsGag I hope I’ve helped.…
-
0
votes1
answer44
viewsA: Someone who knows the Ulkit framework
Elizer try to use meta tag: <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no, minimal-ui"> And test the site on an emulator like this:…
cssanswered Ricardo Mota 2,905 -
0
votes2
answers4430
viewsA: Foreign key - Insert table 1 ID into Table 2 PHP/MYSQL
It all depends on how your application will work. If image registration is done separately you will need a field with the product id. You can use a <input type="hidden" name"id_produto" value"ID…
-
0
votes1
answer197
viewsA: :Hover in previous element
Not possible with css only. You can do this easily with jquery see: $(".um").hover( function() {$(".dois").addClass('hover-btn-02')}, function() {$(".dois").removeClass('hover-btn-02')} );…
-
2
votes3
answers75
viewsA: Should I use Everywhere or just Fonts?
in is used in sources to help in responsiveness. If you are going to work with in be prepared to waste time with calculations. Many sites standardize pixel font sizes like globe and Uol. That…
-
-1
votes3
answers98
viewsA: Why are you making these mistakes? #Registration forms
<meta charset="utf-8"/><!-- Aqui precisa ser utf-8 -->