Thread:Project:Support desk/badtoken problem calling the API with action=edit/reply (4)

First of all I have to say that I´m still a starter in php and Mediawiki extensions...

After the User filled the html-form I basically do the following:

//Fetch the EditToken $token = urlencode($wgUser->getEditToken); //Create a stream $opts = array(   'http'=>array( 'method'=>"POST")   ); $context = stream_context_create($opts); //Make up the url $url = "http://myserver/mediawiki/api.php?action=edit&title=".$title."&text=".$text."&format=php&token=".$token; //Call the url $result = file_get_contents($url ,false, $context);

I dont know if this is the correct way to do it, but it works for anonymous users...