Email this page function has a problem

3 posts by 2 authors in: Forums > CMS Builder
Last Post: September 16, 2010   (RSS)

Using CMS Builder v. 2.06 (latest.)

It seems that the function 'thisPageUrl()' is not grabbing more than one query from the current URL.

For example, using this code:

<a href="news.php?title=<?php echo $newsTitle['title'] . "&amp;item=" . $newsTitle['num']; ?>"><?php echo $newsTitle['title']; ?></a>

Here's the actual URL as it displays in my browser address bar:

http://www.all4hym.com/newsite/news.php?title=All4Hym%20Updates%20Website&item=2

This is what comes out of the function:

http://www.all4hym.com/newsite/news.php?title=All4Hym+Updates+Website

I've tried everything I know, but can't get it to work. I end up having to remove any querys before the record number. Even then, you've got to make sure that you name the record number. If you don't, then it still misbehaves.

Maybe someone could look into this.

Thank you.

Jim
WebCamp One, LLC



Websites That Work

Re: [Mr Jim] Email this page function has a problem

By Chris - September 16, 2010

Hi Jim,

Great catch, thank you! :)

I've fixed this for the next version of CMS Builder.

To fix your "Email this page" code, change this:

<a href="mailto:?subject=<?php echo thisPageUrl() ?>">Email this Page</a>

...to this: (new code in red)

<a href="mailto:?subject=<?php echo urlencode(thisPageUrl()) ?>">Email this Page</a>

Please let me know if you have any questions.
All the best,
Chris