How to pass a variable value to a php page? -
how can pass value of variable $login page try.php ? wish use code:
<a href="try.php">vote</a> ?
there 2 main ways pass data via url. can create <form>
post data next page. alternatively can pass data directly in url, called method.
the post method means data passed without user being able see it. data sent in http headers next page. common , recommended way pass form data across.
the method passes data in url so: http://www.somesite.com/page.php?var1=stuff&var2=morestuff
means can craft url pass data via yourself. need urlencode() data before put url won't contain invalid characters cause url invalid.
just throrough can use session pass data between pages. in order must first establish session using session_start(). method more useful keeping data persistent across page loads passing user input new page. you'll still need use post or pass information a user types first page second page process , can store in $_session variable keep make persist across of next page loads without having keep passing via or post.
Comments
Post a Comment