Posting on a wordpress blog using PHP

Discussion in 'PHP' started by jiosis, Feb 15, 2008.

  1. #1
    For one of my projects I'm trying to write an external php program that needs to post on a wordpress blog after processing some data.
    Both php code and wordpress blog are hosted on the same domain and both can have access to the same database.

    I know that I can write the php code from scratch to write the post directly to wordpress's mysql database but I was wondering if there is such a code already or someone has any better idea to do it (i.e. using wordpress includes and internal functions maybe) ?

    Thanks in advance
     
    jiosis, Feb 15, 2008 IP
  2. fairuz.ismail

    fairuz.ismail Peon

    Messages:
    232
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #2
    maybe you can use the email to post function in wordpress..to use php to email to a specific email, then wordpress will automatically add a new post depend on the email content.
     
    fairuz.ismail, Feb 16, 2008 IP
  3. jiosis

    jiosis Well-Known Member

    Messages:
    892
    Likes Received:
    12
    Best Answers:
    0
    Trophy Points:
    110
    #3
    Thanks, that's a great and easy solution but is there any way to specify different category for each post ?
     
    jiosis, Feb 16, 2008 IP
  4. bingu

    bingu Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    maybe you can use the XMLRPC...
     
    bingu, Feb 17, 2008 IP
  5. fairuz.ismail

    fairuz.ismail Peon

    Messages:
    232
    Likes Received:
    10
    Best Answers:
    0
    Trophy Points:
    0
    #5
    can u explain more about this..i want to know too..
     
    fairuz.ismail, Feb 17, 2008 IP
  6. bingu

    bingu Peon

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
  7. Ares

    Ares Member

    Messages:
    47
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    45
    #7
    if you wanna use the wp api's you can try wp_insert_post() which needs to include some wp files !
    or if you want to add data without wp api's you have to insert to mysql database directly (with php).

    codex.wordpress.org/Function_Reference/wp_insert_post
     
    Ares, Feb 17, 2008 IP