Use binding after submitting a POST form

I need the page to load with a specific label on the page after the user clicks the Mail button.

Note: I am using PHP

Example form code:

<form action="po.php?id=44" method="POST"> <input type="hidden" name="here" value="#here" /> <input name="btn_send" type="submit" value="Post" /> </form> 

The page should land somewhere on the page with one heading between

as below

Code example:

 <a name="here"></a> <p>Total Number of Posts 55</p> 

As you can see, the place where I am the earth is just the text of the label, not a hyperlink. Therefore, I put the anchor as an indicator immediately before the heading.

Problem:

The page does not fit where I put it (name = "here"). The page is landing up. Is there an easy way to make it land (name = "here")?

+7
source share
3 answers

Just include the snippet in your action attribute, e.g.

 <form method="post" action="po.php?id=44#here"> 

In addition, using ID attributes as the location of fragments is much nicer. Lose the empty anchor and change your paragraph to ...

 <p id="here">Total number of Posts 55</p> 
+10
source

Try the following:

 <form action="po.php?id=44#here" method="POST"> <input name="btn_send" type="submit" value="Post" /> </form> 

And put this on the landing page:

 <a id="here"></a> <p>Total Number of Posts 55</p> 
+3
source
 header("Location: url#fragment"); 
+1
source

All Articles