0

I'm running the Storm (project management) module and for each task, the user needs to fill out a form regarding information about the task, including uploading images about certain information captured in the form. I'm trying to pass the url alias from the task page to the default value of a field I created in webform. My current URL's look like this: ?q=content/82245940-initial-services . My problem (well, at least my first problem) is that I use the %get[q] but get node/5 as the default value. I don't understand and know enough about PHP programming yet, to know how to fix this so that I get 82245940-initial-services as the default value instead. Any help is much appreciated for the noobie. Thanks in advance!

EDIT By the way I have read these posts that while I have found helpful to understand the general concept, the details are over my head:

http://drupal.org/node/296453#webform-url-default

http://drupal.org/node/228622

So, I've tried, I just don't know enough yet!

1 Answer 1

1

You can get the URI with $_SERVER["REQUEST_URI"] and remove the "q=content/" string from it.

2
  • Thank you. Do you know of a way to remove the "q=content/" string from it? Is there a resource that you know of that I could read up on?
    – Michael
    Commented Oct 20, 2011 at 2:20
  • str_replace("q=content/", "", $_SERVER["REQUEST_URI"]) should do the trick
    – uwe
    Commented Oct 20, 2011 at 5:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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