Hello,
I recently added ChronoForms to my website, I'm absolutely happy with it, I think it's better than all of the other form systems that are available at this time.
The website I'm building use articles to display products and product info.
I've created one form at the bottom of the page that will be used for customers requesting additional information or quotes.
I want to have this form at the bottom of each article (each product),
I don't want to have to write a new form for every single product page, so I was
hoping there would be a way to log which page the user submitted the form from.
(I want the form to submit the article link via a hiddden field).
Anyone know if this would be possible?
I recently added ChronoForms to my website, I'm absolutely happy with it, I think it's better than all of the other form systems that are available at this time.
The website I'm building use articles to display products and product info.
I've created one form at the bottom of the page that will be used for customers requesting additional information or quotes.
I want to have this form at the bottom of each article (each product),
I don't want to have to write a new form for every single product page, so I was
hoping there would be a way to log which page the user submitted the form from.
(I want the form to submit the article link via a hiddden field).
Anyone know if this would be possible?
I found a solution for this,
You can add the following bit of PHP code to your form:
And call the current page URL using:
To add it to the form, you could paste it in a hidden field:
To have it appear in your e-mail, simply tag it in with {pageurl} at your appropriate location.
You can add the following bit of PHP code to your form:
<?php
function curPageURL() {
$pageURL = 'http';
if ($_SERVER["HTTPS"] == "on") {$pageURL .= "s";}
$pageURL .= "://";
if ($_SERVER["SERVER_PORT"] != "80") {
$pageURL .= $_SERVER["SERVER_NAME"].":".$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"];
} else {
$pageURL .= $_SERVER["SERVER_NAME"].$_SERVER["REQUEST_URI"];
}
return $pageURL;
}
?>
And call the current page URL using:
<?php
echo curPageURL();
?>
To add it to the form, you could paste it in a hidden field:
<input value="<? echo curPageURL(); ?>" id="hidden_12" name="pageurl" type="hidden" />
To have it appear in your e-mail, simply tag it in with {pageurl} at your appropriate location.
Hi Talaysen,
It depends a bit what you actually want. Joomla has a URI object that will let you access most parts of the current URI. Your code would become:
Bob
It depends a bit what you actually want. Joomla has a URI object that will let you access most parts of the current URI. Your code would become:
<?php
$uri =& JFactory::getURI();
?>
. . .
<input value="<?=$uri?>" id="pageurl" name="pageurl" type="hidden" />
Bob
This topic is locked and no more replies can be posted.