Posts by KhaosDoctor • 2,699 points
108 posts
-
1
votes5
answers98
viewsA: Conversion of object properties to numbers
You can use the methods parseInt(<string>) and parseFloat(<string>). You can see the use of these functions here. But in essence what they do is turn a string into a number, changing the…
-
1
votes1
answer170
viewsA: Delete part of text by delimiters
You can use regex to remove. If you are using PHP, you can use preg_replace (see on manual) with the following expression: \[.*?\]. Take a look at this example here: https://regex101.com/r/zX6gM2/1…
phpanswered KhaosDoctor 2,699 -
0
votes2
answers76
viewsA: Error of php --> mysql
The first parameter has to be the Mysql connection you are opening by mysqli_connect(). For you to use only the query you would have to use the static mode of the function with mysqli::query(). Take…
phpanswered KhaosDoctor 2,699 -
1
votes2
answers49
viewsA: Input file type as read-only
Change the property readonly for disabled. <script> $(document).ready(function() { $("#salvar").on('click', function() { $('#arquivo').prop('disabled', true); }); }); </script>…
jqueryanswered KhaosDoctor 2,699 -
2
votes1
answer672
viewsA: URL pattern in Restful service
Depends, the POST would be the most suitable method for insertion and not for updating. The idea of a REST service is to use the methods for each situation according to what they offer. The basic…
-
0
votes3
answers436
viewsA: Assign dynamic value to a variable in Jquery
Try it like this: $(document).ready(function() { var sts1 = ''; $('a').click(function() { sts1 = $(this).data('statusTipo'); }); });
-
1
votes3
answers695
viewsA: How to generate code in the javascript div
You can do so with jQuery: http://codepen.io/anon/pen/grxLjG $(document).ready(function() { var elemento = $('#Creditos'); if (elemento.length > 0) { elemento.text('Seu texto vai aqui'); } else {…
-
2
votes2
answers618
viewsA: Compare arrays
PHP has a function called array_diff. Basically what it does is what you want, the difference is that you will need to give a few more iterations, because it shows only the differences between two…
-
0
votes0
answers246
viewsQ: PHP processes never close
Hello, I’m having a problem related to a PHP system running through a Windows Service. The application works as follows: I have a folder with several files and PHP scripts that serve as an offline…
-
2
votes2
answers374
viewsA: Click on Notification Desktop and go to the same window without refreshing the page
You can use the window.focus(), however it is possible that this does not work on all browsers, since the security settings of each may vary according to the privacy policies of the user. There are…
-
1
votes1
answer177
viewsA: send the javascript variable to php
You can only do this if you call a page via AJAX (by post or get) or create a form in your main html that sends this variable to a PHP page. This integration you’re trying to accomplish has no way…
-
2
votes3
answers82
viewsA: Help with Regex
Whoa, buddy, try that regex: https://regex101.com/r/tX6fT8/1 His regex /^[A(D|G)|EX]{2}[0-9]{8}$/gm didn’t work because you didn’t group the letters AD, AG and EX leaving A free along with D, G and…
-
4
votes2
answers6432
viewsA: How to enable and disable links successively?
I managed to find a solution via jQuery, see if it fits you in this fiddle: https://jsfiddle.net/gf60xdgt/4/ Note only that I had to put the id of the first link to "link1" so I didn’t have to keep…
-
1
votes2
answers127
viewsA: How to access dropdonw value without refresh
You can do it like this: $('#s_dois').change(function() { var soma = parseInt($('#s_um option:selected').val()) + parseInt($('#s_dois option:selected').val()); alert(soma); }) See the fiddle:…
-
1
votes2
answers1631
viewsA: Check if data already exists in codeigniter bank
Try it like this: $this->load->database(); $query = $this->db->get_where('tabela',array('colunaemail'=>'email')); $result = $query->result_array(); if(count($result) > 0) {…
-
4
votes1
answer8046
viewsA: how to add phpmailer hidden copy
Using Addbcc should make it work normally $mailer->AddBCC("[email protected]", "test"); if(!$mail->Send()) { $error = 'Mail error: '.$mail->ErrorInfo; return false; } Try adding it before the…
-
4
votes2
answers258
viewsA: Mysql, selecting 4 related tables
I think there are some syntax errors, try this. SELECT morador.*, unidades.*, grupo.*, condominios.* FROM morador LEFT JOIN unidades ON ID_Morador = morador.id_unidades LEFT JOIN grupo ON ID_Grupo =…
-
5
votes8
answers1094
viewsA: Is it recommended to use constants for configuring a PHP project?
It depends a lot on the type of configuration you want to store and the architecture of your system. For example, settings that are managed per user, for example: color, size, style, layout and etc…
-
1
votes1
answer31
viewsA: Why isn’t the style sheet being loaded?
I think the problem is because you are using Rewritebase in your htaccess. And because relative Urls are always calculated by following the base URL, probably every time you enter a page the base…
-
3
votes3
answers294
viewsA: How to relate category instance to a product instance in PHP
I advise you to use builders, if I understand well the category property in the Product is another class "Category", then you can do so: class Categoria { public $nome; public __construct($nome) {…
-
1
votes1
answer35
viewsA: Serialize PHP data
Try using json_encode in the array and save the string it generates.
phpanswered KhaosDoctor 2,699 -
4
votes1
answer1842
viewsA: Calling PHP function by BAT file
You will have to create a PHP file, it may even be the same as you defined the function, but it will have more or less the following structure <?php suachamadadefuncao(); function suafuncao() {}…
-
0
votes2
answers70
viewsA: Install an application
There is a very simple software called Innosetup that does what you’re asking. It basically allows you to create a customizable Wizard by choosing the files that will be extracted as well as the…
c#answered KhaosDoctor 2,699 -
3
votes1
answer3380
viewsA: Assign null value to a field
I believe a simple update solves the problem UPDATE TABELA SET CAMPO = NULL
-
-1
votes3
answers331
viewsA: Find which items have been marked - Help with logic
If you have events in the checkboxes, just take the value of each one and add it to a variable. It depends on the language you’re using. If you want to make a simpler way that (maybe) works for…
-
1
votes1
answer701
viewsA: Windows Service 'System.Typeinitializationexception' on startup
Turns out the problem was a static variable. There was a definition that pointed to another class and then he was giving a Nullpointerexception. Following this link in solution number 5, the user…
-
6
votes3
answers7123
viewsA: Disable windows form maximize and minimize
The form has two properties that call Maximizebox and Minimizebox, just set to false:
-
2
votes1
answer701
viewsQ: Windows Service 'System.Typeinitializationexception' on startup
Hello, I am creating a windows service to perform a backup job. I have created other services before but never had a similar problem. Everything was going well, during the development I installed…
-
3
votes2
answers5590
viewsA: Windows Service - Error 1053 on Start
The problem was that on the computers of the newer clients, it had installed version 4.5 of . NET Framework, while for other clients the installed version was 4.0. My application was compiled for…
-
0
votes0
answers47
viewsQ: Opening fixed Channel data on ftp connection
I am trying to connect to several FTP servers via DOS command line, but whenever I try, it returns me the line 150 Opening data Chanel for file upload to server of "< file path >" And it stays…
ftpasked KhaosDoctor 2,699 -
6
votes2
answers2447
viewsA: What is the difference between define() and const?
That was answered in this question here: https://stackoverflow.com/questions/2447791/define-vs-const But the general thing is that even PHP 5.3 you couldn’t use const within the global scope, it was…
-
1
votes2
answers5590
viewsQ: Windows Service - Error 1053 on Start
Hello, I have a windows C# service that I have to install on several clients. My problem is that in some clients I can install and it works normally, but in some clients I can install the service…
-
2
votes2
answers778
viewsA: Node.js, Ror or PHP?
You can use several fines. PHP is an option, for example, Wordpress is a CMS that uses PHP as a back-end. All that you are talking about can be done using php, just like other languages, you can use…
-
4
votes3
answers641
viewsA: How to connect to Mysql only once, without having to instantiate every time?
For this to happen you would need to return the PDO object created directly by the class, try something like: class DB{ private static $conn = null; private static $tns = "Connection String";…
-
2
votes2
answers4210
viewsA: how to represent a monetary field with semicolons in javascript jquery
There are some ways to turn this into currency. External plugin You can use the Google Code plugin, formatcurrency to do this, download it here: https://code.google.com/p/jquery-formatcurrency/ By…
-
0
votes2
answers262
viewsA: Tag header, daughter of tag Section, inherits values from other tag header
Put a child attribute section.conteudo>header { }
-
1
votes1
answer454
viewsA: Search results for an API in php/json
From what I can see here, this request sends an ajax to the site http://api.elsevier.com/content/search/ where you can put the parameters, for example, my test query was "hi":…
-
2
votes2
answers1144
viewsA: Is JSON equal to an Associative array?
It has nothing to do. JSON is one thing and an associative array is something else. JSON stands for Javascript Object Notation, and is a kind of "Serialized Array", meaning you can generate it and…
-
0
votes1
answer1885
viewsA: Is it possible to change the template/graphical interface of a form in Windows Forms?
There are some libraries like QIOS, the Krypton and the Dotnetbar which allow you to change the look of the application, but I’m not sure if it applies to Forms as well. By my uses of these…
-
5
votes3
answers3171
viewsA: Read txt file for Select
Use fopen to read the txt file line by line in an array here we have a tutorial. The ideal I believe you have to play in an array or something of the kind to be able to read separately, more to make…
phpanswered KhaosDoctor 2,699 -
4
votes1
answer260
viewsA: Documentation in XML
There are a few ways to generate php documentation, but most of these API’s generate documentation by analyzing your code. I’ll leave some links here: phpdocumentor apigen phpdox phpdoc - In this…
-
1
votes2
answers1664
viewsQ: UTL_SMTP: Sending Accents
Hello, I am using Oracle XE 11.2 to send emails using the UTL_SMTP package, but whenever there are accents to the subject or message, it is replaced by a "?". Here’s what I got: I have a protocol…
-
0
votes1
answer658
viewsA: Create a foreach with a specific condition in PHP
There is a native PHP function called Array_map, it applies a defined function (in this case its validation) to each element of the array, see her handbook here. You can create something like:…
-
1
votes1
answer273
viewsA: Combobox with PHP status change in database
As the service orders are in a database, instead of performing a query with a restriction to the order ID, you will have to perform another query without restriction, or else with restrictions that…
phpanswered KhaosDoctor 2,699 -
2
votes2
answers1301
viewsA: Doubt about Request.Form
The Request.Form is used to obtain information from a Ubmit of an HTML form that was sent via POST. As the POST information is invisible to the user, you must recover through the Request method. The…
c#answered KhaosDoctor 2,699 -
1
votes3
answers4786
viewsA: Line break into email message
In C# use the Environment.NewLine sort of like this: String mensagem = String.format(customerRequest + Environment.NewLine + Environment.NewLine + "{0}", customerEmail);…
-
1
votes1
answer96
viewsA: How to pass array and show in another program
You can use javascript’s location, or use post via ajax. There are several ways to work with this array. Another option would be to transform the array into JSON and pass it via GET through the URL…
-
2
votes2
answers374
viewsA: Is it possible to build a pure HTML register?
Well, you can do this using HTML and PHP, but it would be necessary to handle server-side files, note that: It’s possible, but it’s not very safe since anyone with access to the server could access…
-
1
votes2
answers112
viewsA: Reactivate form to closure of other
You can do the same code in the secondary form, but I don’t think you can do it directly in formClosed, but in Formclosing, because this event is triggered before the form closes. The difference…
-
-1
votes2
answers396
viewsA: I run the PHP query but it does not display sum result in Mysql
Your query is wrong, you need to have a value after WHERE: SELECT SUM('valor') FROM vendascalc WHERE valor = <algum numero>
phpanswered KhaosDoctor 2,699