Now let's see .... your "sundar.html" would look like this after your
script and a little indenting
<html>
        <head>
                <title>
                        diksha
                </title>
        </head>
        <body>
                <h1> i solved problem </h1>
                <pre>
                <input type=button name=valid value="Validate">
        </body>
</html>

The first thing you do if you would like to write good html you validate
it at http://www.w3.org/ HTML Validator section.
The HTML Validator 1st error: No DOCTYPE definition (of course it's
optional in almost all browsers but the HTML standard says that it is
REQUIRED)
I added this DOCTYPE:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd";>
revalidate and you get this errors:
-- W3c Validator --
Below are the results of attempting to parse this document with an SGML
parser. 

     1. Line 13, column 7:  end tag for "PRE" omitted, but its
        declaration does not permit this (explain...). 
           </body>
                 ^
     2. Line 11, column 5:  start tag was here (explain...). 
               <pre>
               ^
-- /W3c Validator --

so the code must look like this:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd";>
<html>
        <head>
                <title>
                        diksha
                </title>
        </head>
        <body>
                <h1> i solved problem </h1>
                <pre>
                <input type="button" name="valid" value="Validate">
                </pre>
        </body>
</html>

And of course:

-- W3c Validator --
This Page Is Valid HTML 4.01 Transitional!
-- W3c Validator --

now .. your php script would look something like this:
-- PHP SCRIPT --
<?php
$fp=fopen("sundar.html","w");
$html_page=<<<END_HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  "http://www.w3.org/TR/html4/loose.dtd";>
<html>
        <head>
                <title>
                        diksha
                </title>
        </head>
        <body>
                <h1> i solved problem </h1>
                <pre>
                <input type="button" name="valid" value="Validate">
                </pre>
        </body>
</html>
END_HTML;
fwrite($fp,$html_page);
fclose($fp);
?>
-- /PHP SCRIPT --

This should solve the problem .. It works great in Mozilla and IE but I can't test
it in Netscape because I don't have Netscape installed.
Hope it helps ...
-- 
Mincu Alexandru                 intelinet.ro
Tel:+4 0745 369719              +4 021 3140021
www.intelinet.ro                [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to