WordPress.org

Ready to get started?Download WordPress

Forums

How to post articles from external files by Post method ? (4 posts)

  1. monaural
    Member
    Posted 8 years ago #

    How can I post articles to wp-admin/post.php from an external html(or php or whateverelse) file BY "POST" METHOD ?

    You know, WP has the bookmarklet ("Press it-") to post the excerpts of other web pages.
    So it's easy to understand how to insert the texts by "GET" method,
    but naturally, this method has the limitation of URI size.

    I want to post articles by POST method, more precisely, by the way without limit of URI size. Any good idea ??

    Thanks.

  2. maerk
    Member
    Posted 8 years ago #

    You'd have to create your own form, since forms are the only way to send data by POST. But you need to be logged into wordpress anyway for posting to work.

  3. monaural
    Member
    Posted 8 years ago #

    Thanks, maerk.
    In fact, I've already made the form.
    According the bookmarklet, there are three vars are included as queries:

    • text
    • popupurl
    • popuptitle

    So, this code works perfect:

    ----------------------------------

    <form action="**/wp-post/post.php" method="GET" />
      <input type="text" name="text" value="ABC" />
      <input type="text" name="popupurl" value="DEF" />
      <input type="text" name="popuptitle" value="GHI" />
      <input type="submit" name="send" />
    </form>

    ----------------------------------

    But once I change the method to "POST", it doesn't work at all,
    no title and no text are inserted into the textarea of "post.php" file.

    Briefly,

    • Firstly, I want to post articles by "POST" method.
    • Basically, I don't want to use entirely new form, but wp's "post.php".
    • -->because the post.php has some wonderful features like "preview" etc..

    • Finally, I want to keep the text after passing the authentication of wp.

    Thanks in advance.

  4. maerk
    Member
    Posted 8 years ago #

    I'm not entirely sure what you're trying to do...

    Are you trying to write an entire post on your own form, then submit it to wordpress's post.php?

    If you're just trying to use the bookmarklet thing, I think that's only set up to work by GET, not POST.

Topic Closed

This topic has been closed to new replies.

About this Topic