Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6572069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T14:57:37+00:00 2026-05-25T14:57:37+00:00

I am trying to do a simple post to facebook, I got same sample

  • 0

I am trying to do a simple post to facebook, I got same sample to do a postcode and I changed it a little.

I get the following error

Parse error: syntax error, unexpected ‘;’ in /home/consult/public_html/projects/facebook/index.php on line 13

the line is

'access_token'=>;urlencode($code),

the code:

<?php
//set POST variables
$url = 'https://graph.facebook.com/arjun/feed';
$code="testing";
$message="Test";
$fields = array(
    'access_token'=>;urlencode($code),
    'message'=>;urlencode($message),
                );

//url-ify the data for the POST
foreach($fields as $key=&gt;$value) { $fields_string .= $key.'='.$value.'&amp;'; }
rtrim($fields_string,'&amp;');

//open connection
$ch = curl_init();

//set the url, number of POST vars, POST data
curl_setopt($ch,CURLOPT_URL,$url);
curl_setopt($ch,CURLOPT_POST,count($fields));
curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);

//execute post
// $result = curl_exec($ch);

//close connection
curl_close($ch);


?>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T14:57:37+00:00Added an answer on May 25, 2026 at 2:57 pm

    it should be

      'access_token'=>urlencode($code),
    

    not

     'access_token'=>;urlencode($code),
    

    also,

    'message'=>;urlencode($message),
    

    should be

    'message'=>urlencode($message),
    

    also,

    key=&gt;
    

    should be

    key=>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I got the sample code from Facebook to post a message. At first it
I am trying to submit a simple POST form to a website to get
I'm trying to make a simple HTTP post a endpoint with ONLY url arguments.
I'm trying to create a simple spring based webservice that supports a post with
I am trying to get simple jQuery to execute on my Content page with
I'm trying to make a simple HTTP POST request, and I have no idea
I'm a newbie trying to do a simple HTTP post in JS within a
I am trying to do a simple post using libcURL. I noticed that if
I'm trying to build simple facebook application with 4.2.1 C# SDK. But I have
I'm trying to send a simple POST request to a REST web service and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.