You are here: Re: Lost formatting in browser 'view source' « All PHP « IT news, forums, messages
Re: Lost formatting in browser 'view source'

Posted by J.O. Aho on 11/21/06 05:24

dorayme wrote:
> In article <4sejtcFvg06eU1@mid.individual.net>,
> "J.O. Aho" <user@example.net> wrote:
>
>>> Some sites I maintain have a lot of pages and changing the names
>>> of all the files is the last thing I would do, not the first ;-)
>> A small shell script fixes both file names and anchor urls, it's not that you
>> must to rename files and fix links manually.
>>
>> http://www.faqs.org/docs/Linux-HOWTO/Bash-Prog-Intro-HOWTO.html#ss12.3
>>
>> and checking the man page for sed.
>>
> What does "fix" mean? Sorry, I am lost. I don't want to change
> all the file names for a big site, each of which has a footer
> involved. Not because I can't do it easily en masse (without
> going to each file name and renaming) but because it does not
> sound like a good idea to me to change all my files and all the
> urls and all the links in everyone's bookmarks and then
> instigating further things to cope with this.

At some point you made a wrong decision, as included php into your *.html
files, sure you can use AddType on an apache server, what about you switch to
a host who has IIS. At the same time your html pages without php-code are
processed by php.

Renaming the files to *.php is a better idea than use AddType. If you are
concerned about users links and bookmarks to break, you have the nice option
in apache to rewrite rules, if they try to load a "missing" html page,
redirect them to a php file with the same name.

http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
http://httpd.apache.org/docs/1.3/misc/rewriteguide.html


> Sorry J.O., I may be misunderstanding all this. Sounds terribly
> complicated. Checking "man pages for sed". For sed!
>
> Honestly, it was easier using find and replace in my text editor,
> (3 secs work to change a site) and on broadband not that much
> longer to reload all the html files. No other downsides I could
> see (there is one, I learnt recently, to help the user: about re
> caching repeated text...) but I am wondering if all the claims
> for all the trumpeting of the great value of includes is greatly
> exaggerated now!

You painted up that you had so many files to change, that the usage of sed
would be a lot faster than load one page at the time used a editors
find/replace function. sed is a program you find on most unix like systems and
the program man shows you manual pages for programs: man sed


> But I will persist because it seems so stupid not to have
> includes! I guess a solution to this formatting thing will emerge
> at some stage!

Includes are used so that you have ONE file to edit instead of MAY pages with
the same thing repeated over and over again. Just assume you have your e-mail
address in an include and you include that include in 100 other pages, you
happen to change your e-mail address, what do you rather do:

1. run sed and change all the 100 pages automatically
2. run your editor, load 100 pages, use find/replace to change the address
3. run your editor, load 1 page, edit and it fixed in 100 pages at once


//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация