Posts by RFL • 6,205 points
308 posts
-
3
votes1
answer53
viewsA: About each, this and attr in jQuery
The each is basically to make a loop through an array or object, for example: var meu_array = [1,2,3,4,5]; $.each(meu_array, function(index, value){ console.log(index); // Exibira o numero do…
-
2
votes2
answers172
viewsQ: Capture Document click to close menu that is open
I’m implementing a function in my menu where it will close the content of dropdown that is open IF the click is anywhere else except in the menu itself. $(document).click(function(event) { var…
-
8
votes3
answers2397
viewsA: How to check if there is a certain number in a php variable?
Use the delimiters inside the string you are looking for: $numeros = "1 2 3 4 5 6 7 8 9"; preg_match('/1/',$numeros); // Você pode usar / ou #
-
1
votes4
answers9132
views -
1
votes2
answers1781
viewsQ: Keep image dimension inside div with flexbox
I have a divwith display: flex and within this div there is an image with dimension of 670x227 (natural), because she’s inside a div with flexbox she is "resized" horizontally to fill the entire…
-
2
votes1
answer138
viewsQ: Check index in Dict
I have a function that returns me 2 results, None or dict however I am trying to verify if a key specifies this in the result of this function. def get_language(card): if not card.foreign_names ==…
-
7
votes3
answers262
viewsA: How to validate strings?
You can use the function array_filter to take all values that are compatible with regex. $arr = array( 'www.adorocinema.com/filmes/filme-226616/fotos',…
-
0
votes2
answers291
viewsA: Problem with login in Laravel 5.3
Are you comparing to string NO hash with hash string. $data = [ 'username' => Input::get('username'), 'passwd' => Input::get('password') ]; Use with the Hash: $data = [ 'username' =>…
laravel-5.3answered RFL 6,205 -
2
votes3
answers918
viewsQ: How do I make the OPTIONS list of a SELECT transparent?
My form has the inputs with the placeholderin white and background transparent, to make everything uniform I need to put the select field in the same style; background transparent and font in white,…
-
-1
votes2
answers4144
viewsA: How to create a secure login system connected to the database in Laravel 5.3?
You can use the generator Auth standard of the Laravel. php artisan make:auth Login, registration and "dashboard" (post login), model and controller views will be generated automatically. You may…
-
2
votes1
answer705
viewsQ: Access Dict within list
How do I access the dictionary containing the Portuguese language of the list below? To access the key: variavel.foreign_names, but I would like to take the values that are inside the dictionary…
-
0
votes0
answers27
viewsQ: Sqlite3 terminates INSERT without error
In my code I run a loop where I download some images of a URL and then save the name of the image in sqlite3, but after a few inserts the code simply ignores the line where the insert. if…
python-3.xasked RFL 6,205 -
0
votes2
answers123
viewsA: How to generate search result shortcode for a PHP system in a PHP page?
You need to create a API in your system PHP and a plugin for Wordpress so it consumes the data of its API.
-
5
votes2
answers76351
viewsA: link to an image to be redirected to another site
within your href= place http://www..... or just //www....
-
1
votes2
answers192
viewsA: load div with ajax without error in the answers
Ideally you use the function blur() of jquery to perform the ajax. The function of keyup() is to observe each change of the input, ie each key typed, so your ajax is making a request each time the…
-
4
votes2
answers2598
viewsA: How to Insert Taking Data from FORM in Laravel 5.2?
You need to point your form to the route where the destination is the function you will be entering, for example; Your form: <form method="post" action="{{ route('cadastro/novo') }}"> ...…
-
1
votes3
answers249
viewsA: Disable button in modal window using Jquery
To create a button you don’t necessarily need to put it inside a tag <a href..., you can simply create with; <button class="btn-enviar-lembrete">Enviar</button> Javascript will look…
-
2
votes2
answers134
viewsA: Check ip, register in array, convert to json and write to file
You can use the function array_filter to check if the new IP already appears in an array of registered IP’s; $jsonRaw =…
-
2
votes3
answers137
viewsA: Function to double salaries in n installments?
Here is my solution using the classes DateTime and DateInterval function parcelas($total, $quantidadeParcelas, $vencimento) { if ($quantidadeParcelas > 1) { $dados = array(); $valorParcelas =…
-
5
votes4
answers1313
viewsA: Capture user-typed input with PHP Shell
You can use the function readline() Take the example; $nome = readline("Qual o seu nome?: "); You can also add the input data to have a complete list with readline_add_history($sua_variavel); and…
-
1
votes2
answers78
viewsA: alignment of div and summarize text
I used the property flex to align the content, see how it looked... .container { margin: 10px auto 10px auto; width: 100%; border-radius: 4px; background: #FFFFFF; } .container-head { color:…
-
1
votes3
answers380
viewsA: Use variables outside the function
The keyword use is only permitted in anonymous or clousures functions as in the example below; $message = 'Hello'; $example = function () use ($message) { var_dump($message); }; $example(); See…
-
0
votes1
answer36
viewsQ: Replace string read from a file
I’m creating a routine using the Symfony console to create new controllers from a pre-existing template file, but when searching for pattern defined in this template, the class SplFileObject jumps…
-
3
votes1
answer335
viewsQ: Render view through controller using Slim Framework 3
I’m trying to find a way to render the view using a controller on slim framework but for some reason I’m getting the error: Message: Using $this when not in object context The function is a public…
-
2
votes4
answers130
viewsA: How to format this array?
I believe the easiest and most organized way would be to use the array_map $id = 10; $arr = array_map(function($index) use ($id) { $index['id_assinante'] = $id; return $index; }, $dados); Performing…
-
0
votes3
answers340
viewsA: Responsive alignment on footer
You can use some other css properties with flex, see below; footer { display: flex; } .section { flex: 1; padding: 15px; } The estate flex: 1 defines that each element within footer (sections) must…
-
2
votes2
answers407
viewsA: How to give a blank space between 2 input-group?
You can set a margin for the input-group .input-group { margin: 5px; }
-
0
votes1
answer22
viewsQ: Page call using Class in Wordpress
I am working on a plugin and created a class to display the option in the side menu and the content of the page related to this plugin, however I do not know how to display the content within it. I…
-
2
votes1
answer1135
viewsA: Change the position of the button next to Carousel Bootstrap
The slide is responsive, so it will take up the space you have available. Place the slide inside a container or inside a container col-, this way it will follow the size you indicate the element…
-
2
votes1
answer81
viewsA: Code improvement
You can start by organizing the HTML better, the elements do not need to have an ID to capture your click or the element itself, for example; <div class="slide"> <div…
-
5
votes1
answer94
viewsQ: Upgrade to PHP 7 Ubuntu
After updating PHP on my Ubuntu server my phpinfo() continues showing the previous version 5.5 even when executed php -v (returns to version 7.0). I’ve tried Re-start on apache and on php7.0-fpm and…
-
1
votes3
answers222
viewsQ: Check if there are equal fields in a form
I have a form with 5 selects and I’m trying to verify if any of these selects are of the same value. $('form').submit(function (event) { var $commitment = $("[name='commitment']").val(); var…
-
2
votes1
answer2020
viewsA: Maximum Execution time of 30 Seconds exceeded MPDF
Place at the beginning of the file set_time_limit(0); set_time_limit sets a maximum execution time for a script, but if you set it to 0 no limit is set. (see the PHP documentation)…
-
5
votes1
answer1710
viewsA: Global variable - codeigniter
You can use the codeigniter native function vars() You basically need to define which variables you want to make global using $this->load->vars(); Place this function in the codeigniter "base"…
-
7
votes6
answers40933
viewsA: Does ternary surgery exist in Python?
Yes, in the tender operation you use the if and else normally. y = "par" if x % 2 == 0 else "impar"
-
0
votes2
answers386
viewsA: Last lastInsertId ID
The last ID inserted is saved in your database instance. Conecta::getInstance()->lastInsertId();
-
0
votes1
answer687
viewsA: MYSQL extension error
This message is not an error but a "warning". The function mysql will be removed from PHP very soon and the message is suggesting you use mysqli_ or PDO. You can learn more about the mysqli in the…
-
1
votes2
answers679
viewsQ: Rename column with Rails using Migration
I created a Migration to rename a column and only get the error; Undefined method `to_sym' for nil:Nilclass == 20161001182840 RenameColumnPasswordInUsersPasswordToPasswordDigest: migrating --…
-
1
votes1
answer653
viewsA: Error in Mysql installation
I was able to resolve by restarting the pc and installing sudo apt-get install mysql-client-core-5.7 and then the sudo apt-get install mysql-server…
-
0
votes1
answer653
viewsQ: Error in Mysql installation
After trying to install LAMP package on Ubuntu 16.04, I am getting the error: ERROR 2002 (HY000): Can’t connect to local Mysql server through socket '/var/run/mysqld/mysqld.Sock' (2) I have…
-
2
votes3
answers122
viewsQ: View related data during Iteration
I created a relationship between the models client and content and I can access their data using the console normally. con = Content.find(1) con.client.name # Nome do cliente But when I try to…
ruby-on-railsasked RFL 6,205 -
2
votes2
answers218
viewsQ: Add new field to the bank with Rails
I inserted a new column in my table contents and also includes the field in the form with the same column name in the creation table (client_id), but this data is not entered when I create a new…
-
5
votes2
answers79
viewsQ: Find 2 date attributes in a single element
How can I find a particular attribute that contains another specific attribute? for example: <a class="fc-draggable" data-belongs="3" data-target="2"></a> I can select all elements that…
-
1
votes1
answer199
viewsA: Googlemaps - Codeigniter - PHP
In the very link you reported there is a video of how to use the library, in this video is shown exactly what you need. The part you seek is in 7:04 minutes $market['infowindow_content'] = 'SEU TEXT…
-
0
votes2
answers55
viewsA: Check when writing to BD
At the beginning of your code you declare the variable erro like 0; $erro = 0; And in the end you check if error is equal to 0; if ($erro==0)... Like $erro has already been set to 0 it will fall as…
-
3
votes1
answer52
viewsA: Doubt with array search
You can use the name of the variable followed by the field you want to pick, for example. $contagem['facilidade']
-
0
votes0
answers97
viewsQ: Laravel on dedicated server
I’m trying to install the laravel in a subfolder within public_html, inside the folder where the application is .htaccess. <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{REQUEST_URI}…
-
1
votes3
answers379
viewsA: How to convert database timestamp to fill a datetime-local field?
I input of the type date HTML5 only accepts one type of formatting, which is AAAA/mm/dd that is to say 2016-09-19, knowing this you can do as follows. <input type="date" class="form-control"…
-
0
votes1
answer62
viewsA: How can I center my dropdown menu?
This is easily solved using display: flex in your class menu, for example; .menu { display: flex; -webkit-display: flex; -moz-display: flex; -o-display: flex; align-content: center; justify-content:…
-
1
votes3
answers1027
viewsA: LARAVEL 5.3 Blade template is not updating the page
You don’t have to type .php or .blade.php in the URL to access a page, use only the name of the route that retorna (return) to view, for example; Route::get('home/paginax', function(){ return…