PC Review


Reply
Thread Tools Rate Thread

Code gets corrected when page saved

 
 
=?Utf-8?B?dGhpc2lzYW5kcmV3?=
Guest
Posts: n/a
 
      28th Nov 2006
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!?
 
Reply With Quote
 
 
 
 
Jens Peter Karlsen [FP-MVP]
Guest
Posts: n/a
 
      28th Nov 2006
Change your PHP to use <% %>
that way Frontpage will leave your code alone.

Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.

On Tue, 28 Nov 2006 01:49:01 -0800, thisisandrew
<(E-Mail Removed)> wrote:

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

 
Reply With Quote
 
=?Utf-8?B?Q29yZXkgQnJ5YW50?=
Guest
Posts: n/a
 
      28th Nov 2006
The codes you gave are the same.

For the £ - are you using & p o u n d ; (without the spaces)?

What charset are you using? Check out
http://www.iwdn.net/showthread.php?t=2864 for more information on this

"thisisandrew" wrote:

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

 
Reply With Quote
 
=?Utf-8?B?dGhpc2lzYW5kcmV3?=
Guest
Posts: n/a
 
      28th Nov 2006
Thanks. I tried your suggestion but no luck.

"Jens Peter Karlsen [FP-MVP]" wrote:

> Change your PHP to use <% %>
> that way Frontpage will leave your code alone.
>
> Regards Jens Peter Karlsen. Microsoft MVP - Frontpage.
>
> On Tue, 28 Nov 2006 01:49:01 -0800, thisisandrew
> <(E-Mail Removed)> wrote:
>
> >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!?

>

 
Reply With Quote
 
=?Utf-8?B?dGhpc2lzYW5kcmV3?=
Guest
Posts: n/a
 
      28th Nov 2006
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

"Corey Bryant" wrote:

> The codes you gave are the same.
>
> For the £ - are you using & p o u n d ; (without the spaces)?
>
> What charset are you using? Check out
> http://www.iwdn.net/showthread.php?t=2864 for more information on this
>
> "thisisandrew" wrote:
>
> > 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!?

 
Reply With Quote
 
=?Utf-8?B?Q29yZXkgQnJ5YW50?=
Guest
Posts: n/a
 
      28th Nov 2006
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!

"thisisandrew" wrote:

> 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
>
> "Corey Bryant" wrote:
>
> > The codes you gave are the same.
> >
> > For the £ - are you using & p o u n d ; (without the spaces)?
> >
> > What charset are you using? Check out
> > http://www.iwdn.net/showthread.php?t=2864 for more information on this
> >
> > "thisisandrew" wrote:
> >
> > > 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!?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Access 2007 will code save when Forms are saved as .asp or web page? RCGUA Microsoft Access Forms 1 13th Jul 2009 02:36 PM
VB Code Corrected Solutions RichIT Microsoft Excel Programming 0 11th Aug 2006 09:15 AM
Viewing source code when saved as web page Mark Microsoft Excel Misc 1 31st Mar 2005 06:26 AM
Re: How can I find the original file after I corrected and saved Steve Rindsberg Microsoft Powerpoint 0 7th Sep 2004 06:58 PM
Re: How can I find the original file after I corrected and saved Echo S Microsoft Powerpoint 0 7th Sep 2004 06:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:03 PM.