SitePoint Sponsor

User Tag List

Results 1 to 13 of 13
  1. #1
    SitePoint Member ppong's Avatar
    Join Date
    Sep 2003
    Location
    Singapore
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    session_start problem

    Hi all, im a beginner so pls bear with me i have tried to run the following code and got Parse Error on line 2... session_start(). im using tripod free account and have checked that they do support php4... so what is likely to be the problem? Thanks for all ur help in advance!

    <?php
    session_start():
    session_register('count');
    $count++;
    echo"<P>U have been her $count times</P>";
    ?>

  2. #2
    SitePoint Zealot
    Join Date
    Nov 2002
    Posts
    142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Change that line to:

    session_start();

  3. #3
    SitePoint Member ppong's Avatar
    Join Date
    Sep 2003
    Location
    Singapore
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey thanks man! thats one silly mistake :P

  4. #4
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To utilize Good Practice™ in your coding, you really should be using the $_SESSION array.

  5. #5
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mattjacob
    To utilize Good Practice™ in your coding, you really should be using the $_SESSION array.
    He means the following:
    PHP Code:
    session_start ();
    $_SESSION["count"] = ( isset ( $_SESSION["count"] ) ) ? $_SESSION["count"] + 1;
    print ( 
    "You have been here " $_SESSION["count"] . " times" ); 

  6. #6
    SitePoint Member ppong's Avatar
    Join Date
    Sep 2003
    Location
    Singapore
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    point noted and thanks tonnes for all yah reply!

  7. #7
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ppong
    point noted and thanks tonnes for all yah reply! [img]images/smilies/smile.gif[/img]
    We're always gald to help you! Please, if you want to appreciate our help, give us some reputation by click on 'rate' button!

  8. #8
    SitePoint Member ppong's Avatar
    Join Date
    Sep 2003
    Location
    Singapore
    Posts
    10
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    haha just got to know that theres such a function :P

  9. #9
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hey! What did you do? I got a white square! It didn't increase my reputation!

  10. #10
    ********* Wizard silver trophy Cam's Avatar
    Join Date
    Aug 2002
    Location
    Burpengary, Australia
    Posts
    4,495
    Mentioned
    0 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Mika
    Hey! What did you do? I got a white square! It didn't increase my reputation!
    Weak dude, who cares about reputation?

    You got a white square because he is a new member and doesn't have high enough level to be able to give positive rep but really, what's it worth?

  11. #11
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks, DJ! Now I see...............As for my reputation, I dunno! As I mentioned before, I'm a professional PHP developer who gets paid for his job, on RentACoder though.....but I'm only 16! And I'll look for some good company in Spring! But sometimes I wanna somethig new, become a Mentor for example!

  12. #12
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    IMO, you can't be 16 and still call yourself a professional.

  13. #13
    SitePoint Wizard Mike Borozdin's Avatar
    Join Date
    Oct 2002
    Location
    Edinburgh, UK
    Posts
    1,743
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by mattjacob
    IMO, you can't be 16 and still call yourself a professional.
    Hmmmmmmm............................!!!!!

    www.nonprofitcomputeracademy.org (Shopping cart, class reg system, etc.)
    www.f1central.net/fantasy/fun ( The game )
    www.hottestlyrics.com (programming, there're .htm files but they are still PHP driven!)
    www.lscos.com (Content Management System)
    www.kidneyurology.org (Clinic Managemnet System)
    www.hospitality-online.co.za (Buyers' guide)


Bookmarks

Posting Permissions

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