function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Rajesh SFDCRajesh SFDC 

php to salesforce connection

 

 

hi frds,  i can try to connect php tool kit to salesforce.com.. i am download xampp server and install on my computer, while i am run the php file on local host, i am getting error "The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again."

If you think this is a server error, please contact the webmaster. error 404 . i done no how to find out this error could u help me frds. wat are steps need to run the php to salesforce.com. send the link at rajeshk@tandture.com. send the steps to connect the php tool kit to salesforce.com

<?php
define("USERNAME", "rajeshk@tandture.com");
define("PASSWORD", "rajeshmuruga1987");
define("SECURITY_TOKEN", " 81OKR9wPABCca8JLpIS6g8V0");
require_once ('soapclient/SforceEnterpriseClient.php');
$mySforceConnection = new SforceEnterpriseClient();
 
$mySforceConnection->createConnection("enterprise.wsdl.xml");
 
$mySforceConnection->login(rajeshk@tandture.com, rajeshmuruga1987.81OKR9wPABCca8JLpIS6g8V0);
 
$query = "SELECT Id,Name from Contact";
 
$response = $mySforceConnection->query($query);
 
echo "Results of query '$query'<br/><br/>\n";
 
foreach ($response->records as $record) 
 {
 
    echo $record->Id . ": " . $record->Name . " "
 
        }
 
 
?>
 
</body>
</html>dis s my code i was written on php 

 

Nickname_BravoNickname_Bravo

I used the partner client, just exchange 'SforcePartnerClient.php' it for the enterprise client file.

Try setting it up like this:

<?php

 

require_once ('../soap/soapclient/SforcePartnerClient.php');

    main();

function main(){

$mySforceConnection = new SforcePartnerClient();
    $mySoapClient = $mySforceConnection->createConnection("../soap/soapclient/partner.wsdl.xml");
    $mylogin = $mySforceConnection->login("Username", "PasswordToken");

$query = "Select Id, ....";

$response = $mySforceConnection->query($query);

}

//COde HERE


?>

 You can put this in a function as well and run it from the main function. let me know