NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Function return false?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
2 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 08-25-2005, 02:22 PM THREAD STARTER               #1 (permalink)
Eating Pie
 
iNod's Avatar
Join Date: Nov 2004
Location: Canada
Posts: 2,267
iNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud ofiNod has much to be proud of
 


Special Olympics AIDS/HIV Cystic Fibrosis Save The Children Baby Health Cystic Fibrosis

Function return false?


Hello,

I have a dilemma. You see I need a function (logged) to return false if session admin isn't set.

Here is the code

PHP Code:
function logged() {
????: NamePros.com http://www.namepros.com/programming/118637-function-return-false.html
    if(
session_is_registered('admin')) {
    }

Pretty much I want the function to return false is session admin isn't registred.

How would I go about doing this I try many different things including return true;/false and things.

iNod
__________________
I feel old.
iNod is offline  
Old 08-25-2005, 03:32 PM   #2 (permalink)
NamePros Expert
 
Peter's Avatar
Join Date: Nov 2003
Location: Scotland
Posts: 5,074
Peter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond reputePeter has a reputation beyond repute
 


Child Abuse Save The Children Save The Children Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009 Help The Homeless - Holiday 2009
The following should do what you want.

PHP Code:
function logged() {
    if(
session_is_registered('admin'))
    {
         return 
true;
    }
    else
    {
         return 
false;
    }

just in case you was not aware there should be no quotes around true and false.
__________________
Manage your portfolio using my new Domain Portfolio Management script.
Securing Your Domain Name From Theft
Last edited by Peter; 08-25-2005 at 03:36 PM.
Peter is offline  
Old 08-25-2005, 03:39 PM   #3 (permalink)
Account Suspended
 
axilant's Avatar
Join Date: May 2004
Location: /etc/passwd
Posts: 2,178
axilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to beholdaxilant is a splendid one to behold
 

Member of the Month
July 2005

Id also like to add.

Doing this function, logged(), make sure you challege the username/password to the ones in the database or wherever you have it stored. this way you wont have people spoofing the session to gain access.
axilant is offline  
Closed Thread


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
All about the mail function in PHP. bbalegere Programming 1 08-19-2005 09:25 PM
What is the Nice Titles Script do? dpk87 Programming 0 07-25-2005 01:18 PM
200 np for urgent help!!!! (php) fusionweb Programming 22 05-24-2005 07:05 AM

 
All times are GMT -7. The time now is 12:12 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger