Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Discontinued Products: News Manager & Job Manager:
Substite special chars in $name$ placeholder

 

 


compubase
User

Jan 31, 2005, 7:23 AM

Post #1 of 3 (4082 views)
Shortcut
Substite special chars in $name$ placeholder Can't Post

Hi all,

For a client, we have setup the NM to publish the index file as a php file for advanced features.
For example:
<?php
$name = '$name$';
?>

The problem now is when a single quote is entered in the name field, the php file cannot be parsed because the genereated index file will than look like:
<?php
$name = 'News article name with a quote(')';
?>

Is there a way to subsitute special chars like quotes to theire HTML equivalent?

Thanks for your help!

Joep


ross
Staff / Moderator


Feb 1, 2005, 11:28 AM

Post #2 of 3 (4074 views)
Shortcut
Re: [compubase] Substite special chars in $name$ placeholder [In reply to] Can't Post

Hi Joep.

Thanks for posting!

I can think of a couple different things for you to try.

The first would be to add a \ before each of your single quotes. This will generally cancel out the significance that the character that it’s before. In this case, it would cancel out the fact that a single quote ends a text string.

The second one would be to substitute in the html value for a single quote. It would be &#39; The single quote should get translated back to a ‘ when it’s being used on a page.

Could you give either of these a shot and let me know how it works out?

If you have any questions, don’t hesitate to let me know Smile.
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Product Specialist
support@interactivetools.com


Hire me!
Save time by getting our experts to help with your project. Template changes, advanced features, full integration, whatever you need. Whether you need one hour or fifty, get it done fast with Priority Consulting.




compubase
User

Feb 1, 2005, 11:49 AM

Post #3 of 3 (4072 views)
Shortcut
Re: [ross] Substite special chars in $name$ placeholder [In reply to] Can't Post

Thanks Ros for your reply,

I found the solution by using heredocs funtionality:

<?php
$name = <<<EOD
$name$
EOD;
?>

Joep

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4