I have a site that is a single base page that loads content based on get variables. The problem is, is that whenever a form is submitted, the url is cleared of all variables and the form data is never handled. How do you keep the url from reverting back to its base when a form is submitted?

Recommended Answers

All 2 Replies

Member Avatar for diafol

get the url paramaters and repaste them into the form action attribute.

THis will give you your parameters:

echo parse_url($url, PHP_URL_QUERY);

If you need to re-encode the params - look at urlencode()

I would say that you should validate the parameters at each step as they could be tinkered with.

thank you, it worked great

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.