Jump to content

how file_get_contents including custom javascript function?


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">
Save & Close
could i explain the problem clearly???:(


Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • 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.