please can someone explain to me how to pass value from one page to another without forms? Example: Page1.html will pass some value to Page2.html Page2.html will accept and print that value THANK YOU!!!
in php you could do this: page1.html go to page2.php?name=something&other=something_else then in page2.php do this: <?php $name=$_GET['name']; $other=$_GET['other'];?> /* and to get those values in javascript*/ <script> var name="<?php echo $name;?>"; var other="<?php echo $other;?>"; </script> PHP:
I don't recommend ever using GET variables to save session state as URL's are easily modified. Either use sessions with PHP (real simple) and populate the javascript variables on page load, or even better, just use Javascript cookies. BTW cookies written by PHP are readable by Javascript and vice-versa.
You could use $_SESSION variables, but I've had some problems in the past with them getting wiped out when I needed them. Why would you not want to use forms? Hidden inputs are always an option.
Since the page is html not php, so I think session is not favored. 2 options: using cookies or passing value through url. If you use passing values through url, you may need a javascript code to extract value from top.location.href