By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,350 Members | 1,309 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,350 IT Pros & Developers. It's quick & easy.

time() is not passing as a Session variable?

P: 14
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?
Oct 15 '08 #1
Share this Question
Share on Google+
3 Replies


Markus
Expert 5K+
P: 6,050
Session must be uppercase.

Expand|Select|Wrap|Line Numbers
  1. $_SESSION
Also, make sure you're starting the session
Expand|Select|Wrap|Line Numbers
  1. session_start();
  2. // before anything else.
  3.  
Oct 15 '08 #2

P: 14
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!
Oct 15 '08 #3

Markus
Expert 5K+
P: 6,050
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.
Oct 15 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.