- 1). Click "Start" > "All Programs" > "Accessories" and select "Notepad."
- 2). Select "File" > "Open" and navigate to a copy of your PHP HTML Web page saved on your PC.
- 3). Copy and paste the following piece of code after the <body> tag in your Web page:
/* PHP Update Settings */
$username = 'myuser';
$password = 'mypass';
$format = 'xml'; //alternative: json
$message = 'This is a Twitter update using PHP';
/* PHP Update Execution */
$result = shell_exec('curl http://twitter.com/statuses/update.'.$format.' -u '.$username.':'.$password.' -d status="'.str_replace('"','\"',$message).'"');
echo $result; - 4). Replace the "myuser" string of text with your Twitter user name and the "mypass" string of text with your Twitter password.
- 5). Save the PHP HTML file and upload it to your Web server. If you are unsure how to do this, consult your host's technical support page.
- 6). Visit your uploaded Web page on the Internet. When you visit the page, an update will automatically be sent to Twitter that says, "This is a Twitter update using PHP." That text can be altered by editing the "$message" line from Step 3.
SHARE