<?php
define("SOAP_CLIENT_BASEDIR", "../../soapclient");
require_once (SOAP_CLIENT_BASEDIR.'/SforcePartnerClient.php');
require_once ('../userAuth.php');

try {
  $mySforceConnection = new SforcePartnerClient();
  $mySoapClient = $mySforceConnection->createConnection(SOAP_CLIENT_BASEDIR.'/partner.wsdl.xml');
  $callOptionsHeader = new CallOptions($YOURCLIENTID, $NAMESPACE);
  $mySforceConnection->setCallOptions($callOptionsHeader);
  $loginResult = $mySforceConnection->login($USERNAME, $PASSWORD);

  print_r($loginResult);
} catch (Exception $e) {
  echo $e->faultstring;
}
?>