Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
1
votes1
answer31
viewsA: PHP inside the Array
Supposing you are using this: https://wordpress.stackexchange.com/a/278432 Just use the function only get_the_slug instead of the_slug Change: $args = array('category_name'=>'<?php the_slug();…
-
1
votes2
answers1350
viewsA: Is there any way to receive email through php or in some other programming language?
Yes, you can get emails through the native API (since you mentioned phpmailer, I think you’re working more with php): http://php.net/manual/en/book.imap.php Grab folders ("INBOX"s) with PHP: $config…
-
4
votes2
answers1213
viewsA: Is there any way to connect Python to a Websocket as a client?
Yes, there is that (there must be more, maybe enumerate later): https://pypi.org/project/websocket-client/ (Pip) https://github.com/websocket-client/websocket-client (repository) Install via Pip:…
-
0
votes2
answers2195
viewsA: Uncaught Typeerror: $(...). live is not a Function
The use of $('.nav-toggle').on('click', function() { is not equivalent the use of $('.nav-toggle').live('click', function() { of the old API. Namely the .live identified when the DOM was modified…
javascriptanswered Guilherme Nascimento 98,651 -
1
votes1
answer38
viewsA: Uncaught Typeerror - Can’t find the solution
It’s simple, is a typo your, you defined the initEvents within the function elementesPrototype() {...}, sure would be: class WhatsAppController { constructor() { console.log('WhatsAppController ok')…
javascriptanswered Guilherme Nascimento 98,651 -
1
votes1
answer31
viewsA: How to search for data in MYSQL using Regular Expressions?
You could experiment with LIKE even, since the intention seems to be to seek only by the number that comes before the LVL, thus: WHERE (`cartas` LIKE '(1201LVL%;' OR `cartas` LIKE ';1201LVL%') AND…
mysqlanswered Guilherme Nascimento 98,651 -
2
votes1
answer1825
viewsA: Where can I find the php.ini file on my hosting server?
Create a info.php in public_html and put this on him: <?php phpinfo(); Must return: Loaded Configuration File php.ini main Scan this dir for additional .ini additional scans of specific…
phpanswered Guilherme Nascimento 98,651 -
7
votes1
answer105
viewsA: What is currentColor and how do I use it in CSS?
He’s not an attribute, the currentColor is a key word which is used in CSS attributes, since CSS1 and CSS2 is possible to use in borders (in border-color), what it does is that the property set…
-
2
votes4
answers1737
viewsA: How to use "wildcard" in "CLASS" selectors with jQuery.expr?
Unfortunately all other answers are wrong, managed the wildcard/wildcard behavior, but did not understand that the behavior has to be as is the selector .classe, just as it is in CSS2, CSS2.1 and…
jqueryanswered Guilherme Nascimento 98,651 -
3
votes3
answers1195
viewsA: I need to take the current URL and know if after index.php you have "?" or "&"
Wouldn’t it be simpler to use $_SERVER['QUERY_STRING'] which is made for exactly this? If I understand you want to add to existing links, it should look like this: $querystring =…
urlanswered Guilherme Nascimento 98,651 -
1
votes1
answer183
viewsA: How to apply mask in a field in this format "000 000 0"?
I believe the limit is 13 characters in the mask, because of the format 000 000 000 0, then start applying maxlength="13" to prevent the user from typing too many things. In the example I used 2…
javascriptanswered Guilherme Nascimento 98,651 -
1
votes2
answers55
viewsA: Field with # does not appear in Mysql for _GET
You’ll have to encode it, because the # direct is recognized by the browser with "dynamic URL" which is used primarily to interact in front-end, with HTML, CSS and Javascript, including made a…
mysqlanswered Guilherme Nascimento 98,651 -
2
votes2
answers770
viewsA: Cannot read Property 'setAttribute' of null com ngFor
I recommend using Angular itself, you don’t have to do things like that manually. Use querySelector and querySelectorAll for elements that change constantly with Angular is quite unnecessary and on…
-
6
votes4
answers2971
viewsA: Identify how many days the month has (28, 29, 30, 31)
How did I respond in /a/109277/3635 I would say that the best way to do this is by using a native function created for this: echo cal_days_in_month(CAL_GREGORIAN, 8, 2018);…
phpanswered Guilherme Nascimento 98,651 -
1
votes3
answers713
viewsA: Send a string name via post using javascript
There are many mistakes, even w3schools which is a source that I never recommend has examples ready for you to know how to do that would already give a good idea, I sincerely hope you do not…
-
4
votes3
answers94
viewsA: Change given inside date attribute
If the browser does not support .dataset then you can use .setAttribute to exchange the value and .getAttribute to get him, so: var teste = document.getElementById('teste');…
javascriptanswered Guilherme Nascimento 98,651 -
2
votes1
answer141
viewsA: Access WS with file_get_content using proxy list
It’s because this is wrong: $arrayReturn = json_decode( @file_get_contents($URL), true, $cxContext ); The $cxContext has to go in the file_get_contents, thus: $arrayReturn = json_decode(…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer237
viewsA: Error saving to mysql
If you want to get a sense of the error, just do something like: $qry = "INSERT INTO trabalhe (id, nome, email, cpf, telefone, cidade, interesse, mensagem, nome_arquivo, arquivo, tipo) VALUES (0,…
-
1
votes4
answers730
viewsA: Catch the subdomain with PHP
If virtualhost is well configured then SERVER_NAME should work well, but I believe your case is another way, such as proxy reverse or else the hosts for your applications are solved by header Host:…
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer683
viewsA: Better understanding max_user_connections count in Mysql
I will simply enumerate: Despite the name the max_user_connections not related to users, PHP is the "client-side" of mysql, so each connection with the Apis as: mysqli_connect new PDO It is that…
-
2
votes1
answer45
viewsA: Jquery mask that accepts values up to 10.0
If the decimal place has a single digit limit, you can first use maxlength in the <input> 4-digit (largest expected number is 10.0 - since it contains the "mascara") and then apply a function…
jqueryanswered Guilherme Nascimento 98,651 -
5
votes1
answer305
viewsA: How to extract a chunk of an xml using PHP?
Don’t use Regex for that, not that it won’t work, but if anything changes in xml SOAP you will have to maintain your regex for sure, and until maintenance occurs everything will be broken. What you…
-
1
votes3
answers465
viewsA: Join arrays by equal keys, but separating values
A single foreach with array_key_exists would already solve the problem, because this way will only iterate once, example with a function (does not need to be a function if will use only once):…
phpanswered Guilherme Nascimento 98,651 -
4
votes1
answer706
viewsA: Remove Cookie when closing your browser
It is impossible to ensure that this occurs, especially if the user uses the keep "session", when reopening the browser the tabs are restored to the last state, for example in current browsers…
-
1
votes1
answer101
viewsA: "npm install" of a . tgz without internet connection
According to the https://docs.npmjs.com/cli/install it is possible to use NPM with local packages, supported commands: npm install (sem argumentos) npm install [<@scope>/]<name> npm…
npmanswered Guilherme Nascimento 98,651 -
8
votes2
answers71
viewsA: How to style links and images that are referenced in HTTP and not in HTTPS?
The selector src*="http://" is incorrect for this, because the *= indicates that it will fetch in any place of attribute, the correct selector to use would be ^=, CSS2.1/2.2 selectors for attributes…
-
1
votes2
answers211
viewsA: Php Numeric Format of 000 000 0
You can use the function chunk_split, which is used to divide the string by a character in sequence of intervening them, an example of use is to divide a BASE64 into a format compatible with RFC…
phpanswered Guilherme Nascimento 98,651 -
3
votes2
answers133
viewsA: How to set a variable in the configuration of a Virtual Host, to avoid repetition?
In Apache Core there is the Define, as documented: https://httpd.apache.org/docs/2.4/mod/core.html#Define It is used to define variables Define root_dir /var/www/meusite <VirtualHost :80>…
-
1
votes1
answer386
viewsA: Html, doubt about compatibility with Internet Explorer
Has not polyfill or self-prefix that will solve this 100% case, display: grid is something super new, of course maybe for IE11: #main { display: grid; display: -ms-grid; grid-template-areas: "header…
-
0
votes1
answer94
viewsA: Error creating database in postgres using Ruby On Rails in windows 7
Probably you did not install the module for postgresql, to install use: gem install --pg
-
1
votes1
answer279
viewsA: How to get a Blob Answer with Angularjs?
I believe that the application/json be relative, anything can be blob, even if it is plain text, since Blob is a Javascript API: https://developer.mozilla.org/en-US/docs/Web/API/Blob Serves to…
-
0
votes1
answer443
viewsA: rvm installation on windows 7
In any version of Windows you need to install the: https://cygwin.com or the: https://docs.microsoft.com/en-us/windows/wsl/about Then install the keys: https://rvm.io/rvm/install#install-gpg-Keys…
-
2
votes5
answers1314
viewsA: How to turn a Pyqt5 project into an executable?
Before I start I need to mention important details, several answers as being Pyinstaller the solution, but this is only part of the resolution, what people need to understand is that Pyinstaller…
-
1
votes2
answers406
viewsA: Doubt about HTML regarding the alt=" command
The attribute alt="" in images does not serve to display the desired tooltip, the purpose of this attribute is explained better in: What is the purpose of alt in a <img tag />? What you want…
htmlanswered Guilherme Nascimento 98,651 -
21
votes2
answers710
viewsA: How could you make a Pacman by moving your mouth with pure CSS?
In HTML you can think about creating 3 elements: 2 elements will be the basis and will use ::before and ::after (but can use Divs also the main element will be to group) The third element will be…
-
12
votes4
answers1814
viewsA: How to Make an Inverted Border-Radius?
Following the idea similar to Wallace’s, I found this link from Lea Verou: http://lea.verou.me/2011/03/beveled-corners-negative-border-radius-with-css3-gradients/ The difference is that with this it…
-
1
votes1
answer51
viewsA: Syntax error while running INSERT on Mariadb
This is because when you saved in .txt the columns they were not with single quotes $conteudo =…
phpanswered Guilherme Nascimento 98,651 -
1
votes2
answers59
viewsA: Error in data received in PHP
Don’t need to be FLOAT no, number_format perfectly accepts string, see: echo number_format('2.0', 2); That is, as long as the format is "understandable" as number by PHP, will be valid. The problem…
-
9
votes1
answer1890
viewsA: Datetime.Now or Datetime.Utcnow
The DateTime.Now returns the time set on the server and the DateTime.UtcNow returns the time in UTC which is the "Coordinated Universal Time", in case we have 3 hours difference precisely because…
c#answered Guilherme Nascimento 98,651 -
4
votes4
answers271
viewsA: Javascript equivalent of "Date.now()" in C#?
It would not be simpler to use directly the .ToUnixTimeMilliseconds() in the DateTimeOffset.Now? Thus: Milliseconds: Console.WriteLine( DateTimeOffset.Now.ToUnixTimeMilliseconds() ); Seconds (to be…
-
0
votes2
answers82
viewsA: Capture the last PHP characters of an XML file
First you have to read the XML format, then you can use DOMDocument or SimpleXML, for your case, it seems simple the second resolves: For example: <?php $xmlstring = '<?xml version="1.0"…
phpanswered Guilherme Nascimento 98,651 -
2
votes3
answers263
viewsA: Do not display Warning de foreach
The @ in the foreach issues the error: Parse error: syntax error, Unexpected 'foreach' (T_FOREACH) in C: www test.php on line 30 for that is a "syntax error", i.e., in the parse of the language, see…
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer57
viewsA: Jquery scroll() IE compatibility
The $('html, body').scrollTop(); will only get the value of the first one you find, as every page generates the html and body tags (content or not in the HTML source), it will always fetch the…
-
1
votes2
answers273
viewsA: Error Calculation in Javascript
The .toFixed may not solve the problem, because in some cases it will "round" some values and what you seem to need is to trim the number, so what you need is treat as string Possibly your the goal…
-
0
votes2
answers38
viewsA: Compile string as code
The problem is that to quote inside quotes it is necessary to escape them first, ie this will not work because it will cause syntax error: Dim str str = "MsgBox "Olá mundo"" Execute(str) In VB it is…
-
19
votes3
answers1712
viewsQ: Why is it considered wrong/bad to repeat an HTML ID?
I think the title says it all, why is it considered wrong to repeat HTML Ids? I notice a lot of people doing things like: <div id="foo">bar</div> <div id="foo">baz</div> To…
-
5
votes2
answers1058
viewsA: How to take the content of a Javascript variable, which is an HTML tag?
Create an element that interprets as DOM and use textContent, so for example: var foo = '<p id="horaInicial">2018-07-23 16:40:16</p>'; var tmpDiv = document.createElement('div');…
-
0
votes1
answer73
viewsA: Imap works only on CLI
You must edit the php.ini apache, the php.ini of cli is different, create a file called phpinfo.php on your http server’s Rais, and add this: <?php phpinfo(); Perform like this…
-
1
votes1
answer99
viewsA: Help with Jquery $ is not a Function
Dear Italo, I don’t know if there has to be, but Wordpress itself adds this: Line 103: <script type='text/javascript'…
-
12
votes2
answers295
viewsQ: How to create a simple markdown with PHP?
I would like to create a simple markdown, for bold and italic for now only, for example: **foo** flipped <b>foo</b> __bar__ flipped <i>bar</i> Of course some details are…