Code gets corrected when page saved

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I insert some PHP code into my pages title tag and when I save the page
Frontpage turns some characters into their HTML entity equivalents.

e.g. <title>Page Tile - <?php echo $variable; ?> </title>
turn to <title>Page Tile - <?php echo $variable; ?> </title>

When I place an HTML entity £ into the code of my page then click save it
converts it into the ASCII character £ which then looks like ? when the
server serves the page.

e.g. <td>Price: £ <?php echo $price; ?> </td>
turns to <td>Price: £ <?php echo $price; ?> </td>

Any ideas why this may be happening? Maybe I shouldn't be attempting to use
Frontpage when I'm writing PHP code in the page as well!?
 
Change your PHP to use <% %>
that way Frontpage will leave your code alone.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 
Thanks. I tried your suggestion but no luck.

Jens Peter Karlsen said:
Change your PHP to use <% %>
that way Frontpage will leave your code alone.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 
Thanks. Your mention of charsets got me looking in more detail. The page had
2 charset declarations!

<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
then later
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

Removing the iso charset appears to have fixed the problem. It now leaves
all HTML entities alone and leaves my PHP code alone too!

Thanks for your help
 
Glad to have helped. It is usually the charset that wil causes some
problems. Hopefully those articles helped to explain them as well.

Good luck with the site!
 
Back
Top