Posts by Atila Silva • 877 points
56 posts
-
1
votes1
answer94
viewsA: Difficulty in the methodology of programming and migration from mysqli to PDO
There’s not much mystery. //Abre a conexão $PDO = db_connect(); //SQL para contar o total de registros $sql_count = "SELECT COUNT(*) AS total FROM users ORDER BY name ASC"; //SQL para selecionar os…
-
0
votes1
answer23
viewsA: Plugins Wordpress Sign Up/User List
Whether it is possible or not depends on how the plugin you want to implement works. But in general you have this in the same database so list something just take a table and use the Wpquery Object.…
-
0
votes1
answer26
viewsA: Error while passing index of an array
You want to access a method that is not available for the variable: $_cliente['data_nasc_cliente']. see: $_cliente['data_nasc_cliente']->format('y-m-d'); To format a date you first need to build…
-
1
votes1
answer33
viewsA: Authenticated/Not Authenticated Redirect
The Laravel treats this in various ways. The recurrent way is the use of trait: Illuminate\Foundation\Auth\AuthenticatesUsers if you are using the default authentication provided by the framework:…
laravel-5answered Atila Silva 877 -
1
votes2
answers532
viewsA: Concatenate variable with id fetched by Javascript
When we reference an object in the document by its identifier (ID). We expect to get a single result. This is because id is just for this. To be unique. Your idea: <input type="text"…
-
0
votes2
answers48
viewsA: When applying a double click on the image of the ball a copy of the image is inserted in one of the Ivs randomly using this code snippet
Basically you insert a template inside the div var bol = document.getElementById("bola"); var x = document.getElementsByClassName("interna"); bol.onclick = function(){ var I =…
-
0
votes1
answer221
viewsA: Display calendar with PHP with certain conditions
Well. The idea is to use the index of an array that contains the css settings: If you have something that is not clear in the code. Just ask that I edit the answer. <?php…
-
0
votes2
answers47
viewsA: How do I create a "+" button that adds new fields to my form
I particularly love Vue.js. With it it is possible to leave the dynamics of html rendering in real time. This example automates the content display process. var app = new Vue({ el: '#inputs', data:…
-
0
votes1
answer55
viewsQ: Reactivity in event
I have a problem changing the rendering state of an element with Vue js. It was generated with a for. The goal is to get the box-body mini panel is displayed by clicking on button. however the state…
-
4
votes2
answers691
viewsA: Problems opening and closing file with fwrite
This happens because the parameter that functions fwrite() and fclose() accept is the open file reference fopen() and not the string to be inserted in the file $g_txt : $g_txt =…
-
1
votes3
answers364
viewsA: Manipulating values through Hidden input
Basically I store the history in a hidden input(Hidden). The idea is to send your php script the updated value of the history field in a post variable. Once it arrives in your script it is…
phpanswered Atila Silva 877 -
2
votes1
answer73
viewsQ: Standard phpmyadmin string search sql
I need to get the same result of a search in a table that returns me the same string portion and disregards the graphical accentuation of the search.…
-
1
votes2
answers2296
viewsA: Bootstrap - container with two columns and two rows of the same size
There’s been a change in the way you build grids of bootstrap 3 to the bootstrap 4 <link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" rel="stylesheet"/>…
bootstrapanswered Atila Silva 877 -
1
votes2
answers117
viewsA: I need a mask that always puts the negative sign in front of the typed value
A very simple implementation for this problem: $('#mask').keyup(function(){ if((this.value.search('-') == -1 && this.value.length > 0 )){ $(this).val('-' + this.value); } }) <script…
-
1
votes2
answers72
viewsA: How do I stream a file from my server?
Simple: /project txt_edit.php text.txt Code-txt_edit.php: if(isset($_POST['text'])){ $re = fopen("text.txt" , 'w'); $write = fwrite($re ,$_POST['text']); if($write){ echo "<script>…
-
1
votes3
answers246
viewsA: Comparison of dates in PHP
You can turn the date directly into an array with the explode function: <?php if(isset( $_POST['data'])){ $data = explode('-' , $_POST['data']); $nData = getdate(); $dataAno = $data[0]; $dataMes…
-
1
votes2
answers1050
viewsA: Combobox with Checkbox and Input Text options
I particularly love the Vue.js. With it it is possible to leave the dynamics of html rendering in real time. This example automates the content display process. Now you just need to receive this…
-
1
votes4
answers1294
viewsA: Hide or display HTML table line with Jquery
$('#filtro-uf').change(function(el){ let table = $('.table') ; let tableels = $('.table tr'); let find = "[data-uf='" + this.value + "']"; el = table.find(find); el.hide(); for (let index = 0; index…
-
1
votes2
answers1441
viewsA: How can I not allow the browser to save the password entered?
If there are password fields the browser will always ask if the user wants to save the password. This has no way of interfering. You can even add the attribute autocomplete="off" in your form:…
-
0
votes2
answers1675
viewsA: Error installing mongodb in windows
I don’t know why this happens exactly but the steps below helped me to solve the problem. Uncheck Compass install option Complete the installation Run the installer again: Mark Compass install…
-
1
votes1
answer26
viewsA: Error when changing a generated content within a <span> tag, automatically generated in Woocommerce
This happens because your theme loaded the jquery library after running its code: To add a script in wordpress you need to use the function add_action('wp_enqueue_scripts' , 'function_name'). The…
-
-1
votes2
answers1675
viewsQ: Error installing mongodb in windows
I tried to install the db Mongo in windows. I do the whole installation process but when the installation comes close to being finished the files and the installation folder of Mongo are deleted. An…
-
0
votes5
answers289
viewsA: Capture text within the option tag
You can do this in a variety of ways. It also depends a lot on what you need to implement. If only to store the values in a variable the example below demonstrates two cases: //Criando um id no…
-
0
votes3
answers789
viewsA: Fullcalendar show hour and minutes
Add to your personalizado.css inside the briefcase /css the rewriting of the following css rule: .fc-time-grid-event.fc-short .fc-time:before { content: attr(data-full); } This class defines the…
-
0
votes1
answer31
viewsQ: *ngFor client side
I’m implementing a crud where I’m using the ngFor to iterate a list. But I don’t know how to do it on the client side. I think this will only be possible by creating a component in my main.js . But…
-
2
votes2
answers207
viewsA: Does the PHP Datetime class support the creation of dates in the Brazilian format?
You can format the time in several ways by manipulating this object Datetime. The documentation of this php method brings numerous ways to do it. But as the question refers to the Brazilian format…
-
0
votes1
answer25
viewsQ: Render html for multiple folders on the server
I am looking for an implementation that allows me to publish the same html on several domains of my hosting. My goal is to centralize control of it in just one application. I would like to know if…
-
0
votes2
answers1670
viewsA: How to stop playing a video when closing modal
Place the code snippet at the end of your html document: <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <script>…
-
1
votes1
answer57
viewsA: How to list specific subcategories for each page?
The function get_the_category() returns an array with the current category objects. I then scanned all elements with foreach by storing the term ids in the array $cat_ids. Then I used the function…
-
1
votes1
answer60
viewsQ: Views and session variables available in sub domains
I am creating a web system in Windows where several sub-domains will be created to locate some services for users. Ex. panel.com, shop.dominio.com, etc. My question is: My variables created in the…
-
1
votes2
answers109
viewsA: How to bring SQL result grouped by year and within months
Well, not knowing what’s coming back is very difficult to answer. You can try this code. It creates an array to group your results into a multidimensional array. foreach($results as $row){ $mes =…
-
0
votes3
answers77
viewsA: Problems when generating schedules dynamically
You can return an array with the range values. And then create a function that generates the results. So you can manipulate these values in other functions more easily. Example: function…
phpanswered Atila Silva 877 -
1
votes2
answers1321
viewsA: Search Javascript array elements
You can do it this way: The method indexOf seeks the value (val) in the vector (vetor) if found it returns the position of the element in the array. If it does not find the value it returns -1. An…
-
1
votes1
answer584
viewsA: Bootstrap menu 4 with two lines
Follow an example: <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet"/> <nav class="navbar navbar-light bg-light…
bootstrap-4answered Atila Silva 877 -
2
votes1
answer867
viewsA: How to save data from a checkbox to a MYSQL field
Use : implode("delimitador" , array[]); this function transforms the array $_POST['chkrepertorio']) in a string. When the data (chkrepertorio[]) hits the server side, we can capture them as an…
-
2
votes6
answers30079
viewsA: How to insert HTML with Javascript?
Use ``to delimit a string in html var html = ` <!DOCTYPE html> <html> <head> <style> ul { list-style-type: none; margin: 0; padding: 0; width: 200px; background-color:…
-
3
votes1
answer40
viewsQ: Tree menu - Error selecting element (ul:onclick)
I have a problem in the tree menu below. When I click on the child elements of ul-0 I run the class change. How to avoid this ? function ready (fn) { if (document.attachEvent ? document.readyState…
-
2
votes2
answers67
viewsA: problem with form with tabs
If you are using bootstrap 4 and its dependencies you need only work with html. <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" /> <div…
-
0
votes2
answers58
viewsA: Problem sending something to database
Your problem lies in the fact that your includes are being made the wrong way. Let’s take the following example: index.php /includes/footer.php if I’m in index.php to include the footer just enough:…
-
2
votes2
answers70
viewsQ: Extract portion of characters using PHP
Hello guys I have the following string: '<a href="http://localhost/mensageiro/1990/">1990</a> (1) <a href="http://localhost/mensageiro/1994/">1994</a> (2)…
-
0
votes1
answer357
viewsQ: Request ajax with Slim
I have a form and the following requisition: jQuery('#cadastro').submit(function() { var dados = jQuery(this).serialize(); jQuery.ajax({ type: "POST", url: "/cadastrar", data: dados, beforeSend(xhr)…
-
2
votes4
answers1196
viewsQ: Different colors inside the tag H1
Is there any way to apply different colors to each snippet of a text within: <h1>Cor1 Cor2 Cor3</h1>
-
0
votes1
answer213
viewsQ: Validating date and CPF in the GUMP
I have two fields to validate: CPF and Date of Birth. $validation = [ 'email' => 'required|valid_email', 'data_de_nascimento' => 'required|date' ]; I’m getting the date in format: 00/00/0000…
-
0
votes2
answers33
viewsA: How to add background to an inline list ? And how to remove the default underline effect?
Menu is a id that references an object in the document so you need to use the Sharp "#" in front of the marking: #menu ul li {propriedades} If the reference were for a class the point comes forward:…
-
2
votes2
answers209
viewsQ: Get first value before comma
Hello I’m having difficulty storing the value of the day that precedes the comma: <span id="organizerContainer-date">Novembro 3, 2018</span> I would like to store this value to do some…
-
12
votes3
answers2531
viewsQ: How to select all columns except one in particular?
There is the possibility to select all columns of a table: SELECT * FROM wp_rw_programacao WHERE id = $id But I need to eliminate the result of the column id. It is possible?…
-
1
votes1
answer219
viewsQ: Query in date column with current week filter
I’ve been looking for a mysql command that does such a function. The purpose of this is that I have to display a current week’s item schedule. From Sunday to Saturday. Is there a query that makes…
-
5
votes2
answers5191
viewsA: HTML and SQL connection
You will not be able to make this connection with html. To do this you will need a programming language that supports this connection.
-
0
votes2
answers272
viewsQ: Changing default wordpress taxonomy
Currently the category pages of my site have the following taxonomy www.site.com/Category/program01; I cannot change this taxonomy to program/program01. Is there any way to make that change ?…
wordpressasked Atila Silva 877 -
1
votes1
answer27
viewsQ: Iterate array in input element
I need to generate a radio element according to the selection of a field. I’m having difficulties generating the block: need to fill Radius value in that block according to the array setting below:…