How do you get a PHP variable to stick?

  • Thread starter Thread starter Makoto Yoshimoto
  • Start date Start date
M

Makoto Yoshimoto

Guest
what you need to do is use cookies or start a session. I cant remember the code for that off the top of my head, but www.tizag.com has some great resources for you
 
I have some code

<?php $num++; ?>

that I want to increment everytime the page goes by. However, after some debug code...

<?php echo "num = $num"; $num++; "num = $num"; ?>

results in:

num = num = 1

everytime. How do you fix this?
 
Back
Top