Frontpage changes my code when I save!! How can I stop it?

B

Bobby

This simple line from a page in php:

<img src=\"images/stainless_steel_bars.gif\">

gets changed to this:

<img src=%22images/stainless_steel_bars.gif/%22>

every time I save the page in front page!

How can I tell Frontpage NOT to change the code?
 
T

Thomas A. Rowe

What is the purpose of the two \ in the image src tag?

If you don't want FP to change this, then use the Insert | Web Component |
Advanced | HTML

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
B

Bobby

Thomas A. Rowe said:
What is the purpose of the two \ in the image src tag?

If you don't want FP to change this, then use the Insert | Web Component |
Advanced | HTML


I'm importing pages in PHP that already have this coding, I need to modify
the pages.
The moment I save a page, or even change from HTML view to Normal and then
back, the coding automatically changes!

Does anyone know of a command somewhere to tell FP NOT to make adjustments.

In answer to your question, the backslash followed by a quote:
\"

becomes this:
%22

this coding is necessary for the php page to work.
 
S

Steve Easton

I think the problem is the extra backslashes.
change
<img src=\"images/stainless_steel_bars.gif\">
to
<img src="images/stainless_steel_bars.gif">

and see what happens.

FrontPage is converting \" to %22
 
T

Thomas A. Rowe

Make sure you have set: Page Options | HTML Source | General | Preserve
existing HTML

If you open the page in HTML view and save while in HTML View does FP
maintain the code?

I have never seen any code require \" in a image src tag.

What happen is you remove the two \ ?

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================
 
S

Stefan B Rusynko

And will probably also not like the file based: /
Change it to <img src="images\stainless_steel_bars.gif">

--




| I think the problem is the extra backslashes.
| change
| <img src=\"images/stainless_steel_bars.gif\">
| to
| <img src="images/stainless_steel_bars.gif">
|
| and see what happens.
|
| FrontPage is converting \" to %22
| --
| using 2k PRO but....95isalive
| This site is best viewed............
| .......................with a computer
|
| | > This simple line from a page in php:
| >
| > <img src=\"images/stainless_steel_bars.gif\">
| >
| > gets changed to this:
| >
| > <img src=%22images/stainless_steel_bars.gif/%22>
| >
| > every time I save the page in front page!
| >
| > How can I tell Frontpage NOT to change the code?
| >
| >
|
|
 
B

Bobby

| | > This simple line from a page in php:
| >
| > <img src=\"images/stainless_steel_bars.gif\">
| >
| > gets changed to this:
| >
| > <img src=%22images/stainless_steel_bars.gif/%22>
| >
| > every time I save the page in front page!
| >
| > How can I tell Frontpage NOT to change the code?


Stefan B Rusynko said:
And will probably also not like the file based: /
Change it to <img src="images\stainless_steel_bars.gif">

Unfortunately that does not work in PHP

| I think the problem is the extra backslashes.
| change
| <img src=\"images/stainless_steel_bars.gif\">
| to
| <img src="images/stainless_steel_bars.gif">
|
| and see what happens.
|
| FrontPage is converting \" to %22


Yes, FrontPage is doing exactly that.

While I appreciate all your efforts, I am not trying to find a fix for this
particular problem.
I can open an editor and make the changes I need.

What I want to do is find a command in FrontPage (if one exists) to BLOCK it
from automatically making these changes.
I DO have "preserve existing html" enabled in the page options of FP.

* PHP uses the backslash before the quotations \" to say to
the server this is a quotation, because it interprets normal quotes (without
the backslash before them) as syntax.

Any ideas on how to configure FP NOT to change the coding?
Please do not suggest alternative coding.
 
S

Stefan B Rusynko

