Jump to content

PHP in CGI Script


Prevost

Recommended Posts

Ok, Im a complete n00b when it comes to anything else besides html so I do apologise if I am asking a stupid question.

 

Im currently running a cgi script on my server (.pl extension). I also have a basic user system on my site and a small php code snipplet needs to be placed on pages to prevent certain user levels from being able to access the page and vice versa. I also want this CGI page to be restricted to certain users as this page is a "premium" service so to speak.

 

I have tried placing the php snipplet on the top of the page to see if it would work and obviously it didnt. If anyone could suggest anything, I would be very greatful!

Link to comment
https://forums.phpfreaks.com/topic/57375-php-in-cgi-script/
Share on other sites

you need to be more specific... do you store your user_levels in a database? and is your user system writing in PHP?

 

Cause the simpel answer would be like this:

 

if($userlevel == "highest_level"){

  echo "Secret page";

}else{

  echo "You do not have permission to enter this page!";

}

Link to comment
https://forums.phpfreaks.com/topic/57375-php-in-cgi-script/#findComment-283844
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.