Hot answers tagged

5 votes
Accepted

Parsing gateway ip from `/proc/net/route` in a docker container

Reading the gateway IP I'm not an expert of reading routing info, but: Linuxtopia's article on Linux Filesystem Hierarchy confirms that /proc/net/route contains ...
janos's user avatar
  • 111k
4 votes
Accepted

Follow up to Validation Script in PHP

First query looks good. any more improvements I don't understand why you're even asking the question. What part of Sam's "use bound variables" answer was unclear? We start out with ...
J_H's user avatar
  • 13.8k
4 votes
Accepted

PHP Validation script

Use bound parameters in database queries In the answer to your previous question by Your Common Sense was this advice: in SQL, always use parameters instead of PHP variables for any database ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
3 votes

Boolean Value Object

What I understand about your class, it would take $bool as an input then parse it to boolean value. So it has 2 responsibilities here: parse string to boolean and represent a boolean value. Also, if ...
Kevin's user avatar
  • 71
3 votes

Parsing gateway ip from `/proc/net/route` in a docker container

It is wise to ensure an array has a key before dereferencing it After the call to preg_match() the code accesses key 2: ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
2 votes
Accepted

SQL & PHP login method

Yes indeed, your approach is severely outdated. Such a code nowadays is frowned upon. Here are some rules for the better code Each script should consist of four parts Initialization. Usually it's ...
Your Common Sense's user avatar
2 votes

How to reduce a POST request duplicate in Laravel/PHP for payment system?

There are two ways to reduce duplicate POST request code in Laravel/PHP for a payment system: Use a trait. This allows you to define a reusable block of code that can be shared across multiple ...
hashirshabbir's user avatar
2 votes

Selecting random results within Doctrine

Increment operator ➕➕ can be moved up after usage in while loop In the first while loop to add numbers to ...
Sᴀᴍ Onᴇᴌᴀ's user avatar
1 vote
Accepted

PHP login codes suggestions

Nice to hear you got your code working. I will help you a bit with the validation script. These are the points of improvement: Your input filtering is not doing anything because you haven't specified ...
KIKO Software's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible