PHP Question

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ash@phpFX
    Confirmed User
    • Nov 2003
    • 4292

    #1

    PHP Question

    does anyone know how to generate html pages from php.

    I have a php script that displays my TGP galleries, as well as archives sections, but i want to output what the surfer would see to a html file.

    any help is greatly appreciated.
  • Mishi
    Confirmed User
    • Feb 2002
    • 1054

    #2
    A little more specific please? Or ICQ 47966255, but I'm about to go to dreamland.
    Looking for PHP/MySQL solutions? Check out Cyboriginal - custom scripts, installation services and more.

    Comment

    • Nightwork
      Registered User
      • Oct 2003
      • 61

      #3
      asher,

      contact me on ICQ.

      This shouldn't be that hard, will have u on the right track in 5 min.
      God may have created the world in 6 days, but you can bet your ass that while he rested on the 7th, a programmer coded it all.<br>ICQ:48322442

      Comment

      • keyDet79
        Confirmed User
        • Feb 2003
        • 1109

        #4
        I think you mean: copy("http://server.com/file1.php","file1.html")

        Multihomed quality BW for less
        ICQ 51034232 - MSN [email protected] - Email keydet(at)vibehosting.com

        Comment

        • Hansm
          Confirmed User
          • Jun 2002
          • 871

          #5
          a preview thumbnail or the output of the .html page?

          Comment

          • pornanza
            Confirmed User
            • Jul 2003
            • 238

            #6
            $file = fopen('index.html', 'w');

            fwrite($file, '&lt;html&gt;');

            fwrite($file, 'lots of content here');

            fwrite($file, '&lt;/html&gt;');

            fclose($file);


            instead of echoing the HTML to user, write the information to a file.

            ryan
            Eskimo Hoe
            QuickWank
            Pornanza!

            Comment

            • Ash@phpFX
              Confirmed User
              • Nov 2003
              • 4292

              #7
              Nightwork, thats a lot, saved me a lot of potential heartache

              Comment

              • Nightwork
                Registered User
                • Oct 2003
                • 61

                #8
                at your service, asher ;)

                keydet, copy wouldn't do the trick, because it will copy the actual source of the .php file, not the parsed result.

                pornanza, that's basically the idea, but the fwrite for the html tags would generate errorous html, because the parsed result already contains the tags.

                PHP Code:
                //open page
                $fd=fopen("http://www.server.com/galleries.php","r");
                
                //retrieve contents (eof won't work with remote filereading)
                while ($line=fgets($fd,1000))
                {
                $alltext.=$line;
                }
                fclose ($fd);
                //open local file (or create if doesn't excist, check for correct 
                //permissions in dir, pointer set to begin of file
                $out = fopen("galleries.html", "w");
                //write retrieved content
                fwrite($out, $alltext);
                fclose($out); 
                
                ^ the used code, enjoy
                God may have created the world in 6 days, but you can bet your ass that while he rested on the 7th, a programmer coded it all.<br>ICQ:48322442

                Comment

                Working...