PHP HELP

Status
This thread has been locked.

Fip

Banned
Feedback score
-2
Posts
20
Reactions
1
Resources
0
hey i need a small help i want both of thoses to be one so when u try to access the page u must have both privileges

so your package must be Professional and your active must be 1

PHP:
$result = mysqli_query($con, "SELECT * FROM `packages` WHERE `name` = 'Professional'") or die(mysqli_error($con));


PHP:
$result = mysqli_query($con, "SELECT * FROM `subscriptions` WHERE `username` = '$username' AND `Active` = '1' AND `expires` >= '$date'") or die(mysqli_error($con));
 
PebbleHost
High performance, consistent uptime and fast support. Minecraft hosting that just works.

Ghast

Founding Father of Hypocrisy - https://artemis.ac
Supreme
Feedback score
54
Posts
2,096
Reactions
3,285
Resources
79
hey i need a small help i want both of thoses to be one so when u try to access the page u must have both privileges

so your package must be Professional and your active must be 1

PHP:
$result = mysqli_query($con, "SELECT * FROM `packages` WHERE `name` = 'Professional'") or die(mysqli_error($con));


PHP:
$result = mysqli_query($con, "SELECT * FROM `subscriptions` WHERE `username` = '$username' AND `Active` = '1' AND `expires` >= '$date'") or die(mysqli_error($con));
Have you tried working with sessions or cookies? If you make a cookie, you can auth them on each page login and depending on their privilege you can make the page die.
 

Fip

Banned
Feedback score
-2
Posts
20
Reactions
1
Resources
0
Have you tried working with sessions or cookies? If you make a cookie, you can auth them on each page login and depending on their privilege you can make the page die.
i dont use cookies, i just want the page to be accessiable to those roles but if u have discord can u just tell me how t o fix it
 
Banned forever. Reason: Ban Evading (Sahmir)

Ghast

Founding Father of Hypocrisy - https://artemis.ac
Supreme
Feedback score
54
Posts
2,096
Reactions
3,285
Resources
79
i dont use cookies, i just want the page to be accessiable to those roles but if u have discord can u just tell me how t o fix it
I’m not going to spend time to spoonfeed you. Google has a lot of solutions.
 

Fip

Banned
Feedback score
-2
Posts
20
Reactions
1
Resources
0
I’m not going to spend time to spoonfeed you. Google has a lot of solutions.
can u send me a link ? i just want to merge both into one[DOUBLEPOST=1565454962][/DOUBLEPOST]
I’m not going to spend time to spoonfeed you. Google has a lot of solutions.
i can pay u like 2usd
 
Banned forever. Reason: Ban Evading (Sahmir)

Ghast

Founding Father of Hypocrisy - https://artemis.ac
Supreme
Feedback score
54
Posts
2,096
Reactions
3,285
Resources
79
can u send me a link ? i just want to merge both into one[DOUBLEPOST=1565454962][/DOUBLEPOST]
i can pay u like 2usd
I’m travelling mate. Just look up “PHP login with cookies”
 

JustRayz

Feedback score
4
Posts
516
Reactions
119
Resources
0
If I'm understanding you, you can change your SQL query to validate both roles in one query.
Also: I recommend you use JWTs for authorisation like this. If you're going to use mysql in PHP, PDO queries are probably better for you, they're less efficient but much more secure.
 
Last edited:

Ghast

Founding Father of Hypocrisy - https://artemis.ac
Supreme
Feedback score
54
Posts
2,096
Reactions
3,285
Resources
79
If I'm understanding you, you can change your SQL query to validate both roles in one query.
Also: I recommend you use JWTs for authorisation like this. If you're going to use mysql in PHP, PDO queries are probably better for you, they're less efficient but much more secure.
PDO is more appropriate for login queries or anything which is doing a GET request.
 

JustRayz

Feedback score
4
Posts
516
Reactions
119
Resources
0
PDO is more appropriate for login queries or anything which is doing a GET request.
Precisely, and I'm sure he'll be doing that at some point if he's having permission-based areas of a site. It's easier to use PDO for everything, rather than PDO for some, mysqli for others etc.
 
Status
This thread has been locked.
Top