shage Posted June 23, 2007 Share Posted June 23, 2007 What is the best way to pass variable for image such as height and width using url string to pass onto every page on the server? $w and $h is what im using for the var. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/56841-passing/ Share on other sites More sharing options...
chigley Posted June 23, 2007 Share Posted June 23, 2007 Look into using sessions: <?php session_start(); // You must have this on every page $_SESSION["width"] = 10; // Use these lines to define $_SESSION variables $_SESSION["height"] = 15; header("Location: anotherpage.php"); // The user can go to another page by clicking a link if you want, redirect used here as an example ?> Then in anotherpage.php: <?php session_start(); // You must have this on every page echo $_SESSION["width"]; // Output: 10 echo $_SESSION["height"]; // Output: 15 ?> Quote Link to comment https://forums.phpfreaks.com/topic/56841-passing/#findComment-280851 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.