473,405 Members | 2,310 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

login script question in a PHP-CGI environment



The server that the script will run on has the following settings:

PHP Ver: 4.1.2
Server API: CGI
Register Globals: ON
Session Support: ON

I want to use sessions to store the information necessary to check to
see if the user is authenticated prior to each request the user makes.

I do not have access to modify any of the settings in the php.ini file
due to fact that this is a shared web hosting server.

Is there anything I need to be aware of that is different due to the
fact that PHP is running as a CGI ? I am familiar with the process
when PHP is running as a server module, but not familiar with PHP
running as a CGI.

Basically looking for guidance on the logic, I can write the code.

Thanks in advance

Viking
Jul 17 '05 #1
2 1884
Viking wrote:


The server that the script will run on has the following settings:

PHP Ver: 4.1.2
Server API: CGI
Register Globals: ON
Session Support: ON

I want to use sessions to store the information necessary to check to
see if the user is authenticated prior to each request the user makes.

I do not have access to modify any of the settings in the php.ini file
due to fact that this is a shared web hosting server.

Is there anything I need to be aware of that is different due to the
fact that PHP is running as a CGI ? I am familiar with the process
when PHP is running as a server module, but not familiar with PHP
running as a CGI.

Basically looking for guidance on the logic, I can write the code.

Thanks in advance

Viking


Hi Viking,

I am not sure I understand your problem.
If you want to use session to check if the user is authenticted to see
certain pages, why not include some script above these pages that does
excactly that??
something like this.
checkUserIsAuthenticated.inc
<?
if ($_SESSION["isAdmin"] == "Y") {
// okay, continue.
} else {
echo "You are not authenticated!! Go away!";
exit 0;
}
?>

just start every page for 'admin' with that include.

This approach has nothing to do with CGI or ISAPI or whatever install you
did. It is just plain PHP and Sessions.

But maybe I am missing your point completely. :-/

Regards,
Erwin Moller
Jul 17 '05 #2
You understood correctly, I just wanted to know if PHP running as a
CGI needed to be treated differently in regards to sessions.

Thanks :)

Viking
On Tue, 10 Feb 2004 09:38:01 +0100, Erwin Moller
<si******************************************@spam yourself.com> wrote:

Hi Viking,

I am not sure I understand your problem.
If you want to use session to check if the user is authenticted to see
certain pages, why not include some script above these pages that does
excactly that??
something like this.
checkUserIsAuthenticated.inc
<?
if ($_SESSION["isAdmin"] == "Y") {
// okay, continue.
} else {
echo "You are not authenticated!! Go away!";
exit 0;
}
?>

just start every page for 'admin' with that include.

This approach has nothing to do with CGI or ISAPI or whatever install you
did. It is just plain PHP and Sessions.

But maybe I am missing your point completely. :-/

Regards,
Erwin Moller


Jul 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: koolyio | last post by:
Hey, could you please tell me what is wrong with my login script. I just started learning php. CODE: login.php <? session_start(); header("Cache-Control: private"); ?>
5
by: Phillip Armitage | last post by:
I've spent the better part of two days checking out PHP, javascript and numerous other language sites trying to find what I figure should be be an easy web script page. Essentially what I want is a...
2
by: Tom | last post by:
I hope someone can help me figure out what's going on here. I've re-read the section on sessions at php.net and Googled this high and low but I haven't found anything that quite explains my...
8
tolkienarda
by: tolkienarda | last post by:
hi all i have a login script that is simplified with out any extra stuff. and it doesn't seem to work. i think the problem is something to do with session variables. but i am not sure what it is....
1
by: jsd219 | last post by:
I have a fairly simple login in script and I need to make it have two levels of access not one. can anyone help me with this? The script is below: <?php // we must never forget to start the...
3
by: bull1099 | last post by:
I designed a simple site which has a login for users to access their account page. When i had my files uploaded on a terrible hosting service site, my website I designed was fully functional. I moved...
5
by: muppetjones | last post by:
I'm really new to the whole networking side of things, so I don't know the backend very well. I wrote a series of PHP/AJAX scripts to allow a user to create a login account, but apparently my script...
3
by: harsh9892991141 | last post by:
every time enter my login id and password in my index page it shows me the error 404 Object not found! The requested URL was not found on this server. The link on the referring page seems to be...
10
by: DavidPr | last post by:
When I logout as one user and log in under a different user, it opens with the last user's information. User 1 - Unsername: Davey Jones User 2 - Unsername: David Smith I log out from Davey...
9
by: adweaver | last post by:
Hello All, I'm new to the world of php. I've just had a site designed for me by a company, and I'm now trying to manage and grow it, so it will suit my needs. The site was built in a folder...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.