Posts by mlemos • 1,535 points
35 posts
-
2
votes3
answers7963
viewsA: Making an OCR with no dependencies in PHP
You can use the class php OCR that makes learning and text recognition in images totally in PHP, so you don’t need to install anything on your server.…
-
2
votes1
answer495
viewsA: What security breaches were found in Oauth 2.0?
Failure does not exist in the protocol but in the implementation of many Oauth servers. What happens is that the Oauth protocol redirects the user’s browser to the server authorization page, for…
-
2
votes2
answers1386
viewsA: Mail function and its limits
I need to know the limit of the mail function and current servers ? The mail function itself has no limit, but some hosting providers limit the number of messages you can send in the case of shared…
-
0
votes3
answers1134
viewsA: Retrieve statistics from a website
If you want other people to be able to see Google Analytics statistics about your site, it’s best to access the Google Analytics API from the server so you don’t expose your account’s authentication…
-
0
votes1
answer330
viewsA: Sending authenticated email with Swift Mailer
It should work, but I don’t know this class to give a specific recommendation. I recommend the class instead MIME Email message that serves the same purpose, and has a debug option that shows the…
-
2
votes1
answer62
viewsA: Decode characters from email
When these characters come in the headers, the encoding is not well quoted-printable, but rather q-encoding. They are similar encodings, but they are different, so they do not have a specific PHP…
-
1
votes1
answer90
viewsA: How to integrate Slmqueuesqs and Slmmail into a ZF2 application?
It seems to me that the assumption that this solution will avoid overloading your server is false. I will try to explain simply why this is a common confusion. To send messages to an Amazon email…
-
1
votes2
answers765
viewsA: Login system for drawing in php
I think that simpler than making a complete registration system with email validation, would be you allow the user to identify with your Facebook account, Google, Microsoft, Yahoo, etc.. For this…
-
45
votes5
answers17559
viewsA: Mysqli vs PDO - which is the most recommended one to use?
If you are concerned about performance and have no interest in portability, the best option is always mysqli. One of the differences is that with mysqli the prepared queries are implemented on the…
-
1
votes2
answers391
viewsA: mysql_query returning false
If you do not pass the connection identifier obtained before with the mysql_connect function, PHP will connect with a predefined database in the PHP configuration (or not) when using mysql_query,…
-
2
votes4
answers1914
viewsA: Check if a file exists on the remote machine via FTP in PHP
I believe that using the file_exists function can solve your problem more simply: if(file_exists('ftp://usuario:[email protected]:porta/caminho/do/arquivo')) ...
-
13
votes5
answers21909
viewsA: How do I check if an email actually exists?
It is impossible to perform a definitive validation of an email address because many target SMTP servers accept messages even for addresses that do not exist, and maybe only then return a message to…
-
1
votes2
answers1657
viewsA: How to display Google Analytics results on the website?
The ideal is to create a widget that shows the statistics you want just by inserting some HTML and Javascript that makes AJAX requests to pick up the data to show. But it’s safer for this widget to…
-
3
votes4
answers650
viewsA: Return multiple arrays using a buffer without overloading memory
This problem happens because normally PHP uses buffered queries. This means that PHP receives all the result lines before returning the query call. To solve the problem you must use Unbuffered…
-
2
votes4
answers552
viewsA: How to distribute words in a fixed size area?
I think the simplest solution is to put all words in a paragraph instead of a list, and put the text-align attribute into Justified. I used this solution precisely to show a cloud tag with most…
-
2
votes1
answer5307
viewsA: How to work a secure session in PHP using cookies so that the session does not expire when you close your browser?
You can replace the code-based session management functions that store session data in cookies. Here you use the function session_set_save_handler to replace the functions. Here’s a class for data…
-
1
votes2
answers512
viewsA: phpmailer gets blank screen
Blank screen means it gave a fatal error and the script did not generate any output. To see what error has occurred, go to php.ini and change the options to enable error logging and enable error…
-
0
votes2
answers1077
viewsA: How interesting is it to use APC? Is it recommended to use it with objects?
APC will only create a cache in local memory, that is, if your site expands and needs to have multiple servers, the cache of a server will not be viewed by other servers. In this case it might be…
-
4
votes2
answers3573
viewsA: Competing transactions in Mysql
You should not lock tables with LOCK TABLES in normal applications. You should rather use transactions with the correct isolation level to prevent simultaneous access from changing the same records.…
-
3
votes4
answers30736
views -
2
votes4
answers5304
viewsA: How to make an alert with animated echo?
The ideal would be to display the message in a div and use animation libraries to display the text with a highlight that draws more attention to the user. I use a animation library which I have…
-
2
votes2
answers522
views -
2
votes3
answers519
viewsA: Why can’t I connect to my Mysql server?
By the refused connection error message, it can be deduced that the PHP Web server is not responding at port 80 of address 192.168.0.2. Most likely the IP address or port are not the right ones. IP…
-
3
votes2
answers549
viewsA: Import events in Google JSON format
There are many components ready to extract calendar information in ICS format. Try for example this class PHP iCal Parser. Note, I moderate this site, but I did not develop this class.…
-
0
votes2
answers611
viewsA: How to check if there is a function in Titanium Studio?
If you just want to test if the variable already has the value of an assigned function, you can use the typeof function. if(typeof $.minhaview.propriedade === 'function') { // ... }…
-
0
votes4
answers574
viewsA: Is it okay to store the password in a public class variable?
How you process passwords in your code is irrelevant. What matters is how you store them for example in the database. In your code you are not storing in the database, but only in a class variable.…
-
2
votes3
answers10480
viewsA: How to store multiple values in a variable?
You can pass multiple values to the same variable using straight parentheses []. This makes PHP store values in an array. <a href ="verificar.php?valor[]=20&valor[]=30">Imagem</a>…
-
4
votes2
answers299
viewsA: What is a "tick Event" in PHP?
Functions registered as tick handlers are invoked after the Zend Engine executes one (or more) PHP commands, not just when variables are changed. This serves to perform tasks in parallel by…
-
2
votes2
answers1755
viewsA: Problem with email with embedded image
Your script has several errors. I will mention a few. You have a part defined as quoted-printable, so you need to encode that part as quoted-printable using the function quoted_printable_encode…
-
2
votes10
answers29077
viewsA: Scroll through an Array and check if any element is empty
If you just want to find the first occurrence, you can use the functions in_array or array_search. If you want to find all occurrences if there is more than one, it is best to cross the array using…
-
18
votes9
answers6629
viewsA: Why is using Sessions not a good alternative to authentication?
There’s no problem with sessions. The problem may be that initially session data is stored in local files, so if you want to have multiple Web servers for the same site, you may have session…
-
3
votes3
answers35092
viewsA: Ajax cross-Omain request with pure Javascript (no Apis)
The usual solution to take a server resource dynamically without using Jquery or other API is to create the script tag and add in the head section of the page, where you point the src attribute to…
-
0
votes2
answers1089
viewsA: Is there a Parallax Mousemove effect for jQuery?
I know this Javascript component called Panorama which produces the effect it describes, but scrolls the elements on the page horizontally. This component allows to define several layers that move…
-
0
votes4
answers2060
viewsA: How to create a PDF stream in PHP?
I’m afraid there’s no way to control through the server since it’s the browser that "pulls" the PDF file. It is the browser that gradually downloads the file.
-
3
votes8
answers7830
viewsA: Is giving a "SELECT" before an "INSERT" a safe way of not having duplicate records?
It would be right to use transactions using the correct transaction isolation method to encapsulate transactions. For your case, when you start the transaction you need to see if another transaction…