Go Back   Computer Forums > General Computing > Programming
Click Here to Login
Join Computer forums Today


Reply
 
Thread Tools Search this Thread Display Modes
 
Old 12-05-2010, 06:55 PM   #1
Beta Member
 
Join Date: Feb 2009
Posts: 3
Default php registered user only help

So i am trying to use this

<code>
<?php
if($_SESSION['id'])
echo '<h1>Hello, '.$_SESSION['usr'].'! You are registered and logged in!</h1>';
else echo '<h1>Please, <a href="demo.php">login</a> and come back later!</h1>';
echo 'Should i find a new login'
?>
<code>
to make
__________________

PBRgearbox is offline   Reply With Quote
Old 12-06-2010, 05:10 AM   #2
Solid State Member
 
Join Date: Nov 2010
Posts: 18
Cool Help

Hi do any of you know a script for a horizontal drop down menu for java not java script.

Big Thanks
__________________

zachary is offline   Reply With Quote
Old 12-06-2010, 01:27 PM   #3
Beta Member
 
Join Date: Feb 2009
Posts: 3
Default Re: php registered user only help

Please dont ask a question in a thread that has a completely unconnected question in it. make your own thread after searching the web.
PBRgearbox is offline   Reply With Quote
Old 12-08-2010, 12:23 PM   #4
Site Team
 
root's Avatar
 
Join Date: Mar 2004
Posts: 8,006
Default Re: php registered user only help

for the OP.

investigate the possibilities of using ob_start(); and session_start(); at the top of your script.
this will enable you to put some session information into the headers to keep sessions on the browser, if you've already sent any content to the browser then you can't edit the headers later.

PHP manual pages have quite a few examples on using these functions.
__________________
I didn’t fight my way to the top of the food chain to be a vegetarian…
Im sick of people saying 'dont waste paper'. If trees wanted to live, they'd all carry guns.
"The inherent vice of capitalism is the unequal sharing of blessings; The inherent vice of socialism is the equal sharing of miseries."
root is offline   Reply With Quote
Old 12-09-2010, 08:36 AM   #5
Beta Member
 
Join Date: Dec 2010
Posts: 2
Default Re: php registered user only help

<code>
<?php
session_start();

if isset(!$_SESSION['id'])
{echo 'not logged in';}
else
echo 'logged in and registered';
?>
<code>
Fourntwenty is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

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



All times are GMT -5. The time now is 08:16 AM.


Powered by vBulletin® Version 3.8.8 Beta 4
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Search Engine Friendly URLs by vBSEO 3.6.0