Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By drk429 on
Hi guys, Iam very new to drupal..
I have an issue using drupal_goto(). when Iam trying deleting a topic in a group it is leading to home page of site but should lead to that particular group from where I have deleted the topic...can I know what parameter should use there?
Its very urgent..thanks in advance.
Comments
drupal_goto() is outlined
drupal_goto() is outlined here: http://api.drupal.org/api/function/drupal_goto/6
Basically you provide a path to be redirected to.
URL: http://www.example.com/some/path/you/want
drupal_goto('some/path/you/want') will redirect you to the URL above.
Use Drupal get destination
Use Drupal get destination
Can you...
I am real new too. Can you give an example of how to retrieve from the url like a $_GET? I am lost - it looks like it is encoded when it goes to the next page... Thanks
If your url is
If your url is like
http://example.com/somepage?param1=val1¶m2=val2
then u can take values of param1 and param2 as
$param1 = $_GET['param1'];
$param2 = $_GET['param2'];
you may use this parameter for drupal_goto as
drupal_goto("path_here", array("html" => true, "query" => "param1=$param1¶m2=$param2"));
@Rajan Not quite correct.
@Rajan
Not quite correct. This is the way to pass $_GET parameters. I'll repeat your example, with a small correction in the last line:
If your url is like
http://example.com/somepage?param1=val1¶m2=val2
then u can take values of param1 and param2 as
$param1 = $_GET['param1'];
$param2 = $_GET['param2'];
you may use this parameter for drupal_goto as
drupal_goto("path_here", array("param1" => $param1, "param2" => $param2));
It is not correct too)).If
It is not correct too)).
If your url is like
http://example.com/somepage?PARAM=VALUE
Drupal goto
drupal_goto("path_here");
Example :: drupal_goto("http://www.google.com");
drupal_goto() function use
You can use this code in your module file and redirect the fetch result location.
And some easy way of redirect the location.
drupal_goto("https://drupal.org/");
Thanks.