Posts by Pedro Souza • 1,631 points
49 posts
-
1
votes1
answer189
viewsA: Error 404 in project
You cannot appropriate a domain .with.br and simply set it up on your apache server as a virtual host, it doesn’t work. For this purpose you wish to exist the domains .test. To configure this domain…
-
-1
votes2
answers198
viewsA: PHP page does not receive data via POST
The problem appears to be the path used in your action. When you start using the "/" character, this indicates the root of your server. That is if you are running on localhost, literally he will…
-
4
votes2
answers207
viewsA: PHP - Trait or Extended Class
To answer your questions we need to make it clear what they are Traits. What is a Trait? Traits are individual pieces of code that define methods that can be used by different classes to provide…
-
2
votes1
answer46
viewsA: How to "raise" classes in the bank using also confirm javascript
You are wrong about the form of communication Javascript -> PHP. The PHP is interpreted in the back-end (server), ie no code you write in PHP goes to the front-end (client). So you need to do the…
-
2
votes2
answers181
viewsA: How to assign to a variable the results of an array
Very simple, I will adapt your code by adding comments of some changes I made, see: Code of Model: public function select_horarios_selecionados($data, $horarios=array()) { if(is_array($horarios)) {…
-
0
votes4
answers2055
viewsA: SSL: no Alternative Certificate Subject name Matches target host name 'xxx'
Try to use the options CURLOPT_SSL_VERIFYHOST and CURLOPT_SSL_VERIFYPEER together, both with value FALSE. Should solve your problem. <?php $arr["oi"] = "tchau"; $ch = curl_init();…
-
0
votes1
answer64
viewsA: Codeigniter 3 My_model database
Checking out the documentation of Codeigniter 3, the solution indicated by them to create dynamic connections without pre-set parameters in the file database.php, would use the function…
codeigniteranswered Pedro Souza 1,631 -
2
votes5
answers459
viewsA: Concatenate id by description into an array in javascript
There are several ways to do this. I recommend using the Javascript method forEach to iterate over your array, and compose a new array. It would look something like this: // Array com os valores…
-
5
votes3
answers85
viewsA: How do you adjust my query date?
There are several ways to do this. I recommend the following: // Recebe a variável com a data, e cria um objeto DateTime a partir do formato especificado. $objetoData =…
-
1
votes1
answer343
viewsA: Duplicate <div> without duplicating Javascript
I simplified your code, and used only one command on Jquery, that I saw was included in your code. First the code Javascript, forget all those functions, just use this: <script…
-
0
votes1
answer491
viewsA: Mysql, PHP and HTML communication
Try to organize your code better, and whenever possible separate the HTML of PHP. Your problem for what you understand is focused on the connection to the database, I suggest making the following…
-
1
votes3
answers737
viewsA: Save auto_increment id of a table to another table in the same file
The best way to do this is by using the function mysqli_insert_id(). But this implies that the primary key of your table has the characteristic AUTO_INCREMENT, that is, your key must have been…
-
2
votes1
answer478
viewsA: How to find out which path is followed by a function in js
There is a way to find out who called the function, through the local variable arguments. Note that this method only works if you are not using it Strict mode, that is, the file cannot contain 'use…
javascriptanswered Pedro Souza 1,631 -
1
votes1
answer35
viewsA: Row and column javascript/Jquery
There are several ways to do this. When you say print, I will use the console to show the result. var numero = 7; // Número inserido pelo usuário. var caracter = 'x'; // Caracter que deseja…
-
0
votes1
answer57
viewsA: I’m having difficulty formatting a date, it is in this format Mon Jul 30 2018 00:00:00 GMT+0000
From what I noticed you are sending a javascript date variable directly. It would be more plausible to format it before sending it to the server. The format that will be stored by DateTime of Mysql…
-
1
votes1
answer1026
viewsA: Receiving data via Ajax in PHP
Your problem is in the data format sent to the server. In the ajax request you say that the contenttype is application/json, soon PHP will not popular this in the variables $_POST, it is up to you…
-
1
votes4
answers730
viewsA: Catch the subdomain with PHP
Use the variable $_SERVER['HTTP_HOST'], it will return the full host, including subdomain. Soon using the following command, you will get the result you expected: echo 'http://' .…
phpanswered Pedro Souza 1,631 -
5
votes2
answers154
viewsA: What to do so that when the user hovers over an image, it expands a little? ( preferably using only HTML and CSS)
It’s pretty simple, you just really need to CSS. Follow an example: .grow { transition: all .2s ease-in-out; } .grow:hover { transform: scale(1.1); } <img class="grow"…
-
2
votes4
answers1933
viewsA: How to choose a convention for variable and function names?
There are several conventions you could adopt. The most commonly used, and that fits perfectly both in the PHP how much in the jQuery is the call Camelcase. Definition: Camelcase is the English term…
-
1
votes3
answers2682
viewsA: How to do horizontal scroll with screen size Divs
If I understand what you want, it’s what’s in that example I did: Here I only modified your CSS: .wrapper_child > .tab { width: 25%; height: 100%; text-align: center; display: inline-block;…
-
1
votes1
answer32
viewsA: Result after update
When using the console.log() with a concatenated string, it is not always possible to visualize the actual return. Utilize console.log(data);, thus passing the variable directly.…
-
1
votes1
answer35
viewsA: Remove cover or change, blogger
Both things are possible, make invisible or change the background to an image. To make invisible change the value of the property display of CSS for none. #hen{ background-color: #c82de5;…
-
1
votes1
answer30
viewsA: Site error after server exchange
It seems you wish to carry one view. The right should be to use the following command: class Home extends CI_Controller { public function __construct() { parent::__construct(); } function index() {…
phpanswered Pedro Souza 1,631 -
0
votes1
answer158
viewsA: Compare two number arrays
If I understand correctly you have two arrays with the same amount of elements, which must be compared on the basis of their index, to determine whether the former has a value greater than the…
-
2
votes2
answers471
viewsA: What advantages does angular typing offer?
Yes the Angular is an amazing framework. And now in version 4 is becoming more stable and concise. But the key question is typing. And responsible for it within the Angular is the Typescript. What…
angularanswered Pedro Souza 1,631 -
2
votes2
answers2803
viewsA: What is the most appropriate content to put in the header or Nav?
Right or wrong in this case does not exist. There is recommended according to the specifications of HTML5. In the HTML4 by the fact of all semantic sections with the tag <div> are part of the…
html5answered Pedro Souza 1,631 -
3
votes1
answer173
viewsA: Delphi - Executable with different behavior on different machines
Usually in such cases there is some process being executed in the Main Thread, and delaying the execution of your Looping For. A possible solution would be to run Looping in a Secondary Thread.…
delphianswered Pedro Souza 1,631 -
0
votes1
answer70
viewsQ: Use preg_replace on condition
I have the following string, which can be the representation of an HTML or XML, makes no difference: <node1> <node2>Conteudo exemplo</node2> <node3>Conteudo…
phpasked Pedro Souza 1,631 -
4
votes1
answer228
viewsQ: Using Foreach in PHP
The builder foreach provides an easy way to iterate on arrays. In several scripts we can observe the following usage: foreach ($array as $value) { $value = $value * 2; } However, in some cases the…
-
6
votes2
answers1283
viewsA: Delete contents including folders
If you want to keep the root directory for some reason and really want to empty it, then you can do the following: del /q caminho_destino\* for /d %x in (caminho_destino\*) do @rd /s /q "%x" The…
cmdanswered Pedro Souza 1,631 -
0
votes1
answer130
viewsA: Recover all events using Fullcalendar
To capture all events, use: // Obter array de eventos var eventos = $('#calendar').fullCalendar('clientEvents'); This command will return an array of all events, and consequently within each event…
-
0
votes5
answers2126
viewsA: function to count Divs quantity
As the question did not specify the use of Jquery, I think it fits a solution with Javascript Vanilla: // Obter a quantidade de divs var quantidadeDivs = document.getElementsByTagName("div").length;…
-
1
votes2
answers844
viewsA: How to separate tags from a variable in PHP array
The reasoning basically would be to create a function that can replace all HTML tags with a "generic tag" let’s call it that, and use the command explode, to turn this string into an array. This…
phpanswered Pedro Souza 1,631 -
14
votes1
answer294
viewsA: Will-change CSS property: when to use?
Initial Considerations The CSS property will-change, was created with the main intention of enabling browsers to perform optimizations in advance, before the element is effectively modified. How…
cssanswered Pedro Souza 1,631 -
3
votes1
answer1028
viewsA: Delphi - Datasnap - Rest - Tservermethods1
You just need a connection between the DSServer1Connect with the classes ServerMethods. The idea here is to store the information in an array for example and retrieve it later from within the…
-
1
votes1
answer405
viewsA: DASHBOARD - Can you export to Browser?! (Any language to the web)
Your question is very wide, before that I will show you the best way forward. There are ways to convert Excel for HTML yes, but this is only effective if we are talking about a spreadsheet in common…
-
2
votes2
answers1590
viewsA: Delphi + Firemonkey: dynamic component design created at runtime
There are a few ways to deal with this issue. I’ll explain how I did the last time I needed something similar. First you will need a variable that will hold the value of the last, let’s call,…
-
16
votes2
answers1361
viewsA: How can I use javascript async/await?
Asynchronous Functions First of all we need to say that these Keywords are part of ES2017 (Ecmascript Latest Draft (ECMA-262)). Let’s go in pieces, first on the async. In declaring a async Function,…
javascriptanswered Pedro Souza 1,631 -
5
votes2
answers745
viewsA: How to format php date, to display 'Today at 00:00' and 'Yesterday at 00:00'?
There are some ways to deal with this situation. I’m going to explain here a simple way: <?php function converterData($data){ $dInicio = new DateTime($data); $dFim = new DateTime(); $dDiff =…
-
1
votes1
answer1206
viewsA: How to create expandable banner with HTML5 and CSS3 only?
You can do this through Fade in Overlay, with CSS and HTML. Run the code below and see how it works. .container { position: relative; width: 50%; } .image { display: block; width: 100%; height:…
-
2
votes1
answer155
viewsA: Select Md-option with ng-click
It’s actually quite simple to resolve this issue. On the button you made the function call ng-click="vm.rolar_formulario(v.name)", passing as parameter what I understood the name of the vacancy. In…
-
0
votes1
answer273
viewsA: Calling separate functions via Ajax with Jquery in PHP
The ideal would be even you use REST API to be able to directly access the function you want, I recommend giving a read on the subject. If there is also the possibility, it would be interesting to…
-
1
votes1
answer64
viewsA: Consult results using SQL or tips on programming in XAILER
Well I’ll do a translation here of what you said you need: TITLES - Would be all the titles, inside the filter you’ve already determined. PAID SECURITIES - Would be all titles, inside the filter,…
-
0
votes1
answer277
viewsA: How do I save an array of quantities and sizes for a product? PHP
Well I’ll try to organize things better, because your explanation was not very clear to me at least. Let’s say we have a table of products first: CREATE TABLE IF NOT EXISTS `produtos` ( `ID_PRODUTO`…
-
0
votes2
answers140
viewsA: How to Not Accumulate Effects in Hide and Show
I’ve visualized your problem, friend. function functionHide() { $("div").hide(1000); } function functionShow() { $("div").show(1000); } The statement of the above functions are ok. The problem is…
jqueryanswered Pedro Souza 1,631 -
2
votes1
answer284
viewsA: Clarification of MVC archiving in PHP
Good afternoon friend, In the MVC world, we have fundamentally 3 items to observe: Model Whenever you think about data manipulation, think about model. It is responsible for reading and writing…
-
0
votes1
answer133
viewsA: how to convert my object into a string?
Your question is very poorly worded, and there is a lack of information from the file you made include so I can understand exactly what is happening, but I will try to help you follow the correct…
-
3
votes1
answer81
viewsA: View the year and month that is coming from the array
What you have is an array, a multi-dimensional array. To resolve this issue you will need to nest one foreach inside another. It would be basically this: <ul class="blogcat"> <?php foreach…
phpanswered Pedro Souza 1,631 -
1
votes2
answers1131
viewsA: Close modal when updating page after insert
Good indeed your problem is in the behavior of the browser by pressing the F5 key or even the update button. By default browsers redo the last executed operation, which in your case is a POST to the…