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 710607
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:38:24+00:00 2026-05-14T04:38:24+00:00

I have installed WAMP and running PHP scripts on localhost. I have enabled cURL.

  • 0

I have installed WAMP and running PHP scripts on localhost. I have enabled cURL. Here is my code.

<?php 
function updateTwitter($status)
{ 
 // Twitter login information 
 $username = 'xxxxx'; 
 $password = 'xxxxx';
 // The url of the update function 
 $url = 'http://twitter.com/statuses/update.xml'; 
 // Arguments we are posting to Twitter 
 $postargs = 'status='.urlencode($status); 
 // Will store the response we get from Twitter 
 $responseInfo=array(); 
 // Initialize CURL 
 $ch = curl_init($url);
 // Tell CURL we are doing a POST 
 curl_setopt($ch, CURLOPT_PROXY,"localhost:80");
 curl_setopt ($ch, CURLOPT_POST, true); 
 // Give CURL the arguments in the POST 
 curl_setopt ($ch, CURLOPT_POSTFIELDS, $postargs);
 // Set the username and password in the CURL call 
 curl_setopt($ch, CURLOPT_USERPWD, $username.':'.$password); 
 // Set some cur flags (not too important) 
 curl_setopt($ch, CURLOPT_VERBOSE, 1); 
 curl_setopt($ch, CURLOPT_NOBODY, 0); 
 curl_setopt($ch, CURLOPT_HEADER, 0); 
 curl_setopt($ch, CURLOPT_FOLLOWLOCATION,1); 
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); 
 // execute the CURL call 
 $response = curl_exec($ch); 
 if($response === false)
{
    echo 'Curl error: ' . curl_error($ch);
}
else
{
    echo 'Operation completed without any errors<br/>';
}

 // Get information about the response 
 $responseInfo=curl_getinfo($ch); 
 // Close the CURL connection curl_close($ch);
 // Make sure we received a response from Twitter 
 if(intval($responseInfo['http_code'])==200){ 
  // Display the response from Twitter 
  echo $response; 
 }else{ 
  // Something went wrong 
  echo "Error: " . $responseInfo['http_code']; 
 } 
curl_close($ch);
 }

updateTwitter("Just finished a sweet tutorial on http://brandontreb.com");

?>

Here’s my output

Operation completed without any errors
Error: 404

Here’s what error 404 means

404 Not Found: The URI requested is invalid or the resource requested, such as a user, does not exists.

Please help.

  • 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-14T04:38:24+00:00Added an answer on May 14, 2026 at 4:38 am

    You need the format on the end of the twitter url, see the twitter api docs for more info:

    http://apiwiki.twitter.com/Twitter-API-Documentation

    The proxy is probably causing you issues as well, remove this line:

    curl_setopt($ch, CURLOPT_PROXY,"localhost:80");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 425k
  • Answers 425k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Store the data in some data structure, and use a… May 15, 2026 at 12:14 pm
  • Editorial Team
    Editorial Team added an answer You could consider storing the shared libraries in a central… May 15, 2026 at 12:14 pm
  • Editorial Team
    Editorial Team added an answer Well, first of all, this line: return Values.Single(g => g.date… May 15, 2026 at 12:14 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.