Passing WebDirect parameters can be really tricky.

I had a previous more elegant solution that did not require any PHP files but there is a little issue I ran into. We all know you can no longer pass parameters into a WebDirect session ... or can you?

You actually can pass parameters that persist in the URL after WD loads but you MUST include them before the Hash '#" fragment identifier like this:
 
http://12.34.56.78/fmi/webd/?Param1=1234&Param2=4321#DatabaseName

Next trick, how do you read the URL. This is the tricky bit. In a web viewer JS can't read the URL directly as it just reports the source data. The work around I came up with was to get the "document.referrer" as the referrer of an iFrame web viewer in WD was the actual WD url. 

This is where I stopped due to time constraints.  You can read web viewers contents but since I used JS to echo out the referrer, and this its not part of the source or the contents because its dynamically generated. I've place a copy of the code I used on the GIT below as well as the final solution.


Final Solution

I settled for a final solution with a single php file. This technique was an adaptation of 
https://github.com/SoliantMike/FM-WebDirect_Params/tree/master/php ' s code with some changes.

Improvements have been made as follows:

  • All code in a single PHP file
  • Optional output format Let Notation or XML
  • Provision for no initial call (So your start up script can tell if it was called externally or not)

Let me know if you have any question of suggestions for improvement.

Download GIT:

https://github.com/DelfsEngineering/WebDirectParams/

3 Comments