There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
creating a redirect to a "sign in" page


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
fryweed's Avatar
Junior Member with 2 posts.
 
Join Date: Dec 2004
Experience: Advanced
08-Dec-2004, 02:18 AM #1
Question creating a redirect to a "sign in" page
I am creating a webpage, and i am seperating adult, and general material. however i am asking if someone can tell me the code, or means, to redirect a person trying to directly type the url to the adult section back to the disclaimer/sign in page?

Thank you in advance
RossyG123's Avatar
Member with 50 posts.
 
Join Date: Nov 2004
Experience: Mile Wide - Inch Deep
08-Dec-2004, 04:36 AM #2
It mainly depends what language you are using. But the only way that i know how to stop URL hi-jacking, is to use sessions. Do you know anything about sessions? When a user goes to the home page or logs in (if you have log ins) a random generated fixed length string is created, this string is passed to every page that the user goes to, this session is destroyed when the user closes the browser. On every page you simply have a session check() variable to check whether a session has started, if one is active then the user can view the page, if not they are redirected to the home page, or disclaimer page in your case. Are you using a scripting language such as PHP or ASP. Sessions can either use a database or just run in scripting cache, so you dont have to have a backend database

Any help?
__________________
-----RossyG123-----
Heatsink's Avatar
Member with 98 posts.
 
Join Date: Dec 2004
Location: Calgary, Alberta, Canada, eh?!
Experience: Intermediate
08-Dec-2004, 06:50 PM #3
Quote:
Originally Posted by RossyG123
It mainly depends what language you are using. But the only way that i know how to stop URL hi-jacking, is to use sessions. Do you know anything about sessions? When a user goes to the home page or logs in (if you have log ins) a random generated fixed length string is created, this string is passed to every page that the user goes to, this session is destroyed when the user closes the browser. On every page you simply have a session check() variable to check whether a session has started, if one is active then the user can view the page, if not they are redirected to the home page, or disclaimer page in your case. Are you using a scripting language such as PHP or ASP. Sessions can either use a database or just run in scripting cache, so you dont have to have a backend database

Any help?
Or further, don't just check is a session has started, create a session variable that indicates what content they are allowed to see. Then you can check that at the beginning of every page and either deliver or redirect as required.
RossyG123's Avatar
Member with 50 posts.
 
Join Date: Nov 2004
Experience: Mile Wide - Inch Deep
09-Dec-2004, 04:51 AM #4
You can assign certain values to certain users after they have logged in and store this data in session variables. Like heatsink says on every page check what data is stored the session variable, and redirect or show content accordingly.
fryweed's Avatar
Junior Member with 2 posts.
 
Join Date: Dec 2004
Experience: Advanced
16-Dec-2004, 01:22 AM #5
i am right now just using standard html with dreamweaver and i know about sessions, just never have used, or created them. I am pretty much learning as i go, and all, just wanted to try my hand at websites. But i didn't have the idea of using a session, so thank you that did help.
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 05:59 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.