From: Janez D. <doe...@ya...> - 2013-07-21 11:35:34
|
Hi guys, I'm new in php world. I'm trying to create new content in joomla 2.5 with your web browser. Problem is that it doesn't post new content but just redirect me to control panel. Here is my code: require_once('simpletest/browser.php'); $browser = new SimpleBrowser(); $browser->get('http://localhost/joomla25/administrator/index.php?user=admin&passw=admin&option=com_content&view=article&layout=edit'); // using autologin plugin $browser->setFieldByName("jform_title", "test title"); $browser->setFieldById("jform_articletext", "test body"); $page = $browser->click('Save'); $page = $browser->getContent(); echo $page; // it echo me control panel Any idea what's wrong? Any help would be appreciated. |