Computer Webmaster Gaming Console Graphics Forum

Welcome to the Computer Webmaster Gaming Console Graphics Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

MK PitStop Main Earn $25 Earn Money Posting Extras Members Blogs Image Hosting User Pages
Go Back   Computer Webmaster Gaming Console Graphics Forum > Webmaster Forum > Website Coding > PHP
Register FAQ/Rules Become A V.I.P. Member Search Today's Posts Mark Forums Read

PHP PHP for some can be one of the hardest website programming codes, so do you need help on your PHP script, if it is php4, php5 or lower this is the place for you for any PHP help.

Google
Reply
 
LinkBack Thread Tools Display Modes
Old 08-02-2006, 2:51 AM   #1
eric
Member Level 3
 
eric's Avatar
 
Join Date: Jul 2006
Posts: 49
My Photos: (0)
iTrader: (0)

Banked:
MK Cash: $0.00

I am Worth:
MK Cash: $0.00
Donate

Recent Blog: None

eric is on a distinguished road
Default PHP session question

Working on some admin pages for a PHP/MySQL application. I'm really new to these languages, I've only read like 2 tutorials, so bear with me. I coded a basic login page with username and password fields. When the correct ones are entered the user is taken to the administrator menu page. From there, you can navigate to a ......./create.php page, for example. My concern is that a user can skip the login process altogether if he/she types http://<path>/create.php directly into the address bar, which takes the user directly to that page and bypasses the login process. Is there anyway to prevent this, like to secure all the pages accessed after logging in? I was researching this and I think I have to start a session with the session_start(); command, but it kept giving me errors dealing with session_cache_limiter or something similar.

Does anyone have any good ideas how to do this?
eric is offline  
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Old 08-02-2006, 8:06 PM   #2
Whatcha
Back Office Guy-
 
Whatcha's Avatar
 
Join Date: Mar 2006
Location: At my pc
Posts: 533
My Photos: (6)
iTrader: (0)

Banked:
MK Cash: $0.00

I am Worth:
MK Cash: $0.36
Donate

Recent Blog: None

Whatcha is just really niceWhatcha is just really niceWhatcha is just really niceWhatcha is just really niceWhatcha is just really nice
Default

Okay two points. First u need to learn sesssions very important if u want to create some sort of secure app u will need to a session on each page where u want to track the user and it must be the first command!
Code:
<?php session_start(); ?> Below will cause errors <?php $x ="Bad"; session_start(); ?>
Check out http://www.zend.com/zend/tut/session.php
For the second part to avoid ppl being able to have direct access to secure pages u will need to create a function to checked the user is logged in before the page is displayed.
U could also secure it a little more by include the secure page rather than redirecting to it. Also using some thing this below will at another small layer of security
Code:
<?php ##Login Page ##Good User define("Allowed", "Yes"); include 'admin.php'; ?> <?php ### admin.php #### if(!defined('Allowed')){ die("Access Refused"); } /* If the admin.php page is access directly the constant of "Allowed" will not be defined there for access refused*/ ?>
__________________
http://www.backwebservices.co.uk | Free Lance Web Coder | Ebay & Paypal Solutions Provider
Whatcha is offline  
Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit!
Reply With Quote
Featured Websites
Free Space
Free Space
Free Space Free Space
Reply
Tags: , ,




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

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

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
psp question NytKrawlrx Handheld Computer Consoles 7 05-31-2008 1:52 PM
Burning Question clarise CD/DVD Drives and re-writers Technology 4 07-30-2006 9:38 PM
Rep question? JeJe Community Chat 37 04-18-2006 2:53 AM
Not really a bug more a question Kristof Bugs And Feedback 5 04-01-2006 11:38 AM


Featured Websites




All times are GMT +1. The time now is 11:41 AM.


Powered by: vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.0.0
Cheap Computers
MK PitStop Copyright 2005 - 2008

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98