Lets say i have an html control of the form
<input name='options' value='one' title='ABC'>
<input name='options' value='two' title='XYZ'>
The user selects one of the options. How can i store the selected option in a variable on the same page without using the $_POST. This form posts onto another page.
PHP only works by the browser sending a request (as GET or POST) to the server and the server then executing the program (“page”), sending back the HTML (or whatever produced) to interpretation by the browser.
This means, a PHP page can only access “HTML variables” which got sent to it (from a form or a link), not anything the user enters on the produced HTML page without sending.
You may want to use client-side scripting (i.e. JavaScript) to do that, or think about your “page model” (i.e. which page does what).
PS: Your
<input>element should have atypeattribute, too.