Jenling Posted March 13, 2008 Share Posted March 13, 2008 Hello to all expert!I want to ask how to pass my variable to the next page by a link?How it works?Can someone help me? For example, I want to pass the value of id, day, month, year and start_time, end_time to another page, what can I do with this??? ??? Quote Link to comment Share on other sites More sharing options...
php_dave Posted March 13, 2008 Share Posted March 13, 2008 Hi, The easiest way as terms of execution is passing it directly in the url of the page you are calling for example www.yourdomain.com/mypage.php?id=1&day=01&month=02&year=08 In mypage.php you can access the vars using the $_GET superglobal for example: if (isset($_GET['id')) { $id = $_GET['id'] $date = $_GET['date'] //etc... } There is a security draw back in passing vars via the url but if you google $_GET and security there are some good tuts on how to sanitise your passed data! HTH Dave Quote Link to comment Share on other sites More sharing options...
Jenling Posted March 13, 2008 Author Share Posted March 13, 2008 Hello, thanks for your reply. How if the id I want to pass is depend on the user key in?how can i pass the value then? ??? Quote Link to comment 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.