Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
6
votes1
answer1786
viewsA: Error "Fatal error: Class 'Phpunit_framework_testcase' not found"
The namespace "simulated" PHPUnit_Framework_TestCase is "only" for version 5.7 of Phpunit In phpunit version 6.3 the correct namespace is PHPUnit\Framework\TestCase (which now uses real namespaces…
-
1
votes1
answer449
viewsA: How to disable HTTPS in Centos Apache 2 installed on Amazon EC2?
If what you want is just to disable redirect, just search on httpd.conf (or included configuration files) something similar to this: Redirect permanent / https://dominio.com/ He’s probably on the…
-
2
votes4
answers115
viewsA: How to avoid the repetition of requires?
I don’t think it’s necessary spl_autoloader for something so commonplace, much less PSR, after all is not trying to load classes based on namespaces, in fact I believe that one of the includes is…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer1598
viewsA: Command "see more"
For who uses jQuery there is a plugin ready to facilitate the work: https://github.com/viralpatel/jquery.shorten For those who use React there are also solutions, one I found was:…
-
0
votes1
answer226
viewsA: Photo Gallery in Miniature
The function imagecreatefromjpeg only reads JPEG type documents: $image = imagecreatefromjpeg($filename); Files in PNG format will cause failure as it expects a JPEG image. For PNG you must use…
phpanswered Guilherme Nascimento 98,651 -
1
votes3
answers139
viewsA: What does it mean to distribute content with low latency and high data transfer speeds in Cloudfront?
This answer came before editing the question, I will edit or remove, I am still analyzing if it is possible to save something The link explains how the behavior between servers works: How Cloudfront…
-
3
votes1
answer63
viewsA: How to Restore Database to Recover Data?
I believe that nay there is nothing ready, unless your server/administrators have implemented something, so only by contacting technical support and/or server administrators to request a copy of the…
mysqlanswered Guilherme Nascimento 98,651 -
1
votes1
answer323
viewsA: Query mysql_query does not return the column
The mysql_query and mysql_fetch_array belong to Old API of PHP: http://php.net/manual/en/ref.mysql.php This old API, whose functions start with mysql_ are discontinued and were removed in PHP7. The…
-
1
votes3
answers845
viewsA: How to simulate Ctrl+v
I don’t see the need for so much work, even more something that implies the security of the user. If you are using a link shortener of your own, you could simply resolve with session or localStorage…
javascriptanswered Guilherme Nascimento 98,651 -
2
votes1
answer1064
viewsA: jQuery Autocomplete Uncaught Typeerror: Cannot read Property 'length' of Undefined
The mistake Cannot read property 'length' of undefined can be in Ajax (before autocomplete), which I doubt a little, because it is somewhat improbable jquery ajax return undefined or it may be due…
-
2
votes3
answers773
viewsA: Pandas does not find file
I’m a little rusty as Python, but I’m pretty sure \ (backslash) is used to "escape", if applicable switch to /, thus: import pandas as pd reclamacoes =…
-
0
votes5
answers3455
viewsA: Change HTML document to PHP
First it is necessary to understand what is front-end and back-end, these questions should help: What’s the difference between client-side and server-side code in web development? /a/177050/3635…
-
9
votes3
answers2326
viewsA: Check if html page exists HTML/Javascript
If the site you are trying to check is on a different domain you will probably have lock with CORS, read on: HTTP Access Control (CORS) Plus it’s important to know that offline sites can be…
-
5
votes2
answers1688
viewsA: Will using async="" result in synchronous or asynchronous loading?
The async="" is asynchronous even, ie will not cause rendering locks and one script will not wait for the other, which can be bad if one <script src> depend on each other <script src>,…
-
0
votes2
answers1128
viewsA: FTP connection is not listing files
As question no Soen this problem: Permission denied: recv failed occurs due to lack of an update (maybe in newer versions of windows does not occur) that causes problems in FTP connections on…
-
2
votes2
answers312
viewsA: Subtract a day directly from CURRENT_DATE
This is not looking like a native class or some strongly known lib, however how did you use the mysql tag if a column in a SELECT: SELECT CURRENT_DATE - INTERVAL 1 DAY If to return only the results…
-
2
votes4
answers183
viewsA: Pdostatement::rowCount returns -1
Add the attribute array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL) as described in documentation: You would Most commonly use this to set the PDO::ATTR_CURSOR value to PDO::CURSOR_SCROLL to request…
-
3
votes2
answers1580
viewsA: Convert utf-8 codes to Unicode
First, these characters are \uXXXXX are not UTF-8, are "escaped" characters (actually any character can be escaped like this). Second, this what you want is not to convert UTF-8 to Unicode, it is…
-
2
votes2
answers1400
viewsA: Vertical alignment with CSS?
Instead of table-cell and float you can use inline-block combined with vertical-align: bottom;, an example: <div class="row" > <div style="max-width:150px; display: inline-block;">…
-
1
votes1
answer1390
viewsA: How to leave a mysql database online?
First you need to know if the "external IP" of the Windows Server network is fixed or not, being fixed just know the address, then the next steps are: Fix the "local IP" of your Windows Server…
mysqlanswered Guilherme Nascimento 98,651 -
3
votes1
answer845
viewsA: remove the php extension and force the entire page as https via htaccess
Just add in the desired order and always add the flag L for each RewriteRule that should not mix, it is only necessary a on Should stay like this: RewriteEngine on # Redireciona para HTTPS se…
-
0
votes1
answer62
viewsA: Problem with regular expression in . htaccess
If you’re trying to pass a querystring in the rewritten URL as an example: http://< site >/restrito/usuarios/pagina/exemplo?foo=$ Then you might have to add the flag QSA RewriteRule…
-
1
votes1
answer2240
viewsA: Error reading CSV: A non well Formed Numeric value encountered
The problem is in the content of one of the Csvs, there is no way to know, but the problem is that by taking the value as in: echo $column2[9]."<br>"; You must be picking the wrong item on one…
-
1
votes2
answers737
viewsA: Validate a link in input
By tag jquery-validation-engine I assume you are using Plguin jquery jquery.validationEngine.js, if that’s so, then first download the files in…
-
1
votes2
answers1496
viewsA: Composer installation error: 'could not find the specified module (php_intl.dll)'
The message may be the problem: A Setting in your php.ini could be causing the problem: Either the 'extension_dir' value is incorrect or the dll does not exist. The configuration of extension_dir…
-
1
votes1
answer3631
viewsA: Error: Uncaught Error: Class 'mysqli' not found
The php.ini Apache is usually different from php.ini which they see in php, if you manually installed php and apache you must configure in httpd.conf the parameter PHPIniDir, assuming your php is in…
-
3
votes1
answer1968
viewsA: How to host a Windows server?
Probably intend to use IIS being Windows Server, in case you might have installed one of these programs: IIS "standard" IIS Express Webplatforminstaller If it is standard IIS or IIS Express If you…
-
3
votes2
answers298
viewsA: How to check if a value is iterable by foreach in PHP?
Note: This answer is only complementary As of version 7.1.0 of PHP there is a function is_iterable is native, after testing it in this version I noticed that objects stdClass are not considered to…
-
4
votes2
answers45
viewsA: Variables are not receiving input value in PHP
Missing attribute method=POST, change to this: <form method="POST" action="contato.php" name="sentMessage" id="contactForm" novalidate>
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer322
viewsA: 301 conditional forwarding by IP to another domain
Maybe passing the parameter of the current path to the URL is missing, do so: RewriteRule (.*) http://domainovo.com.br/$1 [R=301,L] If you want to redirect querystrings you may need to add the flag…
-
4
votes4
answers1009
viewsA: Connecting PHP to the Mysql database
The Phpmyadmin nay is a database and mysql nay connects via HTTP, mysql itself is already a proper TCP protocol. Mysql and Phpmyadmin difference read this: What’s the difference between Mysql and…
-
1
votes2
answers231
viewsA: What is the difference between " - " and " / " in CMD commands
That’s a characteristic of command shutdown, the program interprets as you wish, for example if you create a program in Python (3): import sys print ("\n".join(sys.argv)) And call it that at the…
-
4
votes2
answers2091
viewsA: Uncaught Syntaxerror: Unexpected token {
The line 48 is this: return data; }, } < ----------------- LINHA 48 AQUI { data: "ti.PublicationTitle" }, { data: "ty.PublicationType" }, { data: "p.ano" }, { data: "p.competencia" }, { data:…
javascriptanswered Guilherme Nascimento 98,651 -
1
votes1
answer2171
viewsA: Extremely slow and inconsistent composer
Possible causes of error: 1. Problems on the network: As the question below can be a problem with IPV6, by chance it is Linux, I do not know if the problem occurs in Windows: Composer does not…
-
1
votes1
answer103
viewsA: How to add another form field in wordpress?
There are 2 relatively popular plugins for this use: Advanced Custom Fields The Advanced Custom Fields plugin supports the following formats: Text, Text Area, Number, Email, Password, WYSIWYG,…
-
2
votes2
answers266
viewsA: Apply FILTER_SANITIZE or real_escape_string to all fields of a json
Using two foreachs and add the & ("E" commercial) the value variables of foreach to create a reference: foreach ($obj as &$main) { foreach ($main as &$value) { $value =…
phpanswered Guilherme Nascimento 98,651 -
1
votes3
answers2363
viewsA: Enable 'Access-Control-Allow-Origin' in jQuery [xml]
should be added to the .xml (which is not possible because it is the Yahoo server, only they have this control) and nay on your page, if it were possible to do this directly by the customer would be…
-
1
votes1
answer73
viewsA: Doubt web.config
Maybe it’s the lack of stopProcessing, it is also necessary to remove the / from the front of /public, should look like this: <rule name="Downloads Redirecionar" stopProcessing="true">…
-
3
votes4
answers7265
viewsA: How to get customer operating system information?
As already stated in Anderson’s reply, it is not possible to detect in a guaranteed way, because the HTTP header called User-Agent can be changed and so would cheat the script, creating a single…
-
8
votes6
answers630
viewsA: Is there a problem compressing CSS?
It’s not primarily for SEO, reduce the size and decrease the requests help a little with SEO, but this is what we can call a positive side effect, is not by far a "deciding factor". has some risk in…
cssanswered Guilherme Nascimento 98,651 -
3
votes1
answer340
viewsA: Minifcar. JS and CSS files in bulk
It depends on which web framework is using with Node.js, if it is Express (the most common) there are the: express-Minify To install use: npm install express-minify It combines everything in and…
-
3
votes1
answer8196
viewsA: iframe does not work with external websites
It is because your site uses HTTPS and you are trying to inject into an HTTP site, so it causes the error: Mixed Content: The page at 'https://educapp-davidev.c9users.io/admin/' was Loaded over…
-
2
votes1
answer105
viewsA: Empty fields Phpmailer
Change: $nome = $_POST["Nome"]; $email = $_POST["Email"]; $mensagem = $_POST["Mensagem"]; For: $nome = $_POST["nome"]; $email = $_POST["email"]; $mensagem = $_POST["mensagem"]; And let the name=…
-
1
votes2
answers811
viewsA: Create barcode with imagecreate and html
You can use the library https://github.com/picqer/php-barcode-generator, if you are using Composer just install in your project folder: composer require picqer/php-barcode-generator Generating a…
phpanswered Guilherme Nascimento 98,651 -
4
votes1
answer281
viewsA: Insert Video into HTML
Probably you are going up the video via FTP and maybe you are taking the upload as ASCII, so that you do not lose data upload as binary, for example in Filezilla go to: Transfer > Transfer type…
-
2
votes2
answers212
viewsA: How to manipulate the string coming from a . reg file exported from regedit?
I believe the format is quite similar to that of the .ini (of course it has variations, but this is another situation, for the code above I believe it is similar), if it really is similar you can…
phpanswered Guilherme Nascimento 98,651 -
12
votes3
answers19220
viewsA: How to add a pure Javascript class?
With browsers "modern" suffice: document.querySelector('#menu #<? echo $idMenuAtivo; ?>').classList.add("active"); Or if you want to "alternate": document.querySelector('#menu #<? echo…
javascriptanswered Guilherme Nascimento 98,651 -
3
votes5
answers1258
viewsA: How to open a new background tab and redirect the current tab?
Apparently it is not possible to open a tab in the background, I found this reply, the test: function openNewBackgroundTab(url) { var a = document.createElement("a"); a.href = url; var evt =…
-
6
votes1
answer2101
viewsA: REST framework for PHP API
Understanding the basics of what is REST and HTTP almost any framework of route control can easily create a REST application, I recommend you read: What is REST and Restful? What are the main…
phpanswered Guilherme Nascimento 98,651 -
1
votes1
answer96
viewsA: Create an event / plugin for Composer
When running Composer via command line PHP is probably already in variable PATH of the operating system, then it is not necessary to pass the full PHP path: "F:/portable_php_path/php.exe -r…