<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel>
        <title>How to set &amp;quot;redirect&amp;quot; value</title>
        <description> Hey there,

I just came accross PHORUM a few days ago, and I must say I&amp;#039;m rather impressed. It is the perfect tool for my current project!

Similar to this post [www.phorum.org] I am integrating the forum with a web site, but I have a different take as I thought it would actually be easier to use the PHORUM login sequence anyways since I wouldn&amp;#039;t have to worry about setting the session cookie for Phorum (by letting Phorum take care of that).

So my take was to simpy change the redirect which is embeded in the login form.
Now, I realized I can&amp;#039;t embed PHP into the template, as it doesn&amp;#039;t seem to get parsed. 
I guess what I am trying to find out is how to change/set the value of the redir field in the login template. 


&amp;lt;input type=&amp;quot;hidden&amp;quot; name=&amp;quot;redir&amp;quot; value=&amp;quot;{LOGIN-&amp;gt;redir}&amp;quot; /&amp;gt;

Again, first I thought to simply add PHP code to the template, something like

value=&amp;quot;&amp;lt;?php if(isset($_GET[&amp;#039;myownredirect&amp;#039;])
             {
               if ($_GET[&amp;#039;myownredirect&amp;#039;]==&amp;#039;foo&amp;#039;)
                  echo &amp;quot;my/url/path&amp;quot;;
             } else
             {
               echo &amp;#039;{LOGIN-&amp;gt;redir}&amp;#039;
             } ?&amp;gt;&amp;quot; /&amp;gt;

But that didn&amp;#039;t seem to work. Is there any other way which would work better? When I &amp;quot;hardcode&amp;quot; my URL, it works like a dream, but that of course is impractical.

Where is {LOGIN-&amp;gt;redir} being defined?
I thought once I know where, I could then try to figure out how to set it when called from a page from my web site (= outside of Phorum)

Any help is greatly appreaciated.

Anurag

PS: I don&amp;#039;t think it is relevant information, but I am running PHP 5.1.2</description>
        <link>https://www.phorum.org/support/read.php?28,115541,115541#msg-115541</link>
        <lastBuildDate>Tue, 13 Oct 2026 05:55:39 -0500</lastBuildDate>
        <generator>Phorum 6.0.4</generator>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,120289#msg-120289</guid>
            <title>Re: How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,120289#msg-120289</link>
            <description><![CDATA[ Hi Maurice,<br />
<br />
thanks for that good answer. Explains a lot to me. <br />
I actually have 4.4.1 with register globals on yes. However this is a shared server of a big company and I&#039;m not sure if they will change this just for me. <br />
<br />
Right now I&#039;m happy with the result. It works and that&#039;s the solution to my problem right now. However I&#039;ll keep your post in mind and see if I&#039;ll be able to fix this whenever I get to this and may be when the site is more popular. <br />
<br />
I don&#039;t get any warnings on this one? However I think the warnings ar still turned on I get a lot of them on other occassions when I&#039;m scripting something. <br />
<br />
Thanks for all your help]]></description>
            <dc:creator>DonTino</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 14 Feb 2007 02:54:24 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,120284#msg-120284</guid>
            <title>Re: How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,120284#msg-120284</link>
            <description><![CDATA[ If the code &quot;$myownredirect==&#039;foo&#039;&quot; works for you, then you probably are running PHP with register_globals enabled. Beware that doing so is a security risk, since software might easily introduce security holes in this type of setup. The PHP people also advice against this. Unless you really need register_globals for some software on your server, you&#039;d better disable that feature in PHP.<br />
<br />
The way to access GET parameters is nowadays through the global $_GET array. If you post a get parameter &quot;myownredirect&quot;, then it is available as $_GET[&quot;myownredirect&quot;]. The isset() check is done to prevent warning about undefined indexes if you directly try to access $_GET[&quot;myownredirect&quot;] (because the index &quot;myownredirect&quot; might not exist in the $_GET array). I guess that on your system PHP warnings are also suppressed in the PHP config, else the &quot;$myownredirect==&#039;foo&#039;&quot; would also throw a warning in case the parameter wasn&#039;t posted I think.<br />
<br />
If this does the job for you and you&#039;re happy with the setup, then great. For others I&#039;d like to recommend the code which uses the $_GET array instead.<br />
<br />
BTW: It sounds like $_GET isn&#039;t availble at all on your system DonTino. What version of PHP are you running anyway?]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Tue, 13 Feb 2007 16:17:32 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,120281#msg-120281</guid>
            <title>Re: How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,120281#msg-120281</link>
            <description><![CDATA[ Maurice thanks a lot that did the trick for me except I removed the if(isset($_GET and if($_GET <br />
<br />
honestly don&#039;t even knnow what theyare there for. The page I&#039;m using the people come from a simple link and not a form not sure if I needed it, it didn&#039;t work anyway so I removed it. <br />
<br />
mine looks like:<br />
<br />
<pre class="bbcode">
&lt;input type=&quot;hidden&quot; name=&quot;redir&quot; value=&quot;&lt;?php 
             
               if ($myownredirect==&#039;foo&#039;)
             {
                  echo &quot;[<a href="http://this_is_a_test.com&quot" target="_blank"  rel="nofollow">this_is_a_test.com&quot</a>];;
             } else {
               echo $PHORUM[&quot;DATA&quot;][&quot;LOGIN&quot;][&quot;redir&quot;];
             } ?&gt;&quot; /&gt;</pre>
<br />
that works perfectly - link would be [<a href="http://yoursite.com/forum/login.php?myownredirect=foo" target="_blank"  rel="nofollow">yoursite.com</a>] <br />
<br />
thanks for all the help<br />
Tino]]></description>
            <dc:creator>DonTino</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Tue, 13 Feb 2007 10:27:56 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,120278#msg-120278</guid>
            <title>Re: How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,120278#msg-120278</link>
            <description><![CDATA[ Looking at the code above, it says:<br />
<pre class="bbcode">
  echo &#039;$PHORUM[&quot;DATA&quot;][&quot;LOGIN&quot;][&quot;redir&quot;]&#039;</pre>
This is exactly the code that you need for spitting out that variable&#039;s name instead of its contents. Loose the single quotes to make PHP print the contents of the variable.<br />
<br />
The correct syntax to use would be:<br />
<pre class="bbcode">
&lt;input type=&quot;hidden&quot; name=&quot;redir&quot; value=&quot;&lt;?php if(isset($_GET[&#039;myownredirect&#039;]))
             {
               if ($_GET[&#039;myownredirect&#039;]==&#039;foo&#039;)
                  echo &quot;[<a href="http://this_is_a_test.com&quot" target="_blank"  rel="nofollow">this_is_a_test.com&quot</a>];;
             } else {
               echo $PHORUM[&quot;DATA&quot;][&quot;LOGIN&quot;][&quot;redir&quot;];
             } ?&gt;&quot; /&gt;
</pre>]]></description>
            <dc:creator>Maurice Makaay</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Tue, 13 Feb 2007 08:47:06 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,120276#msg-120276</guid>
            <title>Re: How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,120276#msg-120276</link>
            <description><![CDATA[ I believe that you would need to write a little module that would set up the custom redirect.<br />
<br />
From the login program<br />
<br />
// By default, we redirect to the list page.<br />
<br />
// The hook &quot;after_login&quot; can be used by module writers to<br />
// set a custom redirect URL.<br />
$redir =phorum_hook( &quot;after_login&quot;, $redir );]]></description>
            <dc:creator>DavidVB</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Tue, 13 Feb 2007 08:33:31 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,120269#msg-120269</guid>
            <title>Re: How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,120269#msg-120269</link>
            <description><![CDATA[ I have the same problem,<br />
It worked for me to redirect to &#039;myownredirect=foo&#039; but the $PHORUM[&quot;DATA&quot;][&quot;LOGIN&quot;][&quot;redir&quot;] doesn&#039;t work it&#039;ll be jsut simply spit out as $PHORUM[&quot;DATA&quot;][&quot;LOGIN&quot;][&quot;redir&quot;] and not as url in the HTML code.<br />
<br />
Tino]]></description>
            <dc:creator>DonTino</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Tue, 13 Feb 2007 06:37:06 -0600</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,117561#msg-117561</guid>
            <title>Re: How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,117561#msg-117561</link>
            <description><![CDATA[ It sounds like I am trying to do exactly the same thing as above ... I basically have a non-forum page that I want users to be able to access, but before seeing it first they must log in (I was trying to conveniently use the forum loggin page and then redirect them).<br />
<br />
From what i gathered above it seemed like something like this might work:<br />
<br />
<pre class="bbcode">
&lt;input type=&quot;hidden&quot; name=&quot;redir&quot; value=&quot;&lt;?php if(isset($_GET[&#039;myownredirect&#039;]))
             {
               if ($_GET[&#039;myownredirect&#039;]==&#039;foo&#039;)
                  echo &quot;[<a href="http://this_is_a_test.com&quot" target="_blank"  rel="nofollow">this_is_a_test.com&quot</a>];;
             } else
             {
               echo &#039;$PHORUM[&quot;DATA&quot;][&quot;LOGIN&quot;][&quot;redir&quot;]&#039;
             } ?&gt;&quot; /&gt;</pre>
<br />
<br />
I am sending the GET string right: <pre class="bbcode">
[<a href="http://mydomain/bbs/login.php?myownredirect=foo" target="_blank"  rel="nofollow">mydomain</a>]</pre>
<br />
I have had absoluty no luck ... I can&#039;t even figure out how to hard code the  value to get it to redirect. It just goes straight to the page where I tried to log in from. Anyone who can offer me any advice/help it would be most greatly appricated!!]]></description>
            <dc:creator>nicklucking</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 18 Oct 2006 17:45:12 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,115568#msg-115568</guid>
            <title>Re: How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,115568#msg-115568</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>brianlmoon</strong><br />YOu can&#039;t echo {LOGING-&gt;redir}.  You will need to stay with PHP there.  $PHORUM[&quot;DATA&quot;][&quot;LOGIN&quot;][&quot;redir&quot;].</div></blockquote>
<br />
That worked perfectly!<br />
<br />
Thanks a lot,<br />
<br />
Anurag]]></description>
            <dc:creator>aji</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Thu, 17 Aug 2006 23:11:42 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,115560#msg-115560</guid>
            <title>Re: How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,115560#msg-115560</link>
            <description><![CDATA[ YOu can&#039;t echo {LOGING-&gt;redir}.  You will need to stay with PHP there.  $PHORUM[&quot;DATA&quot;][&quot;LOGIN&quot;][&quot;redir&quot;].]]></description>
            <dc:creator>Brian Moon</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Thu, 17 Aug 2006 17:23:43 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,115558#msg-115558</guid>
            <title>Re: How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,115558#msg-115558</link>
            <description><![CDATA[ Funny that it didn&#039;t work to add the php code in the login.tpl page.<br />
I&#039;ll try again...<br />
<br />
Was my method correct?<br />
<pre class="bbcode">
value=&quot;&lt;?php if(isset($_GET[&#039;myownredirect&#039;])
             {
               if ($_GET[&#039;myownredirect&#039;]==&#039;foo&#039;)
                  echo &quot;my/url/path&quot;;
             } else
             {
               echo &#039;{LOGIN-&gt;redir}&#039;;
             } ?&gt;&quot; /&gt;</pre>
<br />
Question:<br />
 <br />
<blockquote class="bbcode"><div><small>Quote<br /></small><strong></strong><br />
redir will be set based on the page that sends the user to the login page. Its purpose is to send them back to where they were.</div></blockquote>
<br />
How does that work in detail? Bec, I could use same method in order to redirect back to my page...<br />
<br />
Aji]]></description>
            <dc:creator>aji</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Thu, 17 Aug 2006 14:38:47 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,115544#msg-115544</guid>
            <title>Re: How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,115544#msg-115544</link>
            <description><![CDATA[ <blockquote class="bbcode"><div><small>Quote<br /></small><strong>aji</strong><br />So my take was to simpy change the redirect which is embeded in the login form.  Now, I realized I can&#039;t embed PHP into the template, as it doesn&#039;t seem to get parsed.</div></blockquote>
<br />
Ah, but you can.  PHP is allowed fully in the templates.<br />
<br />
redir will be set based on the page that sends the user to the login page.  Its purpose is to send them back to where they were.]]></description>
            <dc:creator>Brian Moon</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 16 Aug 2006 23:31:40 -0500</pubDate>
        </item>
        <item>
            <guid>https://www.phorum.org/support/read.php?28,115541,115541#msg-115541</guid>
            <title>How to set &quot;redirect&quot; value</title>
            <link>https://www.phorum.org/support/read.php?28,115541,115541#msg-115541</link>
            <description><![CDATA[ Hey there,<br />
<br />
I just came accross PHORUM a few days ago, and I must say I&#039;m rather impressed. It is the perfect tool for my current project!<br />
<br />
Similar to this post [<a href="http://www.phorum.org/phorum5/read.php?28,114518" target="_blank" >www.phorum.org</a>] I am integrating the forum with a web site, but I have a different take as I thought it would actually be easier to use the PHORUM login sequence anyways since I wouldn&#039;t have to worry about setting the session cookie for Phorum (by letting Phorum take care of that).<br />
<br />
So my take was to simpy change the redirect which is embeded in the login form.<br />
Now, I realized I can&#039;t embed PHP into the template, as it doesn&#039;t seem to get parsed. <br />
I guess what I am trying to find out is how to change/set the value of the redir field in the login template. <br />
<br />
<pre class="bbcode">
&lt;input type=&quot;hidden&quot; name=&quot;redir&quot; value=&quot;{LOGIN-&gt;redir}&quot; /&gt;</pre>
<br />
Again, first I thought to simply add PHP code to the template, something like<br />
<pre class="bbcode">
value=&quot;&lt;?php if(isset($_GET[&#039;myownredirect&#039;])
             {
               if ($_GET[&#039;myownredirect&#039;]==&#039;foo&#039;)
                  echo &quot;my/url/path&quot;;
             } else
             {
               echo &#039;{LOGIN-&gt;redir}&#039;
             } ?&gt;&quot; /&gt;</pre>
<br />
But that didn&#039;t seem to work. Is there any other way which would work better? When I &quot;hardcode&quot; my URL, it works like a dream, but that of course is impractical.<br />
<br />
Where is {LOGIN-&gt;redir} being defined?<br />
I thought once I know where, I could then try to figure out how to set it when called from a page from my web site (= outside of Phorum)<br />
<br />
Any help is greatly appreaciated.<br />
<br />
Anurag<br />
<br />
PS: I don&#039;t think it is relevant information, but I am running PHP 5.1.2]]></description>
            <dc:creator>aji</dc:creator>
            <category>Phorum Integration</category>
            <pubDate>Wed, 16 Aug 2006 19:37:53 -0500</pubDate>
        </item>
    </channel>
</rss>
