Code gets corrected when page saved

T

thisisandrew

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!?
 
J

Jens Peter Karlsen [FP-MVP]

Change your PHP to use <% %>
that way Frontpage will leave your code alone.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
 
T

thisisandrew

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.
 
T

thisisandrew

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
 
C

Corey Bryant

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!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top