Jump to content

PHP and WORDPRESS


chupacabrot

Recommended Posts

Hello, Is there any way to -remotely- insert a post to a custom wordpress URL? Assuming I have a network of 5 websites and i would like to update all of them through some form i'll build (may say - a mini CMS maybe).

 

 

Site 1 -

[Form for content] [submit button]

 

 

Site 2 -

[Form2 for content] [[submit button]]

 

 

Site 3 -

[Form3 for content] [submit button]

 

... and so on.

 

And simply everytime i'll pust the submit button the Form3 content will go to a specific wordpress website, and same about Form2 and Form1. Thanks.

Link to comment
https://forums.phpfreaks.com/topic/285606-php-and-wordpress/
Share on other sites

Assume that $bandList is an array of strings , and i want to create a page with the whole list - 

 

function createWPpage($bandlist)
{
$link = mysql_connect("localhost","root","pass","wordpress");
if(!link) { die('Could not connect: ' . mysql_error());
}


$sql = 'INSERT INTO wp_posts '.
'(post_content,post_title,post_type) '.
'VALUES {'$bandlist','List of Bands','page'}';


  mysql_select_db('wordpress');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
   die('Could not enter data: ' . mysql_error());
}
echo "Entered data successfully\n";
mysql_close($conn);


} 

Well, I got wordpress installed on localhost but for some reason it wont show any error or warning while trying to execute this code (turned E_ALL on) but on the other hand - it doesn't make any changes to the actual database.. am I missing something?

Link to comment
https://forums.phpfreaks.com/topic/285606-php-and-wordpress/#findComment-1466311
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.