Jump to content

how file_get_contents including custom javascript function?


mtaydinbas

Recommended Posts

i want to manipulate a joomla component for my site.

component has no ability to do what i want.

i create a db row for component, for every new users.

but i coudn't resolve parent id column to insert the correct value.

i have to login to panel and open that category id, and just click "save and close" button for every new users.

it is a manuel solution.

but can i do it by running "file_get_contents". 

 

like this:

$url = "/index.php?option=com_joomgallery&controller=categories&task=edit&cid=59";

 

 

$postdata=http_build_query(array("usr" => "xxxx", "pass" => "xxx", "cid" => "59", "javascript" => ""Joomla.submitbutton('save')""));
 
$opts = array('http' => array('method'  => 'POST', 'header'  => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata));
 
$context  = stream_context_create($opts);
 
$result = file_get_contents($url, false, $context);

 

 

 

source code part:

 

 

<li class="button" id="toolbar-save">
<a href="#" onclick="Joomla.submitbutton('save')" class="toolbar">
<span class="icon-32-save">
</span>
Save & Close
</a>
</li>
 
could i explain the problem clearly???:(

categories.php

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.