Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2002
    Posts
    250

    Simple problem, tough solution... Help requested

    Ok I've done something stupid and need some ideas.

    I've built a website design/content management system. Content is stored in a mysql DB, and substitutions are done using "[varname]". On the last pass, all substitutions that do not have a corresponding varname are replaced with "".

    Problem is we are now adding javascripts to the content. On the final pass js array variables are being replaced with "". Thus varname[index] becomes varname breaking the script.

    I only want to overhaul the engine once. What varname delimiters should I use?

    Bob

  2. #2
    This is safe, if you're not guaranteed that "$var" will be set.


    Code:
    var foo = '<?=$var?>';

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •