Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New Coder
    Join Date
    Aug 2010
    Location
    Hamilton, New Zealand
    Posts
    88
    Thanks
    5
    Thanked 4 Times in 4 Posts

    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.

  • #2
    Regular Coder
    Join Date
    Jul 2010
    Location
    Sheffield
    Posts
    824
    Thanks
    93
    Thanked 18 Times in 18 Posts
    Try putting the session_start(); (line 6x) at the VERY start, JUST after the opening <?php

  • Users who have thanked tomharto for this post:

    dpDesignz (05-11-2011)

  • #3
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    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?
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #4
    New Coder
    Join Date
    Aug 2010
    Location
    Hamilton, New Zealand
    Posts
    88
    Thanks
    5
    Thanked 4 Times in 4 Posts
    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

  • #5
    New Coder
    Join Date
    Aug 2010
    Location
    Hamilton, New Zealand
    Posts
    88
    Thanks
    5
    Thanked 4 Times in 4 Posts
    @tomharto thanks heaps! That worked.

  • #6
    Supreme Master coder! abduraooft's Avatar
    Join Date
    Mar 2007
    Location
    N/A
    Posts
    14,852
    Thanks
    160
    Thanked 2,223 Times in 2,210 Posts
    Blog Entries
    1
    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!
    The Dream is not what you see in sleep; Dream is the thing which doesn't let you sleep. --(Dr. APJ. Abdul Kalam)

  • #7
    Regular Coder
    Join Date
    Jul 2010
    Location
    Sheffield
    Posts
    824
    Thanks
    93
    Thanked 18 Times in 18 Posts
    No problem . If i helped dont forget the thanks button :P

  • #8
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,309
    Thanks
    58
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    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
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •