Posts by Guilherme Nascimento • 98,651 points
2,383 posts
-
5
votes3
answers878
viewsA: image and hr side-by-side
You can add the display: block image (as soon after comes the <hr>) and I also don’t see the need for position: absolute, something like: .container img { display: block; } .container hr {…
htmlanswered Guilherme Nascimento 98,651 -
6
votes1
answer989
viewsA: How to reduce the size of a variable passed via POST by compressing it
In accordance with @Luídne and the @bfavaretto Error 414 only occurs when data is passed through the URL (even if it is sends POST, yet you can send data through GET). The mistake 414 Request-URI…
-
4
votes2
answers1166
viewsA: -ms-flexbox and flexbox do not work in Internet Explorer
There are three possible problems (if IE10 or IE11) is that you are not using the value compatibility parameter Edge, then add this: <meta http-equiv="X-UA-Compatible" content="IE=Edge">…
-
3
votes1
answer5945
viewsA: Pass $_POST via javascript and redirect
You are using ajax (I believe), ajax is asynchronous, ie only works with "callbacks", if you redirect the page with location soon after calling ajax the redirect will abort the Ajax request. Is this…
-
1
votes1
answer775
viewsA: Fopen Permission denied
There are some details to be corrected: Instead of //192.168.1.2\ you must use \\192.168.1.2\ You must "escape" the character \ leaving him like this \\\\192.168.1.2\\DADOSTXT\\arquivo.TXT…
-
3
votes1
answer1179
viewsA: Send SMS via Php
The message baud rate seems to me only part of the error, you must be more specific of which error occurs. An example you can use to detect the fault is: Open the CMD Check which port your modem…
-
3
votes3
answers799
viewsA: Undefined index error: user when submitting a POST form
Your form is using method="POST", just change $id=$_GET['user']; for $id=$_POST['user']; I also recommend that you avoid passing variables directly to your query, in the case as you are using mysqli…
-
0
votes1
answer101
viewsA: Prevent media from continuing to click on <audio> tag
As this response from Soen would remove the old player and add a new one with the new audio track: A quick example using jQuery: var audio = $("#audio-player audio").get(0); audio.pause(0); //Pausa…
-
2
votes1
answer1588
viewsA: MVC - Doubt about controller and view PHP
HTTP applications change somewhat compared to desktop applications, for example C++ software that uses MVC has signal support, so even a button can be a "controller". Already in HTTP frameworks…
-
1
votes1
answer860
viewsA: Qt5 creating a Qaction that calls an information window
I believe it is necessary to use the new, because the first generated window is already linked to QApplication, the new windows must receive the this to be linked to each other, then the right thing…
qtanswered Guilherme Nascimento 98,651 -
2
votes1
answer142
viewsA: Migrate jQuery to jQuery2
Since the jQuery1.8 the method .ajaxComplete() can only be used with document I really don’t understand why it was used .ajaxComplete inside a callback, I believe it is not necessary at this point…
jqueryanswered Guilherme Nascimento 98,651 -
2
votes1
answer468
viewsA: How to get the correct HTTP status?
After a brief search, I found this ikiwiki, there are some improvements that can be made, but the idea is that the location fake solves the problem, in time I will improve the code or add a new…
-
1
votes1
answer77
viewsA: Router in Zend 1.12 hide controller and action
Note that I do not understand anything of Zend, I did only a brief reading of the documentation, may contain errors I don’t know how your system is (if the routes are "automated"), but you could try…
-
6
votes3
answers16809
viewsA: How to generate an executable . jar using Maven?
Renan also do not know such technology either, but about Java (and not Maven) if I am not mistaken the command java search for a file .class, is not? To run files jar would need the parameter -jar,…
-
0
votes3
answers137
viewsA: Message when entering the page
You can use Bootstrap, $.ready and $(...).modal('show');: $(document).ready(function(){ $('#myModal').modal('show'); }); <link rel="stylesheet"…
javascriptanswered Guilherme Nascimento 98,651 -
1
votes1
answer167
viewsA: Was the use_include_path parameter replaced by the flags parameter?
I’m not sure about this, but I believe it’s something wrong even in the documentation Before the announcement of PHP7 (Who will launch PHP7 without PHP6? - I will explain this throughout the…
-
2
votes1
answer405
viewsA: I can’t get jQuery Vegas plugin to work
Use $.ready or $(function() {...}), something like: <script type="text/javascript"> $(function() { $('body').vegas({ slides: [ { src: 'img/slide1.jpg' }, { src: 'img/slide2.jpg' }, { src:…
-
2
votes1
answer117
viewsA: Block indexing by robots in controller
If these routes have authentication, probably not authenticated users are redirected should view the login page, in case a BOT should also view the login page (because in my opinion the bots should…
-
0
votes2
answers926
viewsA: Saving Base64 Image with ADODB.Stream
Onaiggac I tried to use your code, but this server I use is not microsoft technology and it has been a long time that I do not work with Asp-classic server, but by the few tests I did the problem…
-
0
votes5
answers934
viewsA: Alternatives to center the img tag
The only solution I see in this case is to use position: relative; with negative margin (it will be necessary to add another element): #wrapper { width:90%; height:300px; margin:0 auto; border: 1px…
cssanswered Guilherme Nascimento 98,651 -
1
votes1
answer98
viewsA: Cache static pages in the browser
Translating from this answer Soen I asked the administrators of Github and they told me that "is not possible" alter the headers of the HTTP response on the pages github.io. They added this request…
-
7
votes1
answer82
viewsQ: Is it possible to know at what point the script reaches the memory peak?
It is possible to know at what point the script reaches the memory peak? I have a PHP script that at the end shows this result: Usage: 380.515625Kb Peak: 393.5859375Kb Real: 512kb Example: <?php…
-
3
votes3
answers4384
viewsA: Difficulties in Sending Email using PHP
If the message always appears Email sending failed and the false which you refer to is the function mail, then the reason is your server configuration. Note that if you are trying to use this in…
-
3
votes1
answer368
viewsA: Alternative to http_response_code in versions below php5.4
In order for it to work prior to 5.4, such as php5.3 and php5.3, you can create "reserved" urls using ErrorDocument (apache, see alternatives to other servers below), using for example: .htacces…
-
4
votes1
answer368
viewsQ: Alternative to http_response_code in versions below php5.4
It is possible to get HTTP status in versions prior to PHP 5.4 (http_status_code only supported in PHP5.4+)? I am creating a system of customized error pages, it will not be a system for a specific…
-
9
votes4
answers15034
viewsA: Difference between mysql_connect() and mysqli_connect() functions in PHP
In addition to the points cited in the other answers about the advantages of mysqli: Object Oriented Interface (Object-oriented interface) Support for Prepared Statements Support for multiples…
-
2
votes4
answers572
viewsA: Upload Ajax - Php
In addition to the situation cited by @Sergio, there are other problems: For each ajax execution a new one is required new XMLHttpRequest(), that is, you are using only one new XMLHttpRequest() for…
-
0
votes3
answers575
viewsA: Ajax opening content without refresh
It is likely that the address generated here var href = "/paginas/"+$(this).attr('href'); is inaccessible or the this.href be the wrong way. Change this: var href = "/paginas/"+$(this).attr('href');…
-
2
votes1
answer167
viewsQ: Was the use_include_path parameter replaced by the flags parameter?
I always use the English documentation of PHP, because it seems to me that it is always more up to date, but when accessing the documentation of file_get_contents in Portuguese, I noticed the…
-
2
votes1
answer627
viewsQ: Use finfo or pathinfo to get the mime type?
finfo_* and pathinfo are used to detect the mimetype file and not the extension. The point is that in the world there are several file formats and from time to time new formats appear, I have no way…
-
4
votes2
answers430
viewsA: How to ZIP only images from a folder with PHP?
If $files receives the files with the full path and not the folder from where you will get such files in create_zip($files, then you can filter what is image by extension for example:…
-
1
votes2
answers159
viewsA: fetch_array does not return data
I think I found the problem, you’re using <?, but you should be using <?php This is because you are trying to use short_open_tag, but your php.ini settings must be blocking your use. Note:…
-
2
votes1
answer615
viewsA: Website with audio MP3 does not touch iPhone
First tip, always use var when declaring the variables, ex: var variavel = ...;, should look something like: $(document).on('click', '#tocar-musica', function () { var id_musica =…
-
1
votes1
answer569
viewsA: Block redirect of extensions and folders with . htaccess
Rafael when the browser receives a 301 this is in the cache, so this works: RewriteCond %{REQUEST_URI} !^/(?:index\.php|robots\.txt|sitemap\.xml)$ The problem is that for the browser the old page no…
htaccessanswered Guilherme Nascimento 98,651 -
1
votes2
answers425
viewsA: Redirect or deny direct access to public folder
To solve the problem you can use %{THE_REQUEST} with RewriteCond, examine: RewriteCond "%{THE_REQUEST}" "^GET\s/public/" If you need all methods (GET, POST, PUT, etc), example of redirect:…
-
2
votes2
answers425
viewsQ: Redirect or deny direct access to public folder
I’m using htaccess to access the folders css, js, images who are in /public directly: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^(css|js|images)/(.*)$ public/$1/$2…
-
18
votes1
answer3307
viewsA: Is OS development restricted to beginners?
I believe that many have wanted to do this, but note one thing, you can create your own "OS", but creating a core is a longer way, in other words to create a system you can make use of known cores,…
-
0
votes1
answer112
viewsA: Multiple Rewriterules for 3rdparty and routes
Follow the comments in the file to understand how it works <IfModule mod_rewrite.c> RewriteEngine On # Troque está linha por / ou pelo nome da pasta que estará # usando o seu framework e…
-
1
votes1
answer112
viewsQ: Multiple Rewriterules for 3rdparty and routes
I have a file .htaccess that adds PATH_INFO in the index.php file (for the route system): RewriteEngine On RewriteCond %(REQUEST_FILENAME) !-f RewriteCond %(REQUEST_FILENAME) !-d RewriteRule…
-
17
votes1
answer1935
viewsA: Div that can be dragged
There are several ways to do this, such as: Javascript + CSS Pure Javascript (without CSS, creates an element "ghost") And with frameworks like jQuery UI or Interact.js With javascript + CSS See…
-
13
votes4
answers7944
viewsA: How to take print (screenshot) from a web page?
You can use html2canvas, note that it does not take a real photo, but yes tries to redraw the page elements, note that the other answers are correct, but the examples are probably not will work in…
-
0
votes1
answer146
viewsA: Justify Text on Windows Phone
I don’t know much about xaml, but according to the answer in Soen You can use a RichTextBox to achieve the desired effect: <RichTextBox TextAlignment="Justify" IsReadOnly="True">…
-
50
votes7
answers53067
viewsA: Knowing if the number is odd or even
In ifComparisons do not use a sign =, but yes two signs or three, as in the example: if (n/2 == 0) { equals comparison if (n/2 === 0) { identical comparison Your code must be something like: Note:…
javascriptanswered Guilherme Nascimento 98,651 -
8
votes4
answers827
viewsA: Another option to use @ in PHP?
The @ is not a good practice, although it can be used, the recommended to do variable checks is the isset. The isset other than array_key_exists (which can also be used as Ricardo’s example)…
-
9
votes1
answer1017
viewsA: Memory usage PHP images
The consumption is high even because in addition to reading the image in memory it is "decoded" and these decoded data also stay in memory, we can say that it is almost impossible to reduce the peak…
-
5
votes3
answers11888
viewsA: PHP code opens in browser
Reading your question, I remembered an answer from me on Soen, I believe this is the way: The problem is that you may have accessed the page through the FILE protocol instead of the HTTP protocol,…
-
1
votes1
answer1078
viewsA: How to get PATH_INFO on Nginx when we use rewrite (friendly url)?
For it to work it is necessary to use last in the rewrite and fastcgi_split_path_info to configure the PATH_INFO, example: Note: Use the full path in rewrite and Location location ~…
-
6
votes1
answer468
viewsQ: How to get the correct HTTP status?
I tried to get the error "status" like this: error_page 403 /error.php; error_page 404 /error.php; But $_SERVER['REDIRECT_STATUS'] return 200, already in Apache he return 404 (the expected result).…
-
3
votes1
answer1078
viewsQ: How to get PATH_INFO on Nginx when we use rewrite (friendly url)?
I created a .htaccess in the briefcase /var/www/project/: <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1…
-
3
votes2
answers3046
viewsA: Dots and accents in mod_rewrite Urls
When searching for the term rfc dot path, finally found the reason for this "polemic" The problem with the dot in Urls - . (dot) Not há problemas using dots in urls (even if rewritten) as for…