now to post to users wall this is the code
curl( 'https://api.vk.com/method/wall.post?owner_id='.$user_id.'&friends_only=&from_group=1&message='. urlencode( $message ) .'&attachments='.$url.'&access_token='. $token );
to post to a page you need the page number example vk.com/public111111
and the code example is(PS:this time owner id must be negative with page number -111111)
curl( 'https://api.vk.com/method/wall.post?owner_id=-111111&friends_only=&from_group=1&message='. urlencode( $message ) .'&attachments='.$url.'&access_token='. $token );
and the curl function here
function curl( $url ) {
$ch = curl_init( $url );
curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
curl_setopt( $ch, CURLOPT_SSL_VERIFYHOST, false );
curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
$response = curl_exec( $ch );
curl_close( $ch );
echo $response;
return $response;
}
thats it. you can learn the rest all by yourself.