+ Start a Discussion
SlickRickySlickRicky 

Dumbest Question of the Day

Okay, I know this is going to be a dumb question, and I know it's going to irritate some people that I'm even asking, because I'm sure the answer exists somewhere.   However, I can't find it easily and so I'm asking for help.
 
I just want a simple explanation of how to get a php page on my server to connect my salesforce.com account and display any piece of data from that account.  I will probably use the Partner WSDL but other than knowing where to find that xml file to download, I am lost.  I don't know how to use that xml file or even where to put it for use, much less make a connection through it.
 
Any help would be appreciated.
msimondsmsimonds
Are you just looking for an example that will connect to salesforce and list the accounts under your userid?

If so there is a script in the PHP toolkit that already has this working or are you looking for something else

and no one will get on you man, we all started the same way, Shoot I am still learning

Best

Mike
SlickRickySlickRicky
Now when you say "PHP toolkit", I'm wondering what that refers to.  From what I've found it seems like something I need to download and install on the server, not something with coding examples.
 
I am on a dedicated managed hosting server, and installs are done through SSH or by the hosting provider, so I can probalby get the toolkit installed.  However starting from scratch, what should I do to make a connection to salesforce and run a query. (plus what should that query look like?)  I'll be happy with being able to access any data from my server.  Do I need to install this toolkit first?
Alex 2.0Alex 2.0
Ricky,

"installing the toolkit" just means copying the toolkit folder in a directory under your website root directory.

After setting the permissions right and changing the toolkit example files with your salesforce API account information you should just be able to type the path of the example files in your browser.

For example, if you put the salesforce toolkit files in your web root under a directory called sf, you can then go to
http://yourdomain.com/sf/samples/login.php

and be able to log in with your API credentials.

Hope this helps.

--Alex

IcarusMaximusIcarusMaximus
Post your PHP version. Depending on whether you have 4 or 5, there is different code you can use.

In PHP4, you will want to use NuSoap, and so you need some code that is customized for that. NuSoap is a script that you can upload to your server to allow you to communicate with SalesForce without having to do modifications to your server, which it doesn't sound like you have the technical expertise to do.

If you have PHP 5 running, then you can just use the toolkit code.

Post your PHP version, and then I will post more detailed instructions for you.

By the way, to get your php version, create a text file called phpinfo.php and upload it to your root html directory, then browse to it in your browser by going to: http://www.mysite.com/phpinfo.php

Here is the code you need to put in the phpinfo.php file:


<?php

phpinfo();

?>

If you want, you can post the contents of that file and I can provide more specific help. However, all I really need is the version number.

SlickRickySlickRicky
We just updated to the latest version about a month ago, so it's version 5.1.4

Thank you for any help you can give.
CarteBlancheCarteBlanche
Alex 2.0, when you say set the permissions, what permissions should I be setting exactly?  Also when you say "changing the toolkit example files with your salesforce API account information", which files should I be changing?

Thanks
CarteBlancheCarteBlanche
Please disregard the above post.  I got it working with some small changes to php.ini file

Thank you
shan876shan876

Hi:

  I am a newbie... What exactly did you do for the permissions in the php.ini file.. I uploaded it on my server for a test and I can not get the php tool kit to work...

http://www.bharatkishaan.com/sfdc/samples/login.php

I keep getting errors like

Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/bharatki/public_html/sfdc/samples/header.inc:9) in /home/bharatki/public_html/sfdc/samples/login.php on line 30

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/bharatki/public_html/sfdc/samples/header.inc:9) in /home/bharatki/public_html/sfdc/samples/login.php on line 30

So I have no idea whats wrong... Someone help...please