time() is not passing as a Session variable?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • harryusa
    New Member
    • Oct 2008
    • 14

    time() is not passing as a Session variable?

    My scripts are successfully passing single variables and arrays from page to page but I can't get $_Session['orderid'] = time(); to work. I have tried "time()" in an attempt to make it a string and a dozen other things. echo time(); works just fine so I know the server is sending the data. I am looking for a simple way to use the servers time functions to make a fairly unique order id to pass from the order interface to the checkout page and finally the thank you page. What is wrong with my syntax?
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Session must be uppercase.

    Code:
    $_SESSION
    Also, make sure you're starting the session
    Code:
    session_start();
    // before anything else.

    Comment

    • harryusa
      New Member
      • Oct 2008
      • 14

      #3
      I don't know what possessed me to un-cap $_SESSION for this variable but I did and that is exactly why it wasn't working.
      Thank you!

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by harryusa
        I don't know what possessed me to un-cap $_SESSION for this variable but I did and that is exactly why it wasn't working.
        Thank you!
        Very welcome.

        See you around.

        Comment

        Working...