Then the entire PHP code segment should be unaffected by FP
Sounds like you are mixing html and PHP causing FP to parse the html
Post your PHP snippet
(<img src=\"images/stainless_steel_bars.gif\"> is not pure PHP)

PS There are some PHP addins that should help you
See http://www.microsoft.com/frontpage/downloads/addin/launchupdate/default.asp
--




|
| > | | > | > This simple line from a page in php:
| > | >
| > | > <img src=\"images/stainless_steel_bars.gif\">
| > | >
| > | > gets changed to this:
| > | >
| > | > <img src=%22images/stainless_steel_bars.gif/%22>
| > | >
| > | > every time I save the page in front page!
| > | >
| > | > How can I tell Frontpage NOT to change the code?
|
|
| "Stefan B Rusynko" <[email protected]> ha scritto nel messaggio
| | > And will probably also not like the file based: /
| > Change it to <img src="images\stainless_steel_bars.gif">
|
| Unfortunately that does not work in PHP
|
|
| | > | I think the problem is the extra backslashes.
| > | change
| > | <img src=\"images/stainless_steel_bars.gif\">
| > | to
| > | <img src="images/stainless_steel_bars.gif">
| > |
| > | and see what happens.
| > |
| > | FrontPage is converting \" to %22
|
|
| Yes, FrontPage is doing exactly that.
|
| While I appreciate all your efforts, I am not trying to find a fix for this
| particular problem.
| I can open an editor and make the changes I need.
|
| What I want to do is find a command in FrontPage (if one exists) to BLOCK it
| from automatically making these changes.
| I DO have "preserve existing html" enabled in the page options of FP.
|
| * PHP uses the backslash before the quotations \" to say to
| the server this is a quotation, because it interprets normal quotes (without
| the backslash before them) as syntax.
|
| Any ideas on how to configure FP NOT to change the coding?
| Please do not suggest alternative coding.
|
|
|
 
B

Bobby

Hi Stefan, thanks for keeping the thread alive.
It's driving me crazy and I'd really like to find a solution to allow me to
edit in FrontPage without having to open another editor.
http://www.microsoft.com/frontpage/downloads/addin/launchupdate/default.asp

I've checked the addin page you suggested but it's not clear to me if an
add-in exists that will modify FP to leave the code alone.
If you have any ideas let me know.

I do have a work-around:
Open the php page in an editor, paste into NEW page in FP WITHOUT saving,
make changes, paste back into editor and save.
But wouldn't it me so much nicer if FP didn't take things into its own hands
and try to "help out" so to speak?
Then the entire PHP code segment should be unaffected by FP
Sounds like you are mixing html and PHP causing FP to parse the html
Post your PHP snippet

Here is the code where the php begins:

<?
$i=0;
while($row = mysql_fetch_array($result))
{
$i++;
echo " <tr bgcolor=\"$coloreinttabelle\">\n";
echo " <td><span class = \"testo\"><img
src=\"images/stainless_steel_bars.gif\"> <b><a
href=\"product_search3.php?idcatprodotti=2&idsubcatprodotti=$row[idsubcatpro
dotti]&subcatprodotti=$row[productsubcat]&categoriaprodotti=Stainless
Steels\">$row[productsubcat]</a></b><br> $row[description]</span></td>\n";
echo " </tr>\n";
}
mysql_free_result($result);

//chiudo connessione al database che fa freddo
mysql_close ($connessione);

?>
 
R

Ronx

First:
<img src=\"images/stainless_steel_bars.gif\">
should be written as
<img src=\"images\\stainless_steel_bars.gif\">
The \ is an escape character which means that the character following it has
no special meaning.
To stop FP changing your code follow Thomas Rowe's suggestion from the
beginning of this thread:

Insert | Web Component | Advanced | HTML

This has been changed in FP2003 to

Insert | Web Component | Advanced Controls | HTML

so your version of FP should have something similar to these.
This *does* stop FP from changing the code, and is probably the only way
FP2000 and later can be stopped when using PHP <? tags.

HTH
--
Ron

Reply only to group - all emails will be deleted unread.


Bobby said:
Hi Stefan, thanks for keeping the thread alive.
It's driving me crazy and I'd really like to find a solution to allow me to
edit in FrontPage without having to open another editor.
http://www.microsoft.com/frontpage/downloads/addin/launchupdate/default.asp

I've checked the addin page you suggested but it's not clear to me if an
add-in exists that will modify FP to leave the code alone.
If you have any ideas let me know.

I do have a work-around:
Open the php page in an editor, paste into NEW page in FP WITHOUT saving,
make changes, paste back into editor and save.
But wouldn't it me so much nicer if FP didn't take things into its own hands
and try to "help out" so to speak?
Then the entire PHP code segment should be unaffected by FP
Sounds like you are mixing html and PHP causing FP to parse the html
Post your PHP snippet

Here is the code where the php begins:

<?
$i=0;
while($row = mysql_fetch_array($result))
{
$i++;
echo " <tr bgcolor=\"$coloreinttabelle\">\n";
echo " <td><span class = \"testo\"><img
src=\"images/stainless_steel_bars.gif\"> <b><a
href=\"product_search3.php?idcatprodotti=2&idsubcatprodotti=$row[idsubcatpro
dotti]&subcatprodotti=$row[productsubcat]&categoriaprodotti=Stainless
Steels\">$row[productsubcat]</a></b><br> $row[description]</span></td>\n";
echo " </tr>\n";
}
mysql_free_result($result);

//chiudo connessione al database che fa freddo
mysql_close ($connessione);

?>


| > | | > | > This simple line from a page in php:
| > | >
| > | > <img src=\"images/stainless_steel_bars.gif\">
| > | >
| > | > gets changed to this:
| > | >
| > | > <img src=%22images/stainless_steel_bars.gif/%22>
| > | >
| > | > every time I save the page in front page!
| > | >
| > | > How can I tell Frontpage NOT to change the code?
 
S

Stefan B Rusynko

Set up your PHP to use <script language="php"> and </script>
instead of <? ?> as your script tags - FP will ignore all scripts



PS

IMHO
you are using poor coding technique when you create "part of your html" in PHP and the rest in Html
- the entire PHP code should open and close the table
- thus FP will leave it alone and you are less prone to causing a broken tag pair between PHP and Html
In general all server side coding should be valid stand alone html

--




