Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-11-2011, 01:32 PM   PM User | #1
dpDesignz
New Coder

 
Join Date: Aug 2010
Location: Hamilton, New Zealand
Posts: 88
Thanks: 5
Thanked 4 Times in 4 Posts
dpDesignz is an unknown quantity at this point
Question PHP Login Script user logged in

I'm using the PHP Login Script v2.0 and I want to make it on my index page, that when a user is logged in it shows some content, but if they're not logged in it shows something else. This is what I have so far, but I keep getting syntax errors: http://pastebin.com/RGBPpWHT.

Can anyone help with this? I'm not sure what info is needed, but if you need more just let me know.
__________________
dpDesignz is offline   Reply With Quote
Old 05-11-2011, 01:35 PM   PM User | #2
tomharto
Regular Coder

 
Join Date: Jul 2010
Location: Sheffield
Posts: 794
Thanks: 91
Thanked 18 Times in 18 Posts
tomharto is on a distinguished road
Try putting the session_start(); (line 6x) at the VERY start, JUST after the opening <?php
tomharto is offline   Reply With Quote
Users who have thanked tomharto for this post:
dpDesignz (05-11-2011)
Old 05-11-2011, 01:38 PM   PM User | #3
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
This is what I have so far, but I keep getting syntax errors:
Could you please post the exact error and the code in that specified line, along with one or two lines adjacent to it?
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 05-11-2011, 01:49 PM   PM User | #4
dpDesignz
New Coder

 
Join Date: Aug 2010
Location: Hamilton, New Zealand
Posts: 88
Thanks: 5
Thanked 4 Times in 4 Posts
dpDesignz is an unknown quantity at this point
Quote:
Originally Posted by abduraooft View Post
Could you please post the exact error and the code in that specified line, along with one or two lines adjacent to it?
This is what I get:
Parse error: syntax error, unexpected $end in /var/www/vhosts/dbnz.net.nz/httpdocs/index.php on line 311
__________________
dpDesignz is offline   Reply With Quote
Old 05-11-2011, 01:51 PM   PM User | #5
dpDesignz
New Coder

 
Join Date: Aug 2010
Location: Hamilton, New Zealand
Posts: 88
Thanks: 5
Thanked 4 Times in 4 Posts
dpDesignz is an unknown quantity at this point
@tomharto thanks heaps! That worked.
__________________
dpDesignz is offline   Reply With Quote
Old 05-11-2011, 02:07 PM   PM User | #6
abduraooft
Supreme Master coder!

 
abduraooft's Avatar
 
Join Date: Mar 2007
Location: N/A
Posts: 14,678
Thanks: 158
Thanked 2,182 Times in 2,169 Posts
abduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really niceabduraooft is just really nice
Quote:
Originally Posted by dpDesignz View Post
This is what I get:
Parse error: syntax error, unexpected $end in /var/www/vhosts/dbnz.net.nz/httpdocs/index.php on line 311
Quote:
Originally Posted by dpDesignz View Post
@tomharto thanks heaps! That worked.
The error you've posted is an indication of a mismatched/missing curly brace!
__________________
Quote:
The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)
abduraooft is offline   Reply With Quote
Old 05-11-2011, 02:10 PM   PM User | #7
tomharto
Regular Coder

 
Join Date: Jul 2010
Location: Sheffield
Posts: 794
Thanks: 91
Thanked 18 Times in 18 Posts
tomharto is on a distinguished road
No problem . If i helped dont forget the thanks button :P
tomharto is offline   Reply With Quote
Old 05-11-2011, 02:46 PM   PM User | #8
tangoforce
Senior Coder

 
tangoforce's Avatar
 
Join Date: Feb 2011
Location: Your Monitor
Posts: 3,493
Thanks: 44
Thanked 438 Times in 427 Posts
tangoforce will become famous soon enoughtangoforce will become famous soon enough
Quote:
Originally Posted by dpDesignz View Post
This is what I get:
Parse error: syntax error, unexpected $end in /var/www/vhosts/dbnz.net.nz/httpdocs/index.php on line 311
Quote:
Originally Posted by abduraooft View Post
The error you've posted is an indication of a mismatched/missing curly brace!
Indeed. You might like to look at my recent TIP
__________________
Please wrap your code in [php] tags. It is a sticky topic and it HELPS us to HELP YOU!
TIP: Coding styles and $end errors :::::::::: TIP: Warning: Cannot modify header information - headers already sent :::::::::: TIP: Quotes / Parse error: syntax error, unexpected T_..
PHP Code:
//Please don't use this for your form processing:
if (isset($_POST['submit']))
//Internet explorer has a bug and does not always send the submit value. 
Explanation: The IE if(isset($_POST['submit'])) bug explained.
tangoforce is offline   Reply With Quote
Reply

Bookmarks

Tags
if/else, logged in, php, php login script, user

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 01:16 AM.


Advertisement
Log in to turn off these ads.