Saving data to another page


I have a index.php page with a dropdown with id = dd. When the search button on the page is clicked on, an html page gets auto rendered in code (lets say new1.html). I would like to take the selected value from the dropdown from the index.php page and pre-populate the same dropdown on the new1.html page with id = dd when the page loads. Nothing I do works. :


Please help.

Thank you!

Hey @igitiit,
have you tried sending the data through a GET request? Meaning, you send the data you want by sticking it on the url.

Edit: misread your post and thought you meant for search itself, but same logic applies (only it’s probably even easier, as there are limited options with the dropdown).

Edit: do you mean new page, or do you mean HTML on the existing page? These are completely different things.

The url for the search results page should be built from the search string (ie with a parameter that is the search string):

I haven’t used PHP for a long time, so I can’t remember how it’s done, but it should be simple enough to put some logic in the results PHP file that checks that parameter and does whatever.