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
SalesforceCYSalesforceCY 

web-to-lead thankyou page issue

Currently my development setup is as follows

 

User registers using the landing page. The landing page connects to salesforce to create a lead. Salesforce throws out a thankyou page using the URL I had supplied during the creation of web.

 

The issue is

The thank you page has a PHP script which sends out an email to the registered user. I am not able to access the fields from the landing page

 

eg: $email = $_POST[email]; // where email is a field in the landing page which I am trying to access in the thankyou page.

 

How do I go about resoving this issue?

 

Do I need to include the email field in the query string in thankyou page URL?

 

Is there a possiblity to access this field via salesforce?

 

Thanks !

werewolfwerewolf
Web To Lead does not necessarily create the lead immediately, and Salesforce.com does not spit back the field values at you.  If you need to redirect to a PHP page then you might be better served just submitting the whole page to that PHP page and having that PHP page insert the lead into Salesforce.com using the API, with the PHP Toolkit, rather than using Web To Lead.  Then you'll have complete access to all the information in your PHP.
CRYCRY

Thanks !

 

What API should I be using to enter all the information onto Salesforce to create a lead??

 

 

werewolfwerewolf
CRYCRY

Can you please send in an example. 

werewolfwerewolf
Read the page that my last post linked to.
sfdcfoxsfdcfox

If you want to use the web-to-lead functionality, you might also consider the (arguably) easier method of posting back and then submitting the lead from your script. Generally, it looks like this:

1) Check to see if you received a "POST".
2) If not, display the form.
3) If so, check to ensure all field values are valid.
4) If not, display the form with errors.
5) If valid, construct a HTTP Post request into a string.
6) Open a socket to www.salesforce.com.
7) Send the data through the socket.
8) Check response for "IsProcssed: True" (this lets you know you can close the socket safely)
9) Display thank you page.

I recently did this for a project in PHP, in fact, and it's actually pretty easy to accomplish.

You would want to use this method if: a) you don't have the API available, b) you don't want to try and install the library, c) you don't want to take the time to learn the library, or d) you don't want to necessarily wait for an API response (usually 2-3 times longer than simply posting to Web to Lead because of the processing overhead, especially if you're not caching login sessions).

You would use the API though, if you wanted to implement: a) Salesforce-controlled validation, b) guaranteed submissions to the server (technically, Web-to-Lead is guaranteed, but only if you have the correct oid parameter), c) other logic that might benefit from this method, such as offering specials that are loaded from the server based on some logic in Salesforce, or offering a chance to modify the data, etc.

CRYCRY

Could you please post in an example.

 

All I am looking for is to access form elements in the LandingPage_thankyou.php page from xxxx.html

 

Currently the setup in xxxx.html is

 

<FORM name="podiatry" id="form_id" action="https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8" onsubmit="return validate_form(this);" method="POST">  

<!--  <input type="hidden" name="oid" value="xxxx"> -->

<!--  <input type="hidden" name="debug" value="1"> -->

<input type="hidden" name="retURL" value="http://www.sihealthmanagement.com/landingpage/LandingPage_thankyou.php?"

 

Thanks!