wordpress button not working while link works

I apologize for the simplicity of the question, I am definitely still a beginner.

For some reason the following link works:

Read More
<a id="header-log-in" href="<?php echo get_permalink( 39 ); ?>">Log In</a>

However, the following button does not work:

<form action="<?php echo the_permalink( 39 ); ?>">
        <input type="submit" id="header-create-acct" value="Sign Up" />
</form>

All help is appreciated, thanks in advance.

Related posts

Leave a Reply

3 comments

  1. try this .

    <form method='post' action="<?php echo get_page_link(39); ?>">
            <input type="submit" id="header-create-acct" value="Sign Up" />
    </form>
    
  2. You are using the_permalink() in the second, which must be use within The Loop – it does not take a post ID as an argument. If you want to return the value of the link, you should use get_permalink( $post_id ) as in the first example – which does take a $post_id argument – and then echo the result so that it prints out within the action attribute of your form.

    <form action="<?php echo get_permalink( 39 ); ?>">
            <input type="submit" id="header-create-acct" value="Sign Up" />
    </form>