<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0'>
	<channel>
		<title>cotonti.com : use the url from last visited page</title>
		<link>https://www.cotonti.com</link>
		<description>Laatste forum onderwerpen</description>
		<generator>Cotonti</generator>
		<language>en</language>
		<pubDate>Sat, 18 Apr 2026 05:13:43 -0000</pubDate>

		<item>
			<title>ruben</title>
			<description><![CDATA[<p>
	works! thanks!</p>
]]></description>
			<pubDate>Zo, 13 Jan 2013 12:21:43 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=7302&d=0#post36788]]></link>
		</item>
		<item>
			<title>Trustmaster</title>
			<description><![CDATA[<p>
	Should be as easy as this:</p>
<pre class="brush:php;">
$cfgsubj = "&lt;input type=\"hidden\" maxlength=\"100\" size=\"24\" value=\"".$_SESSION['visited_pages'][count($_SESSION['visited_pages'])-1]."\" name=\"subject\" id=\"subject\" class=\"text\" /&gt;";</pre>
<p>
	BTW, there's a bug with parenthesis in that $prev_page sequence, it should be</p>
<pre class="brush:php;">
$prev_page = $_SESSION['visited_pages'][count($_SESSION['visited_pages'])-1];</pre>
<p>
	 </p>
]]></description>
			<pubDate>Zo, 13 Jan 2013 07:52:38 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=7302&d=0#post36787]]></link>
		</item>
		<item>
			<title>ruben</title>
			<description><![CDATA[<p>
	i have a form (contactus plugin) where i want the url from the last visted page someone came from to be added in a hidden field<br />
	now someone suggested me to track the sessions on each page with<br /><br />
	 </p>
<pre class="brush:php;">
$_SESSION['visited_pages'][] = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI'].$_SERVER['QUERY_STRING'];</pre>
<p>
	and then get the last page with</p>
<pre class="brush:php;">
$prev_page = $_SESSION['visited_pages'][(count($_SESSION['visited_pages']-1)];</pre>
<p>
	due to my lack of knowledge of php i dont know how to use it in the form.....</p>
<pre class="brush:php;">
​if($cfg['plugin']['contactus']['subjects'] != ''){
    $cfgsubjects = explode(";", $cfg['plugin']['contactus']['subjects']);
    if (count($cfgsubjects) &gt; 1 &amp;&amp; !empty($cfgsubjects[1])){
        $cfgsubj = "&lt;select name=\"subject\"&gt;\n";
        $iii=0;
        foreach($cfgsubjects as $x) {
            if (!empty($x)) {
                $subjects[$iii] = trim($x);
                if ($iii==$subject || (empty($subject) &amp;&amp; $iii==0)) {
                    $cfgsubj .= "&lt;option value=\"".$iii."\" selected=\"selected\"&gt;".$subjects[$iii]."&lt;/option&gt;\n";
                } else {
                    $cfgsubj .= "&lt;option value=\"".$iii."\"&gt;".$subjects[$iii]."&lt;/option&gt;\n";
                }
                $iii++;
            }
        }
        $cfgsubj .= "&lt;/select&gt;\n";
    }else{
        $cfgsubj = '';
    }
}else{
    $cfgsubj = "&lt;input type=\"hidden\" maxlength=\"100\" size=\"24\" value=\"URL HERE\" name=\"subject\" id=\"subject\" class=\"text\" /&gt;";
}</pre>
<p>
	 </p>
<p>
	or if someone has a better solution to do this?</p>
]]></description>
			<pubDate>Thu, 10 Jan 2013 18:25:46 -0000</pubDate>
			<link><![CDATA[https://www.cotonti.com/nl/forums?m=posts&q=7302&d=0#post36769]]></link>
		</item>
	</channel>
</rss>