GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   PHP Question (https://gfy.com/showthread.php?t=215024)

Ash@phpFX 12-31-2003 02:55 AM

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 12-31-2003 05:30 AM

A little more specific please? Or ICQ 47966255, but I'm about to go to dreamland.

Nightwork 12-31-2003 05:33 AM

asher,

contact me on ICQ.

This shouldn't be that hard, will have u on the right track in 5 min.

keyDet79 12-31-2003 05:34 AM

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

Hansm 12-31-2003 06:07 AM

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

pornanza 12-31-2003 06:50 AM

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

fwrite($file, '<html>');

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

fwrite($file, '</html>');

fclose($file);


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

ryan

Ash@phpFX 12-31-2003 06:57 AM

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

:thumbsup :thumbsup :thumbsup

Nightwork 12-31-2003 07:11 AM

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 :)


All times are GMT -7. The time now is 12:32 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123