Correct me if I'm wrong but SOAP is installed because it connects to sandbox right?
Also, i'm not sure what you want me to print_r?
Here's the code:
PHP Code:
<form enctype="multipart/form-data" method="POST">
Please choose a file: <input name="uploaded" type="file" /><br />
<input type="submit" value="Upload" />
</form>
<?php
$target="uploads/";
$target=$target.basename($_FILES['uploaded']['name']);
if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target))
{
$fp=fopen($target,'r');
$k=0;
require_once ('soapclient/SforcePartnerClient.php');
$mySforceConnection = new SforcePartnerClient();
$mySoapClient = $mySforceConnection->createConnection("partner.wsdl.xml");
$mylogin = $mySforceConnection->login("user@domain.com", "password");
while(!feof($fp))
{
$line=fgets($fp);
if($line==''){continue;}
$line = explode("\t",str_replace('&', '&', $line));
$id[$k]['id']=$line[0];
$id[$k]['name']=str_replace('"','',$line[1]);
$k++;
}
foreach($id as $creditorid) {
$query="SELECT Creditor_Id__c from Creditor__c where Creditor_Id__c='".$creditorid['id']."'";
$queryResult = $mySforceConnection->query($query);
$records= $queryResult->records;
if(count($records)<1){
$fieldsToInsert = array('Name'=>$creditorid['name'],'Creditor_Id__c'=>$creditorid['id']);
print_r($fieldsToInsert);
echo "<br />";
$sObject = new SObject();
$sObject->fields = $fieldsToInsert;
$sObject->type = 'Creditor__c';
$lead = $mySforceConnection->create(array ($sObject),'Creditor__c');
}else{echo "Skipped<br />";continue;}
}}
The error is :
PHP Fatal error: Uncaught SoapFault exception: [ns1:INVALID_LOGIN] INVALID_LOGIN: Invalid username or password or locked out. in /var/www/html/sf/soapclient/SforceBaseClient.php:113\nStack trace:\n#0 [internal function]: SoapClient->__call('login', Array)\n#1 /var/www/html/sf/soapclient/SforceBaseClient.php(113): SoapClient->login(Array)\n#2 /var/www/html/sf/script.php(16): SforceBaseClient->login(user@domain.com', 'password')\n#3 {main}\n thrown in /var/www/html/sf/soapclient/SforceBaseClient.php on line 113, referer: