Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
1
votes1
answer874
viewsA: Connection failed in phpmailer
Live uses TLS and not SSL, just exchange this: $Mailer->SMTPSecure = 'ssl'; $Mailer->Host = 'smtp.live.com'; $Mailer->Port = 587; For this reason: $Mailer->SMTPSecure = 'tsl';…
-
9
votes1
answer84
viewsQ: $ and $$ are now native browser functions?
When using the console on a Javascript-free page I noticed that when typing $ had the same effect as document.querySelector and while typing $$ had the same effect as document.querySelectorAll.…
-
4
votes7
answers1017
viewsA: Is there any way to know if an array is associative or sequential?
I suggest working only the keys, because this can be more performative than working the values (items), because these can be multidimensional arrays, so working only the keys can have a slight…
-
3
votes1
answer2149
viewsA: Error Delimiter must not be alphanumeric or backslash
The delimiters are missing, the functions preg demand this and perhaps also lack the ^ in regex \d{1,2}/\d{1,2}/\d{4}$, do so #^\d{1,2}/\d{1,2}/\d{4}$#: for($i = 0; $i < count($array); $i++){…
-
1
votes1
answer273
viewsA: using SFTP in php 5.3 with phpseclib
Remove the comment from the line: // include './phpseclib/Net/SFTP.php'; I believe that the \phpseclib\Net\SFTP be incorrect, should be something like: Net\SFTP Works even in this order: <?php…
-
0
votes1
answer149
viewsA: How do I redirect a non-existent htaccess url?
It seems that this is wrong %2. The match should be with dollar, so $2 Should stay like this: RewriteCond %{QUERY_STRING} !="" RewriteCond %{QUERY_STRING}…
htaccessanswered Guilherme Nascimento 98,651 -
8
votes2
answers8300
viewsA: How to create a toggle on and toggle off button?
An example with pure CSS would be like this https://codepen.io/andreasstorm/pen/ZGjNwZ, I made a more simplified version https://codepen.io/brcontainer/pen/RpdgLz, its legal is that it works…
-
1
votes1
answer317
viewsA: Image without quality - Safari
It’s not Safari, it’s just macs computers most modern are using retinal screen or retinal screen, the images are a little blurred usually if used in backgrounds, two solutions are: Image with double…
-
2
votes1
answer581
viewsA: Field help to save a link
According to this response from Soen, then 2048 it has to be the maximum for seekers, so I believe 400 is very little, I believe that this is the minimum. Then perform: ALTER TABLE `tabela` CHANGE…
-
3
votes2
answers1670
viewsA: How to fix Requests encoding in Python?
That one \u is an "escape" used in JSON and Javascript for non-ASCII characters (by default Json uses Unicode), in case you returned as a string, then it maintains the use of this to avoid character…
-
1
votes1
answer436
viewsA: Ubuntu terminal access a website every day
Tried to use CURL directly? So: 0 6 * * * curl --silent https://site.com/WebService A question? Do you need PHP to call the webservice? I mean unless you need to save something on the site, like…
-
2
votes1
answer450
viewsA: Multiple Upload Images
It’s so much wrong in your code that I don’t even know how you got the error, in fact I think due to this series of errors rather than Ajax the form was being sent by normal request, since there…
-
2
votes2
answers562
viewsA: method $.find() in pure javascript
I replied something similar in /a/141203/3635, to be clearer the getElementsByTagName, getElementsByClassName and querySelectorAll are different in behavior of getElementById and querySelector…
javascriptanswered Guilherme Nascimento 98,651 -
11
votes3
answers46491
viewsA: Path to access html folders ,css,php etc
The ".." (two points) and the "." (point) In accordance with RFC 3986: If the path begins with ../ or ./ then they will be removed from the prefix: ../a/b/c → a/b/c If the path begins with /./, /../…
-
1
votes2
answers299
viewsA: AJAX javascript, PHP post does not work
Trade the Return for a callback (read this What is the real advantage of using a Callback and what is thread/multithread?) And finally adjust if to detect HTTP or connection errors: Then adjust the…
-
0
votes1
answer945
viewsA: User-friendly URL with HTACCESS parameters
You did this: RewriteRule ^/download/([a-z0-9-]+)/([0-9]+)/?$ /download/programa.php?title=$1 [NC] But for what it seems to desire the right is this (and remove the / front of both download/):…
-
0
votes1
answer223
viewsA: Safari not configured, does not load css
In Safari before 10 you need the prefix -webkit, try this: display: -ms-flexbox; display: -webkit-flexbox; display: flex; -ms-flex-align: center; -ms-grid-row-align: center; -webkit-align-items:…
-
3
votes1
answer398
viewsA: PHP Stored Security XSS and SQL Injection
XSS is one thing and SQL-Injection is another totally different, although both can (always) originate from the same source: SQL-Injection It occurs if the user can manipulate or break the query.…
-
2
votes3
answers1031
viewsA: As returns only the file name without the path
A basename should only solve: <?php // Recupera a lista de todos os arquivos: $itens = glob("arquivos/*"); // Ordena os arquivos pela data de modificacão: usort($itens, function ($a, $b) { return…
phpanswered Guilherme Nascimento 98,651 -
4
votes4
answers196
viewsA: Similar function to indexof() in Javascript
And you want to scan this string using an array of strings to know what "matchs" you find in it, how can I do it in a more performative way than using the index() In case the indexOf this good the…
javascriptanswered Guilherme Nascimento 98,651 -
12
votes2
answers2414
viewsA: What is Travis CI?
The CI means Continuous Integration (integration continues), that is to say it refers to a series of tests that you can write to ensure that your codes and the like work as expected through unit…
-
1
votes1
answer203
viewsA: View image from another site
The problem is that the feed is using HTML along with <![CDATA[...]]>: <description><![CDATA[<div><img style="margin-left: 5px; border-radius: 5px; float: right;"…
phpanswered Guilherme Nascimento 98,651 -
9
votes5
answers2672
viewsA: What is the </datalist> tag for?
As many have already replied, the <datalist> other than <select> normal has a text box, or it is possible to filter the results of a combobox according to what you type. Note that this…
-
0
votes1
answer356
viewsA: Error with htaccess Sem redirect to WWW
It must be the cache of your browser that kept redirecting something, I think, or yours. htaccess is not in the folder or another fault, in case this is not necessary: RewriteCond…
-
0
votes1
answer154
viewsA: How to import FPDF content to Zend2?
Solution with own Zend After editing I noticed that I was loading fpdf by Zend even then can use so: <?php require_once APPLICATION_PATH . '/aditivos/fpdf/fpdf.php'; If you fail do so: <?php…
-
5
votes1
answer119
viewsA: Changing any PHP line gives error 500 (server)
This CR means Carriage Return and LF means line feed, the LF is used to generate "new lines" (line break), the CR up to the Mac 9 was used as line breaking, but from the 10 (Mac OS X) started using…
-
3
votes2
answers1970
viewsA: Accentuation problem when migrating to PHP7
Not the coding of documents has nothing to do with the language, the language only processes and sends a processed file back to the user, when the connection to the database is something that by…
-
0
votes1
answer38
viewsA: How to make when you have talks at the same time one of them goes up in files . vtt
The current technology apparently can not do this automatically, but it is possible to manually align simply (after all there will be few places to probably adjust), can use line:0, for example in…
-
9
votes1
answer3600
viewsQ: How to put subtitles (subtitles) in videos?
How can I add subtitles/Subtitles to the video tag: <video> <source src="video/video.mp4" type="video/mp4"> </video>
-
8
votes1
answer3600
viewsA: How to put subtitles (subtitles) in videos?
There is the format webvtt, a file must have this format: WEBVTT 0 00:00:00.000 --> 00:00:12.000 Teste 1 00:00:18.700 --> 00:00:21.500 Teste inicia em 00:18 2 00:00:22.800 --> 00:00:26.800…
-
1
votes1
answer227
viewsA: How to do one function within another
Try to add the .play(), another detail, lack the send() in your Ajax, the autoplay does not seem necessary, just execute the play as soon as the legend is started. An important detail, this there is…
-
8
votes4
answers650
viewsA: In production environment should errors be disabled?
Never use error_reporting(0);, this affects more than display the errors, it affects the logs saved, which is not a good idea, just use the: ini_set('display_errors', 0); This will already prevent…
-
1
votes1
answer82
viewsA: Standard compilation for linux
Python and Ruby are not compiled, meaning they do not generate executable files, they are interpreted by language programs, with the exception of C. As long as you have the Ruby program installed on…
linuxanswered Guilherme Nascimento 98,651 -
0
votes4
answers100
viewsA: function_exists fatal error
If the self::$function_val is receiving a string with the name of a function and I believe that the call_user_func is unnecessary (actually wrong), by doing this self::$function_val() you are…
-
1
votes2
answers77
viewsA: How to extract this information in a string?
Can use preg_match_all, thus: <?php $resposta = 'Stream #0:0(jpn): Video: h264 ... Stream #0:1(jpn): Audio: mp3 ... Stream #0:2(por): Subtitle ...'; if…
phpanswered Guilherme Nascimento 98,651 -
2
votes1
answer830
viewsA: move_uploaded_file crashing
The path of your . php should not be relative to the image folder, just seeing the specific project folder structure to be sure, by the way back_classes\envioUfc.php I believe the folder imagens is…
-
0
votes1
answer202
viewsA: Insert CSS and JS files stored in another folder
C: is equivalent to using the protocol file:///, file is to load local files from the machine and not from the server, the broker in case would: <link rel="stylesheet"…
web-applicationanswered Guilherme Nascimento 98,651 -
5
votes1
answer353
viewsA: css is not a Function
The use of [index] in jQuery DOM only works to catch the first item as it is a "shortcut", to catch other items you must use or .each or .eq Do so: .eq returns the jQuery object and .get returns the…
-
4
votes0
answers182
viewsQ: Chrome and Opera do not respect cache
Chrome and Opera (same engine as the first) does not respect headers Cache-control and Expires, I mean if it’s a link or interaction within the page works normally, this appears ahead: But if the…
-
2
votes1
answer1457
viewsA: Dompdf - Block printing and download
There is no way to prevent download definitively, what you can do is at most hinder, as the reply on Soen and in the Grupo Google You can use the CPDF to specify what the user can do with the…
-
13
votes1
answer13920
viewsQ: How does the "Referrer Policy" header work?
I was doing some tests using Opera browser (same engine/engine as Chrome) and HTTP request sends this: Referrer Policy: no-referrer-when-downgrade For example in http://localhost get this: Request…
-
2
votes2
answers241
viewsA: Difficulty using ob_start(); ob_end_flush(); and their similar?
The function end() in: $ext = end(explode('.', $name)); Only accepts references, see what is and how the references works here: http://php.net/manual/en/language.references.pass.php To fix just do…
-
4
votes2
answers1407
viewsA: How to Transform Time String to an Entire?
I don’t think I need a class like Calendar to solve, just one split and do a mathematical operation, like this: String horacompleta = "12:39"; String[] horamin = horacompleta.split(":"); int hora =…
-
2
votes2
answers1106
viewsA: Block direct access to a URL via webconfig
You can check the URL by Rerefer, like this: <rule name="assets"> <match url="^assets/videos/([a-z0-9-]*)" /> <conditions> <add input="{HTTP_REFERER}"…
-
1
votes1
answer706
viewsA: How to fill in input field and submit form with Curl?
I recommend using their official Javascript API https://developer.appear.in, add this to your HTML (has to run on HTTP or HTTPS protocol, file may not support): <script…
-
0
votes1
answer55
viewsA: Program with 3 files
Maybe it’s C99, add: #include <stdbool.h> A hint if the compiler do not support C99 as per these responses, create a file with this name myboolean.h: #ifndef MYBOOLEAN_H #define MYBOOLEAN_H…
-
13
votes3
answers1028
viewsA: Facilitation in PHP projects
Most of the content here "maybe" applies only to Sublime Text 3, please note that Sublime Text 2 was last updated on 8 of July 2013 For PHP as for other languages the plugin that works a lot is…
-
0
votes3
answers234
viewsA: Should I set the background on TD or TR?
The tags <td> and <th> are table cells, and the <tr> are lines, in addition to them there are elements that are used as "dividers", being the <tbody>, <tfoot> and…
-
0
votes1
answer285
viewsA: Mounting url for testing in Curl
I guess I’ll have to change the space for the + or %20, or between the / you must code, do so: curl -v -X PUT -d "Id=1&tipo=TO%20GO" "http://www.sitedeteste.com/r/ordem/1/TO%20GO" Or so: curl -v…
-
2
votes2
answers1776
viewsA: Ajax request url point to a route
Use {{ route("apelidoDaRota") }} does not work inside a file .js, and I noticed that you’re using the public instead of setting up the VirtualHost in Apache/Ngnix then you will have to do so:…