Question

I have a problem in my php form : isbn number is a GET variable . Thus view.php opens in a URL like : localhost/../view.php?isbn=0810982463. Whereas I want the url structure to be like localhost/..../0810982463. I know it can be done by using the Post method, Can it be done using the GET method ?

<form action="view.php" method="get">

  <p class="name">
            <label for="isbn">ISBN No. &nbsp;</label>
    <input type="text" name="isbn" id="isbn" value="0199555311">
        </p>
        <p class="submit">
          <input type="submit" value="Search Book" />
        </p>
</form>
Was it helpful?

Solution

No matter what, the GET form submission will be in a query string format, just look at Google's form submission, or even Stack Overflow's own searching. This is the way things have been standardized across browsers.

If you want it to look pretty, after the submission, you'll need to redirect the user to a pretty URL.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top