Hey,
I want to add the refering page URL in the form results. I had this working on my staging site but after migrating the settings to my live site it no longer works.
I am using this as a hidden field:
Here is the form code:
Here is the email template:
The reslting referer URL is included in the email but it is not formed correctly.
E.G.
This is the page referer - http://www.lista.net.nz/index.php?option=com_content&view=article&catid=51:builders&id=81&Itemid=75
but in the emailed results the referer link is - http://www.lista.net.nz/index.php?|||||o||p||t||i||o||n||=com_content&view=article&catid=51:builders&id=81&Itemid=75/
Lots of these things|||| are inserted!!!
Does anyone have any idea?
Thanks in advance!!
Andrew
I want to add the refering page URL in the form results. I had this working on my staging site but after migrating the settings to my live site it no longer works.
I am using this as a hidden field:
<input type='hidden' name='referer' value='<?=$_SERVER['HTTP_REFERER']?>'
Here is the form code:
<div class="form_item">
<div class="form_element cf_heading">
<h1 class="cf_text">Your Details</h1>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Business:</label>
<input class="cf_inputbox required validate-alpha" maxlength="150" size="30" title="Please enter your businesses name using alpha characters only." id="text_0" name="busname" type="text" />
<a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" alt="" src="components/com_chronocontact/css/images/tooltip.png"/></a>
<div class="tooltipdiv">Business: :: Your business name should be recognisable to the customer you are inviting</div>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Name:</label>
<input class="cf_inputbox" maxlength="150" size="30" title="Enter you name using alpha characters only" id="text_1" name="name" type="text" />
<a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" alt="" src="components/com_chronocontact/css/images/tooltip.png"/></a>
<div class="tooltipdiv">Name: :: Enter your name</div>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Email:</label>
<input class="cf_inputbox validate-email" maxlength="150" size="30" title="Enter a valid email address" id="text_2" name="email" type="text" />
<a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" alt="" src="components/com_chronocontact/css/images/tooltip.png"/></a>
<div class="tooltipdiv">Email: :: Enter an email address the customer can contact you at</div>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_heading">
<h1 class="cf_text">Customer Details</h1>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_textbox">
<label class="cf_label" style="width: 150px;">Email:</label>
<input class="cf_inputbox validate-email" maxlength="150" size="30" title="Enter a valid email address" id="text_3" name="inviteemail" type="text" />
<a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" alt="" src="components/com_chronocontact/css/images/tooltip.png"/></a>
<div class="tooltipdiv">Email: :: Enter the email address of the customer you would like to invite would like to invite</div>
</div>
<div class="cfclear"> </div>
</div>
<input type='hidden' name='page_title' value='<?php global $mainframe; echo $mainframe->getPageTitle();?>'/>
<input type='hidden' name='referer' value='<?=$_SERVER['HTTP_REFERER']?>'
<div class="form_item">
<div class="form_element cf_captcha">
<label class="cf_label" style="width: 150px;">Are you human?</label>
<span>{imageverification}</span>
<a class="tooltiplink" onclick="return false;"><img height="16" border="0" width="16" class="tooltipimg" alt="" src="components/com_chronocontact/css/images/tooltip.png"/></a>
<div class="tooltipdiv">Are you human? :: Enter character in the verification image (this is in an effort to stop SPAM)</div>
</div>
<div class="cfclear"> </div>
</div>
<div class="form_item">
<div class="form_element cf_button">
<input value="Submit" name="button_7" type="submit" />
</div>
<div class="cfclear"> </div>
</div>
Here is the email template:
<p>Hi!</p>
<p>{name} from {busname} has invited you to review your experieince with a product your service you have recieved.</p>
<p>To review {busname} click <a href="{referer}/" title="Review Business">here</a></p>
<p>You can contact {name} by simply replying to this email.</p>
<p>Thanks for considering a review at <a href="http://www.lista.net.nz/" title="Lista - where Kiwi's list and review businesses">www.lista.net.nz</a></p>
<p>Regards,</p>
<p>The Team at Lista</p>
<p> </p>
The reslting referer URL is included in the email but it is not formed correctly.
E.G.
This is the page referer - http://www.lista.net.nz/index.php?option=com_content&view=article&catid=51:builders&id=81&Itemid=75
but in the emailed results the referer link is - http://www.lista.net.nz/index.php?|||||o||p||t||i||o||n||=com_content&view=article&catid=51:builders&id=81&Itemid=75/
Lots of these things|||| are inserted!!!
Does anyone have any idea?
Thanks in advance!!
Andrew
Hey,
Just had a thought after I posted this. The only difference between my staging site and my live site is the live site has .htaccess enabled. I removed this file from my site root and the referer works as expected.
Here is the contents of my .htaccess file:
Can anyone help me fix what ever it is in the .htaccess file stopping the referer work?
Thanks!
Andrew
Just had a thought after I posted this. The only difference between my staging site and my live site is the live site has .htaccess enabled. I removed this file from my site root and the referer works as expected.
Here is the contents of my .htaccess file:
##
# @version $Id: htaccess.txt 13415 2009-11-03 15:53:25Z ian $
# @package Joomla
# @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##
#####################################################
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################
## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks
#
# mod_rewrite in use
RewriteEngine On
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)
# RewriteBase /
########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section
Can anyone help me fix what ever it is in the .htaccess file stopping the referer work?
Thanks!
Andrew
This topic is locked and no more replies can be posted.