The samples in the toolkit are flawed, they always give the Headers already sent error messages. I do knot know why Nick Tran has not corrected them!
Anway I tried your script and cannot login either, that maybe something that has to do with your php setup
Can you setup a phpinfo and let me take a look at it and link it here?
Maybe try this script:
PHP Code:
<?php
$user = 'masimonds@gmail.com';
$pass = 'mas4155';
/* this is the key that I generated from my development account
* which allows you to bipass the IP check in Salesforce
* go to salesforce > My personal Information > Reset my security Token*/
$pass_string = 'L07opnWnbTKrvJ3wcpFiWyTsl';
$pass = $pass.$pass_string;
require_once ('./includes/soapclient/SforcePartnerClient.php');
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection("./includes/partner.wsdl");
$mylogin = $mySforceConnection->login($user, $pass);
try
{
if ($mylogin)
{
echo "logged in <br />";
echo $mySforceConnection->getLastRequest()."<br />";
echo $mySforceConnection->getLastRequestHeaders()."<br />";
}
else
{
echo "crap, something is wrong";
}
}
catch (Exception $e)
{
echo $mySforceConnection->getLastRequest();
echo $mySforceConnection->getLastRequestHeaders();
echo '<pre>' . print_r($e,true) . '</pre>';
}
?>
make sure that you have SOAP and SSL enabled in you php setup
ALSO
make sure that you check the paths to the require_once
~Mike