Firefox PHP

altering post redirect behaviour?

Posted by sarah 
altering post redirect behaviour?
August 16, 2005 07:15AM
hiya guys

i have a script called "details.php" (into which i copied a bunch of phorum code from read.php) that displays a specific thread relevant to the detail item. users can make posts in that item's thread, direct to the details.php page.

my question, is there a way to make phorum go back to the "details.php" script after the post succeeds?

thanks!

s.



Edited 1 time(s). Last edit at 08/16/2005 01:25PM by sarah.
Re: altering post redirect behaviour?
August 16, 2005 08:46PM
You can hack the code in post.php to do it.

Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: altering post redirect behaviour?
August 17, 2005 02:12AM
hey brian

thanks for the reply.

i only wish post.php to return to "anotherscript.php" when the post was made from "anotherscript.php". all other phorum functionality needs to remain the same.

do you maybe have a quick tip on where i should be looking within post.php to make this work?

thanks! :)

s.
Re: altering post redirect behaviour?
August 17, 2005 08:09PM
look in post.php around the lines that have the function phorum_redirect_by_url. It will be way down in the code, after the message is posted.

Brian - Cowboy Ninja Coder - Personal Blog - Twitter
Re: altering post redirect behaviour?
August 18, 2005 03:20AM
in case anyone's interested, here's what i did to take the user back to the detail.php page they posted their comment from:

-- replace
$redir_url = phorum_get_url(PHORUM_LIST_URL);
-- with
$pos = strrpos($HTTP_REFERER, "[misc url to redirect back to]");
  if ($pos === false) {
    $redir_url = phorum_get_url(PHORUM_LIST_URL);
  } else {
    $redir_url = $HTTP_REFERER;
  }
thanks to brian for the help!

s.
Sorry, only registered users may post in this forum.

Click here to login