Solved

security in accessing web pages?

Posted on 2002-04-01
9
160 Views
Last Modified: 2012-05-04
hai,

Iam using html,php for web page development.
my db is mysql,server apache.
I have a user login page, which validates the user name & password,& later navigates to other pages.

but if I want to restrict the users directly access the second pages,(in case they know the url of second page)
what security measures I need to take & how.
can anyone suggest me.

thanks
manju
0
Comment
Question by:manju70
  • 3
  • 3
  • 2
  • +1
9 Comments
 
LVL 30

Expert Comment

by:third
ID: 6912210
im not an expert in php i usually use asp as a server-side script. in asp, i do it through session. i set a session after validating the user. then on each succeeding page, i check for the value of this session. if it doesn't exist i redirect him to the main page, if it does (meaning the user went the right process) then i'll display the page.

i've searched a little and found out session_id in php. its quite similar i guess so read about it. i'm hoping you're familiar with it too. gud luck!

http://www.php.net/manual/en/function.session-id.php

http://www.php.net/manual/en/ref.session.php
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 6912664
well i would suggest you to write the html of the private pages thru the script every time the user logs in; i have no knowledge about php so im not sure if this can be done in that;

but writing dyhnamically is the idea;

lexxwern
and
Belated Happy Holi
0
 
LVL 12

Expert Comment

by:lexxwern
ID: 6912665
well i would suggest you to write the html of the private pages thru the script every time the user logs in; i have no knowledge about php so im not sure if this can be done in that;

but writing dyhnamically is the idea;

lexxwern
and
Happy Holi
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 12

Expert Comment

by:lexxwern
ID: 6912670
or perhaps the login script writes a file onto the server; and the page loads only if the file exists and on logout this file gets deleted;

lexxwern

PS. as you see there may be a number of solutions and you will have to decide which is the best for you;
0
 
LVL 18

Accepted Solution

by:
bruno earned 30 total points
ID: 6913073
I'll back up what third said.

I do the same thing in ASP, when the user logins in to my page, i set

===
session("strLogin") = true
===

then i check that on each page..

===
if session("strLogin") <> true then
   response.redirect = "login.asp"
end if
===

I hope you can translate that to PHP, it's pretty straightforward, but I don't know PHP either.


BRUNO



0
 
LVL 18

Expert Comment

by:bruno
ID: 6924690
manju70,

any reason for the B grade without a comment?


BRUNO
0
 
LVL 30

Expert Comment

by:third
ID: 6924866

and any reason why the backup answer was accepted??

0
 
LVL 18

Expert Comment

by:bruno
ID: 6925314
another good question...  :-)  sorry third.  
0
 
LVL 5

Expert Comment

by:Netminder
ID: 6927355
Grade changed.

third: points for you at http://www.experts-exchange.com/jsp/qShow.jsp?ta=html&qid=20286375

Netminder
CS Moderator
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Find out what you should include to make the best professional email signature for your organization.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question