$user_id, 'poll_id' => $polls_id, 'vote_value' => '1' ) ); $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('http://whichis4me.herokuapp.com/api/v1/polls/'. $polls_id . '/castvote', false, $context); public function getButtons() { //$_SESSION['polls_id'] = $this->polls_id; //echo $_SESSION['polls_id']; echo $this->polls_id; echo ''; echo '
"; echo ""; } }