| Hi Stefan, thanks for keeping the thread alive.
| It's driving me crazy and I'd really like to find a solution to allow me to
| edit in FrontPage without having to open another editor.
|
| > See
| http://www.microsoft.com/frontpage/downloads/addin/launchupdate/default.asp
|
| I've checked the addin page you suggested but it's not clear to me if an
| add-in exists that will modify FP to leave the code alone.
| If you have any ideas let me know.
|
| I do have a work-around:
| Open the php page in an editor, paste into NEW page in FP WITHOUT saving,
| make changes, paste back into editor and save.
| But wouldn't it me so much nicer if FP didn't take things into its own hands
| and try to "help out" so to speak?
|
| > Then the entire PHP code segment should be unaffected by FP
| > Sounds like you are mixing html and PHP causing FP to parse the html
| > Post your PHP snippet
|
| Here is the code where the php begins:
|
| <?
| $i=0;
| while($row = mysql_fetch_array($result))
| {
| $i++;
| echo " <tr bgcolor=\"$coloreinttabelle\">\n";
| echo " <td><span class = \"testo\"><img
| src=\"images/stainless_steel_bars.gif\"> <b><a
| href=\"product_search3.php?idcatprodotti=2&idsubcatprodotti=$row[idsubcatpro
| dotti]&subcatprodotti=$row[productsubcat]&categoriaprodotti=Stainless
| Steels\">$row[productsubcat]</a></b><br> $row[description]</span></td>\n";
| echo " </tr>\n";
| }
| mysql_free_result($result);
|
| //chiudo connessione al database che fa freddo
| mysql_close ($connessione);
|
| ?>
|
|
|
| > | > | | > | > | > This simple line from a page in php:
| > | > | >
| > | > | > <img src=\"images/stainless_steel_bars.gif\">
| > | > | >
| > | > | > gets changed to this:
| > | > | >
| > | > | > <img src=%22images/stainless_steel_bars.gif/%22>
| > | > | >
| > | > | > every time I save the page in front page!
| > | > | >
| > | > | > How can I tell Frontpage NOT to change the code?
|
|
 
B

Bobby

Hi Ron,
First:
<img src=\"images/stainless_steel_bars.gif\">
should be written as
<img src=\"images\\stainless_steel_bars.gif\">
The \ is an escape character which means that the character following it has
no special meaning.

Thanks, you are right and it works. I know next to nothing about php and
did not do the programming.
My job is to get the site up in different languages, and therefore need to
give the translators the pages but make it easy for them to see what they
are doing.
If a translator can see the pages in an editor like FP then they have a
better idea of the context of things.
Additionally, if the translator can simply translate the words in FP and
save the file it makes my job easier and saves a lot of time.
Obviously if FP changes the coding then I waste time trying to fix it.
To stop FP changing your code follow Thomas Rowe's suggestion from the
beginning of this thread:

Insert | Web Component | Advanced | HTML

Since we cannot simply open a php page with FP without having the problem,
it means copying from one editor to another.
It is easier to implement my work around at this point and simply re-copy
into the other editor.
If I insert the entire coding as web component (deleting all of the original
code) then yes, it works, but you cannot use FP in normal view.
So, the question remains, are there any plug-ins or commands that can tell
FP NOT to change the code WHEN OPENING a page in php?

Bobby
Bobby said:
Hi Stefan, thanks for keeping the thread alive.
It's driving me crazy and I'd really like to find a solution to allow me to
edit in FrontPage without having to open another editor.
http://www.microsoft.com/frontpage/downloads/addin/launchupdate/default.asp
I've checked the addin page you suggested but it's not clear to me if an
add-in exists that will modify FP to leave the code alone.
If you have any ideas let me know.

I do have a work-around:
Open the php page in an editor, paste into NEW page in FP WITHOUT saving,
make changes, paste back into editor and save.
But wouldn't it me so much nicer if FP didn't take things into its own hands
and try to "help out" so to speak?


Here is the code where the php begins:

<?
$i=0;
while($row = mysql_fetch_array($result))
{
$i++;
echo " <tr bgcolor=\"$coloreinttabelle\">\n";
echo " <td><span class = \"testo\"><img
src=\"images/stainless_steel_bars.gif\"> <b><a
href=\"product_search3.php?idcatprodotti=2&idsubcatprodotti=$row[idsubcatpro
dotti]&subcatprodotti=$row[productsubcat]&categoriaprodotti=Stainless
Steels\">$row[productsubcat]</a></b><br>
$row said:
echo " </tr>\n";
}
mysql_free_result($result);

//chiudo connessione al database che fa freddo
mysql_close ($connessione);

?>
 
B

Bobby

Now that's what I like, teamwork!

Ok, thanks to all you guys I think I've got my technique refined.
I actually installed the addin for php and found the same tip about using
the <script language="php"> and </script> tags.

This will work fine, all I need to do is a search and replace function for
all pages with <? and ?>.
Interestingly enough they recommend using the % of asp as well.

Stefan, as I mentioned to Ron, I know nothing about php and did not do the
programming.
I simply received these files and need to move things ahead as efficiently
as possible.
Translators understand ABSOLUTELY NOTHING about php and very little about
html, so I need to prepare the files and make it as easy as possible for
them to translate without running into programming difficulties when I send
them up to the server. So I think the search and replace will work fine,
I've already tested it out online.

Thanks again.
 

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