Title: current url?
Last modified: August 19, 2016

---

# current url?

 *  [tehjrow](https://wordpress.org/support/users/tehjrow/)
 * (@tehjrow)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/current-url/)
 * I’m trying to build a <form>. The action= needs to come back to the same page.
   I’ve tried this:
 * $this_post_id = $wp_query->post->ID;
    $form = “<form method=’get’ action=’page_id
   =”; $form .= $this_post_id; $form .= “‘>”;
 * But it leaves the ? mark out and won’t go to the page. Example:
    Need this: [http://www.example.com/?page_id=46](http://www.example.com/?page_id=46)
   Get this: [http://www.example.com/page_id=46](http://www.example.com/page_id=46)
 * Any ideas?

Viewing 1 replies (of 1 total)

 *  [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * (@stvwlf)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/current-url/#post-1809266)
 * It often comes back to the same page if you just leave the action field blank.
   action=””

Viewing 1 replies (of 1 total)

The topic ‘current url?’ is closed to new replies.

 * 1 reply
 * 2 participants
 * Last reply from: [stvwlf](https://wordpress.org/support/users/stvwlf/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/current-url/#post-1809266)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
