I have a somewhat odd request and, while I hate asking vague questions, I just don't know where to start with this one.

I am developing a website (Drupal 6) for a user that also has a seperate website with some very particular server side apps that allow their staff to do data entry.

The request is that they would like to show a certain data entry form from within the new site. The data entry form can span several pages but once done shows a very definitive End of Form marker. I am thinking that to simply show the form can be done using iFrames, perhaps. But this requested level of integration of having the current site recognize the end of form marker puzzles me.

Any advice on how to:

  1. Show the data entry form from the other site.
  2. Have Drupal recognize the "End of Form" marker (just some text that says Done, basically) would be very much appreciated.

Googling things like "Drupal show another page" and such doesn't yield much.

  • 4
    Things that might help this question get better answers: explain what the "End of Form maker" is, and why it's problematic with an iFrame. Can you modify the existing form to redirect back to a Drupal after form is submitted? Can you re-produce the other form using Drupal Webform or a Content Type? Is it better to simply link to the old form? May 21 '12 at 17:39
  • Have you thought about putting a button (like a 'Continue') at the end of the form within the iframe that will redirect the user? I no that this won't programically let Drupal know that the user has finished but it might be a quick fix until you do.
    – Mike
    May 21 '12 at 17:42
  • @JohnathanElmore "End of Form Marker" is just as I said previously, some text on the page that just says "Done". Problematic with iFrame because javascript can't access it due to "same origin" policy (Google it if you've never heard of before). I cannot modify that form to redirect at all. I have no access to it and modifying it is not an option. Recreating their existing form and backend in the Drupal environment is not an option either. Simply linking to the old form isn't really what is wanted. Request is for a more seamless user experience. May 22 '12 at 14:26
  • If I were in your shoes, I would modify my settings.php to have multiple-databases, and write a small custom module that creates a similar multi-step form, and has a submit handler that writes the form results to the other database (of the old website). That way you don't really have to worry about javascript limitations across domains. Of course this depends on how complex the form is, and if it can be implemented using Form API
    – Beebee
    May 22 '12 at 15:27

You should be able to use this. Enable PHP code mode and paste it into a page:

  $curl_handle = curl_init();
  $html = curl_exec($curl_handle);
  print $html;
  • That will indeed work but only for the most simple cases. I am trying to interface with, as I said, a nontrivial data entry application. May 22 '12 at 20:14
  • Well let us know how we can help ;) It's working well for me. May 22 '12 at 20:22
  • The main problem with a curl wrapper is that in this case the external app has a decent amount of JavaScript and curl, of course, acts like a simple browser without JS Enabled and there isn't any way around that that I know of. The external app detects the lack of JS and just returns a typical "You need JS enabled" error message. The module Wrapper I linked to in another post does handle js/css/etc pretty well though. Thanks for trying to help though! :) May 22 '12 at 20:37

This is a complex problem that doesn't have any one good solution. The best I have found is a module which is still under development called Wrapper. http://drupal.org/sandbox/dman/1140564 I recommend anyone with this problem start off with that module as it may do exactly what you want.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.