Posts by Renan Cavalieri • 2,748 points
64 posts
-
2
votes1
answer92
viewsQ: In a relational database model, should an audit table relate to all entities?
The title already says it all, in a relational database model, an audit table, must have relationship with all entities I want to insert in the audit?
databaseasked Renan Cavalieri 2,748 -
3
votes2
answers185
viewsA: How to store a website settings?
I usually create a class app_config, and its instance right in the index of the application with the current directory and indicate a configuration file config.ini.php with the settings, in your…
-
1
votes1
answer1645
viewsA: Malicious code on all pages
First you have to make sure it is on the server or in your browser. If you access the source code from the browser, there is a good chance that it is only your browser, that is, your PC, if you…
-
4
votes2
answers243
viewsQ: Is it safe to use $_SERVER variables to log errors?
We all know that it is possible to manipulate some information during a request, I never had to use anything like $_SERVER[HTTP_HOST], $_SERVER[REQUEST_URI] or $_SERVER['REMOTE_ADDR'] because I know…
phpasked Renan Cavalieri 2,748 -
8
votes1
answer69
viewsQ: How do serial numbers work in a system?
You know when you buy a game online and you get the CD-KEY, and then you open an app and you record that CD-KEY for you? Or else you bought your new Operating System and will register and insert a…
-
1
votes2
answers244
viewsA: How to inject a variable into a page that was required by a function
Ivan Ferrer’s answer helped a lot, but here’s my solution in case it fits someone else. In my controller my render() function looks like this: public function render() { $template = new…
-
3
votes2
answers244
viewsQ: How to inject a variable into a page that was required by a function
I have the following problem, I am using an MVC model for a CMS in PHP study, but I would like it to be possible to use themes, for this I created a configuration variable that stores the theme name…
-
2
votes2
answers115
viewsA: Error activating WP_DEBUG
The WP_DEBUG constant displays problems and alerts related to settings, plugins and even security, therefore you cannot leave it active in a production environment. When you set the WP_DEBUG to…
-
2
votes2
answers482
viewsQ: Avoid permanent connections and Singleton class in a PHP project
I am developing a CMS with PHP and using the MVC standard, without using frameworks, I know many will say that I should not do this, but I am doing this as a form of study. However, I never really…
-
2
votes4
answers2145
viewsA: What technique do I use to keep a form field completed or selected after $_POST[]?
I don’t know if this is what you want, but you can make your page have 2 types of behavior, a pattern and one for $_POST requests, and when submitting your form, submit to the page itself. I usually…
-
4
votes6
answers1100
viewsA: Same number of characters in password after md5
There is no way to know the number of characters of a md5 hash, precisely because it is one-way, and that is its purpose. One way to know how much was before would be to save that amount in a…
-
15
votes8
answers1094
viewsQ: Is it recommended to use constants for configuring a PHP project?
It is very common to see constants in a configuration file in a PHP project, but I would like to know if this is really the best practice, because I think if I store the password of a database in a…
-
1
votes1
answer146
viewsA: Report of Wordpress users
First you have to make sure that this information exists in your Wordpress database. If the user signed up by the common Wordpress registration form, there will be no such information. In case if he…
-
9
votes3
answers1009
viewsA: Encryption security in php
You do not store passwords in the database, instead you store their hash, and use this as a comparison at the time you have to log in. MD5 and SHA1 are of one-way, you cannot break, but there are…