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
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
Share on other sites

the question is specific. i am not sure if you can run PHP in CGI files.

maybe there is a way to transfer sessions, like they both have them then just re-create your php snippit into perl so you can check if they are the required level.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.