Hi!
If I would like to use this module as a "give us your feedback", is there a way to know from which page people have actually submitted the form?
Thanks!!
Rosamunda

Comments

mrvee’s picture

I would like to know too. This module would work perfect if I could track from which node the form was submitted.

nedjo’s picture

I can see where this would be useful. But the question would be where to put this functionality? Save the information along with the form submission? If so, save it where?

At any time, you can determine the current location in PHP with:


$location = $_GET['q'];

But I don't think adding this to forms and handling saving would fit well in formblock. It could be done as a separate module I guess.

Rosamunda’s picture

Thanks for your reply, and for the code!
hmmm maybe it could be added it somewhere without much coding...

mikey_p’s picture

I'm not sure if there is a good way to add this option to the module. Perhaps you could try a combination of the Computer Field module (http://drupal.org/project/computed_field) and CCK field permissions to get a field set with custom PHP and hide it from the user. I'm not sure if that will work, but it may be worth looking into.

tauno’s picture

Using a Computed Field seems like a good solution. Here is my code to get the node type and page title from the node the form was submitted from:

if (arg(0) == 'node' && is_numeric(arg(1)) && (!arg(2))) {
  $nid = arg(1);
  $src_node = node_load(array('nid' => $nid));
  $title = $src_node->type ." - ". $src_node->title;
} else {
  $title = "Unknown";
}

$node_field[0]['value'] = $title;

You can modify the code to get any field from the source node you want. Don't mess with $node in your computed field, it breaks the submission form.

mikey_p’s picture

Issue summary: View changes
Status: Active » Closed (outdated)