<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=us-ascii" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Tim Williams wrote:
<blockquote
cite="mid:9afea2ac0708231305v539390dew84926f0b0dcd6974@mail.gmail.com"
type="cite">
<pre wrap="">On 23/08/07, <a class="moz-txt-link-abbreviated" href="mailto:sebzzz@gmail.com">sebzzz@gmail.com</a> <a class="moz-txt-link-rfc2396E" href="mailto:sebzzz@gmail.com"><sebzzz@gmail.com></a> wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Hi,
I have a bunch of files that have changed from standard htm files to
php files but all the links inside the site are now broken because
they point to the .htm files while they are now .php files.
Does anyone have an idea about how to do a simple script that changes
each .htm in a given file to a .php
Thanks a lot in advance
</pre>
</blockquote>
<pre wrap=""><!---->
Something like:
Infile = open(f_name,'r+')
Data = Infile.read()
InFile.write(Data.replace('.htm','.php'))
Infile.close()
:)
</pre>
</blockquote>
Yeah, but you'd better make darn sure that *all* links point to .htm
files (including external links), because you could very easily end up
pointing to <a class="moz-txt-link-freetext" href="http://some.othersite.com/index.phpl">http://some.othersite.com/index.phpl</a><br>
<br>
And that's just no good.<br>
<br>
</body>
</html>