I have a PHP page already written specifically for users to be directed to (sort of like a referrer link, and carries querystring values) from external sites. This page is not intended to have any theming or Drupal content, and only is supposed to show a a single block of text in the middle-center of page with the words PROCESSING...
. The intended workflow here is as follows:
- User clicks on a link from an affiliate-type site that links to something along the lines of
www.example.com?reciprocate.php?a=x&b=y&c=z
in my Drupal website. reciprocate.php
then checks if the user is currently logged in, and if not, presents the user with the Drupal login form, and preserves the querystring values in a post variable, and posts back to itself.- If the user is logged in, then the page will fetch some data from an external source, process it along with the original querystring values.
- Depending on the results of the processing, the user will then be redirected to an appropriate URL (for authenticated users only) within the site.
I can't seem to find any way to do this with either Drupal core or contrib modules, and I know I should be creating a custom module to do this, but I honestly haven't got around to learning how to do that, but believe me I will soon! Therefore hopefully you will understand the approach I took...I know it's not great, but I'm trying to work with what little I know.
I've already created my page at the root of my site, with all of my processing code, but I just can't seem to access any Drupal globals using the following as a test:
<?php
include("includes\bootstrap.inc");
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);
global $user;
if ($user->uid) {
// do custom processing here
} else {
print drupal_get_form('user_login_block');
}
?>
Please see if there is any way you can assist me, as I am really desperate. This may seem like a simple isolated block of code, but my site really relies on it. I thank you most humbly in advance!
display_errors
, and when I reloaded my page again, it spat back a long error message, starting withNotice: Use of undefined constant DRUPAL_ROOT...
drupal_render(drupal_get_form('user_login_block'));
for D7