Posts by marcusagm • 4,828 points
86 posts
-
1
votes1
answer111
viewsA: How to minify HTML with PHP without affecting <pre> and <textarea> tags?
The function that is displayed can be replaced by the one below, but care needs to be taken with CSS and Javascript inline. function compressHtml($buffer) { // Iniciando variáveis para busca de tags…
-
2
votes1
answer195
viewsA: Improve SQL query performance that accounts for other tables
The solution had a reduction of four consultations, but had to include a LEFT JOIN, because I need the table to return me the table records user_course even if you have no relationship with…
-
1
votes1
answer195
viewsQ: Improve SQL query performance that accounts for other tables
I have an E-learning system and I need to create a report to return to me how many students have passed, failed, students who do not access more than 30 days, students who are taking the course and…
-
0
votes2
answers1907
viewsA: How to work with websockets
The protocol ws:// and wss:// does not need to be installed or activated. This protocol is used by the browser to help identify the type of request and know how to better handle the header or body…
-
1
votes1
answer1489
viewsA: update mysql using array
If you are trying to update data from a relational table you need a composite key or a primary key to identify which record will be updated. Below indicates how the records in your relationship…
-
2
votes2
answers12256
viewsA: Modal within a modal
In the bootstrap documentation you can read an alert saying that the overlay of modal windows is not supported, so you may have some problems doing what you want. Overlapping modals not supported Be…
-
21
votes1
answer4912
viewsA: Safely remember user
Some items we should take care of: Cookies are easy to steal information Attacks via fake request between site or Cross-site request forgery Restart the session and delete all cookies after password…
-
2
votes4
answers2214
viewsA: SQL query return total of days in a month on two dates
I believe the problem lies in the data structure adopted. If you want a truly functional and realistic work history, you should have a record per day, where next to the record would have the time of…
-
4
votes1
answer5211
viewsA: SQL Group query with more than one distinct attribute
From what I understand, your problem is separating the records by model and by date. Your query is grouping only by template. In order for dates to be taken into account when grouping, you need to…
-
8
votes3
answers1971
viewsQ: Records with recurring dates filtered for a period
The Problem I am creating a financial system where I need to register a recurring movement, for example, a light bill that repeats every month. In the system, this type of movement is treated as a…
-
7
votes1
answer3943
views -
4
votes1
answer3509
views -
20
votes1
answer21808
views -
3
votes1
answer989
viewsA: Generate UML from PHP code
You can use the PHP_UML Allows generating UML/XMI files version 1.4, or 2.1 Generates an HTML documentation Can generate PHP code skeletons based on a UML/XMI file Can convert UML/XMI files from…
-
3
votes2
answers278
viewsA: How to remove bug from antialising lines generated in Firefox and IE?
If I understand correctly, your problem is centering the edge. The cleanest way to make that edge is as follows: HTML <div class="row"> <div class="container-fluid ft_copyright">…
-
4
votes1
answer10380
viewsA: How to create a robot with PHP?
Robots to search and interpret information on other pages are also called web crawlers or Spiders. These are scripts that perform the following process: Request for a URL. Store the return obtained…
-
7
votes1
answer3943
views -
0
votes3
answers845
viewsA: How to view alphabetically - Cakephp
Possibly the error is mounting the neighborhood array. Your problem is the Sort function. It reorders the array indexes, if you place the database ordering your problem is solved. Cakephp allows…
-
28
votes8
answers16873
viewsA: How to invert a string in Javascript?
There are several ways of implementing the Reverse function and some have higher performance according to the browser. 1. Decremental loop with concatenation function reverse(s) { var o = ''; for…
-
1
votes2
answers258
views -
2
votes1
answer889
viewsA: Upload multiple files in PHP
Use the plugin jQuery Upload. In the plugin files there is an example of an image upload class. However, it is very complex. To get the data that this plugin send, you can use equal is specified in…
-
8
votes2
answers1077
viewsA: How interesting is it to use APC? Is it recommended to use it with objects?
There are some concepts you should understand about using cache in PHP that have helped identify the advantages of each of the possibilities. Types of cache Archives Database Shared memory Memory…
-
1
votes2
answers535
viewsA: Make a Netbeans project that runs on Virtualbox shared folder not upload
To do this, go to your virtual machine settings and create a shared folder. Settings dialog > Shared Folders In this example name the shared folder as "Server". In the options leave marked only…
-
5
votes4
answers30736
views -
12
votes3
answers3943
viewsA: Alternatives to MVC for web applications
There are already many variations of MVC, Symfony, Cakephp, Codeigniter themselves say they use MVC, but it is not the pure standard, they say this so as not to scare the community with the…
-
3
votes1
answer5368
viewsA: How to make the table header repeat on all pages
The thead and the tfoot were made for this, but some browser do not adapt very well with this, mainly the Chrome that has a bug. Apparently the bug is also present in Safari and Opera. I believe you…
-
1
votes1
answer671
viewsA: Creating new options for Magento attributes
You can rewrite Eav/entity_attribute using another model. To do this add in config.xml <global> ... <models> ... <eav_resource> <rewrite>…
-
2
votes3
answers610
viewsA: Reload after update
You are making the request and in case of success treated only for error. $.getJSON('MarcaItemFoto.php', {IdProduto: IdProduto, IdProdutoFoto: IdProdutoFoto}, function(resposta){ // Aqui você deve…
-
3
votes3
answers14931
viewsA: How to style <select> tag
There are some native browser components that have behaviors that cannot be edited via CSS. If this is really necessary, there are Javascript plugins that exchange native components for HTML code…
-
2
votes2
answers4331
viewsA: How to release a protected sub-directory with . htaccess?
Add the following settings SetEnvIf Request_URI ^/{nomedosite}.*$ noauth=1 Allow from env=noauth Satisfy any Change the {dosite} to the path you expect to see in the URL. Your . htaccess would look…
-
1
votes2
answers5072
viewsA: How to force <option> elements to appear below <select> in IE?
There are some native browser components that have behaviors that cannot be edited via CSS. This select behavior should occur divided to the item list size, select placement in the window, etc. If…
-
4
votes1
answer1361
viewsA: How do I use Freetds with MAMP on Mac OS?
Installing the Free TDS Create the directory /usr/local/freetds Download the freetds download: ftp://ftp.freetds.org/pub/freetds/current/freetds-current.tgz Open a terminal window and unzip the file…
-
3
votes1
answer148
viewsA: Installation of Maverick causes the server to stop working
To rehabilitate PHP do the following procedure Open the terminal Type the following command sudo vi /etc/apache2/httpd.conf Enter your user password Will open the apache configuration. Find the line…
-
97
votes6
answers32253
viewsA: What is the best way to create a PHP login system
For secure authentication it is necessary to identify several points. Some items you should take care of: SQL Injection Password encryption Brute force attack XSS attacks CSRF attacks Protect…
-
0
votes4
answers967
viewsA: Accessing dynamically generated form fields.
To save the array to the database in the form of a string, just serialize the array. You can use, for example, JSON. Some interesting ways:…
javascriptanswered marcusagm 4,828 -
4
votes1
answer2094
viewsQ: How do I set up Netbeans to work with Phpunit in a virtualized environment?
I use Netbeans 7.4 for programming on my Mac. And to not have to install PHP and Phpunit, I would like to run Phpunit installed on a virtual machine that has an entire integration environment…