RE: [PHP] creating flat versions of php pages

2003-02-25 Thread Mark Cubitt
 '') {$auth_name = 'Anonymous';}

$body = $body.$otbl.'IMG SRC=/images/'.$rating.'stars.jpg ALT='.$ctbl;
$body = $body.TRTD width=10/TDTD$comment$ctbl;
$body = $body.$otbl Submitted by: $auth_namebrDate: $commdateser;
$body = $body.$otbl IMG SRC=\/images/dot_cl.gif\ WIDTH=1 HEIGHT=4
HSPACE=0 VSPACE=4 BORDER=0 ALT=\\ $ctbl;
}
$sth2-finish;

$desc = $name, $city, $county,  site title;
$keywords = $name, $city, $county,  site title;


$htmlCodeNew = $htmlCode;
$htmlCodeNew =~ s/!title!/\r\n$title\r\n/ ;
$htmlCodeNew =~ s/!desc!/\r\n$desc\r\n/ ;
$htmlCodeNew =~ s/!keywords!/\r\n$keywords\r\n/ ;
$htmlCodeNew =~ s/!date!/\r\n$dateser\r\n/ ;
$htmlCodeNew =~ s/!body!/\r\n$body\r\n/ ;

open (FileToWrite, $fileName) or die Can't Create/Open File\r\n;

print FileToWrite $htmlCodeNew;

close(FileToWrite);

}


$sth-finish;

$dbh-disconnect();


Don't know if that will help at all, and this is just one of the scripts we
use to build some pages.


 hi mate i am interested in finding example trawlers in either php
 or perl ,
 is mod_fast_cgi a better way to do this ? is there a way of
 trawling through
 each page creating a html version of it and also converting the links to
 other pages and the other pages too ?

 Mark Cubitt [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]...
  Are all the news stories in a database?
 
  If so we are current in devolopment of a simaliar site (although not
 news),
  we are using Perl scripts to build all the HTML pages (both Index's and
  Pages) during the evening (4am), it takes about 8 secs to build
 2500 pages
  and the Perl scripts could be a lot more efficiant, we are
 using PHP todo
  all the admin and stat areas of the site.
 
  Static HTML pages not only increase the speed but they also improve SEO
  (Search Engine Optimasion) if handled correctly.
 
  Don't know if this will help you but maybe it is a an idea.
 
  Also i'm sorry if this answer takes this a little off topic.
 
  regards
 
  Mark Cubitt
 
   -Original Message-
   From: electroteque [mailto:[EMAIL PROTECTED]
   Sent: 24 February 2003 11:13
   To: [EMAIL PROTECTED]
   Subject: Re: [PHP] creating flat versions of php pages
  
  
   i dont understand what you mean , anyway, this is a short term
   situation as
   the site is pretty slow and cpu intensive,  the setup is a sun solaris
 box
   running apache 1.3 and php3 , just had a meeting today to push
   through apahe
   2 and php 4.3 ut wont happen for a while , we need a solution in the
 next
   month, we basically need a system that will trawl the site or
 the latest
   news and flatten them so they are less taxing on the server as
   our last time
   cost us dearly , 170,000 hits in one day !
   so would flattening to html solve our problem or is the server
   going to get
   hammered anyway ?
  
   Gonzo [EMAIL PROTECTED] wrote in message
   news:[EMAIL PROTECTED]
 hi guys we have 2 very high traffic sites and we need
 to be able to make these pages load faster , we are
 coming up with a solution to make flat file versions of
 the sites in the short term before we start using
 caching technologhies is this the right way to go about
 this ?
   
I think anyone trying to answer this would need to know
more about your setup.  Caching is not necessarily the
answer if a dynamic page is dynamic enough every time to
be different.  (Please keep this on-list)
   
 also whats is the best way to parse a php page
 ie foo.php?id=1, foo.php?id=2 with the contents of each
 story to a file and update all the links. maybe with
 naming conventions like foo/1.html, foo/2.html in a mod
 rewrite style
   
I like using Variables from URI:
   
  http://nirvani.org/software/variables_from_uri/
   
Gonzo
   
   
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
  
   **
   
This email has been virus checked by the Eclipse Internet
   MAILsafe service
   **
   
www: http://www.eclipse.net.uk/email:
   [EMAIL PROTECTED]
   **
   
  
  
 




 **
 
  This email has been virus checked by the Eclipse Internet
 MAILsafe service
 **
 
  www: http://www.eclipse.net.uk/email:
 [EMAIL PROTECTED]
 **
 




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



Re: [PHP] creating flat versions of php pages

2003-02-24 Thread Gonzo
 hi guys we have 2 very high traffic sites and we need
 to be able to make these pages load faster , we are
 coming up with a solution to make flat file versions of
 the sites in the short term before we start using
 caching technologhies is this the right way to go about
 this ?

I think anyone trying to answer this would need to know
more about your setup.  Caching is not necessarily the
answer if a dynamic page is dynamic enough every time to
be different.  (Please keep this on-list)

 also whats is the best way to parse a php page
 ie foo.php?id=1, foo.php?id=2 with the contents of each
 story to a file and update all the links. maybe with
 naming conventions like foo/1.html, foo/2.html in a mod
 rewrite style

I like using Variables from URI:

  http://nirvani.org/software/variables_from_uri/

Gonzo



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



Re: [PHP] creating flat versions of php pages

2003-02-24 Thread electroteque
i dont understand what you mean , anyway, this is a short term situation as
the site is pretty slow and cpu intensive,  the setup is a sun solaris box
running apache 1.3 and php3 , just had a meeting today to push through apahe
2 and php 4.3 ut wont happen for a while , we need a solution in the next
month, we basically need a system that will trawl the site or the latest
news and flatten them so they are less taxing on the server as our last time
cost us dearly , 170,000 hits in one day !
so would flattening to html solve our problem or is the server going to get
hammered anyway ?

Gonzo [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  hi guys we have 2 very high traffic sites and we need
  to be able to make these pages load faster , we are
  coming up with a solution to make flat file versions of
  the sites in the short term before we start using
  caching technologhies is this the right way to go about
  this ?

 I think anyone trying to answer this would need to know
 more about your setup.  Caching is not necessarily the
 answer if a dynamic page is dynamic enough every time to
 be different.  (Please keep this on-list)

  also whats is the best way to parse a php page
  ie foo.php?id=1, foo.php?id=2 with the contents of each
  story to a file and update all the links. maybe with
  naming conventions like foo/1.html, foo/2.html in a mod
  rewrite style

 I like using Variables from URI:

   http://nirvani.org/software/variables_from_uri/

 Gonzo





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



RE: [PHP] creating flat versions of php pages

2003-02-24 Thread Mark Cubitt
Are all the news stories in a database?

If so we are current in devolopment of a simaliar site (although not news),
we are using Perl scripts to build all the HTML pages (both Index's and
Pages) during the evening (4am), it takes about 8 secs to build 2500 pages
and the Perl scripts could be a lot more efficiant, we are using PHP todo
all the admin and stat areas of the site.

Static HTML pages not only increase the speed but they also improve SEO
(Search Engine Optimasion) if handled correctly.

Don't know if this will help you but maybe it is a an idea.

Also i'm sorry if this answer takes this a little off topic.

regards

Mark Cubitt

 -Original Message-
 From: electroteque [mailto:[EMAIL PROTECTED]
 Sent: 24 February 2003 11:13
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] creating flat versions of php pages


 i dont understand what you mean , anyway, this is a short term
 situation as
 the site is pretty slow and cpu intensive,  the setup is a sun solaris box
 running apache 1.3 and php3 , just had a meeting today to push
 through apahe
 2 and php 4.3 ut wont happen for a while , we need a solution in the next
 month, we basically need a system that will trawl the site or the latest
 news and flatten them so they are less taxing on the server as
 our last time
 cost us dearly , 170,000 hits in one day !
 so would flattening to html solve our problem or is the server
 going to get
 hammered anyway ?

 Gonzo [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   hi guys we have 2 very high traffic sites and we need
   to be able to make these pages load faster , we are
   coming up with a solution to make flat file versions of
   the sites in the short term before we start using
   caching technologhies is this the right way to go about
   this ?
 
  I think anyone trying to answer this would need to know
  more about your setup.  Caching is not necessarily the
  answer if a dynamic page is dynamic enough every time to
  be different.  (Please keep this on-list)
 
   also whats is the best way to parse a php page
   ie foo.php?id=1, foo.php?id=2 with the contents of each
   story to a file and update all the links. maybe with
   naming conventions like foo/1.html, foo/2.html in a mod
   rewrite style
 
  I like using Variables from URI:
 
http://nirvani.org/software/variables_from_uri/
 
  Gonzo
 
 



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



 **
 
  This email has been virus checked by the Eclipse Internet
 MAILsafe service
 **
 
  www: http://www.eclipse.net.uk/email:
 [EMAIL PROTECTED]
 **
 




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



Re: [PHP] creating flat versions of php pages

2003-02-24 Thread rush
Electroteque [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 i dont understand what you mean , anyway, this is a short term situation
as
 the site is pretty slow and cpu intensive,  the setup is a sun solaris box
 running apache 1.3 and php3 , just had a meeting today to push through
apahe
 2 and php 4.3 ut wont happen for a while , we need a solution in the next
 month, we basically need a system that will trawl the site or the latest
 news and flatten them so they are less taxing on the server as our last
time
 cost us dearly , 170,000 hits in one day !
 so would flattening to html solve our problem or is the server going to
get
 hammered anyway ?

hmm.. 170.000 a day should not be too much for the dynamic pages, but back
to your original question. It may be a bit rude, but how about using
something like http://webstripper.net/ ? it can save the whole site
including various parameters to the pages. The page names are far from
pretty though :)

rush
--
http://www.templatetamer.com/




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



RE: [PHP] creating flat versions of php pages

2003-02-24 Thread Dan Rossi
sounds close, but the latest stories are going to have to be generated every
hour or so, so what are the functions to do this in php though ? would
fopen,fread and fwrite do the trik ? i need a way to hange the links within
the page all back to html so somehow doing a preg_replace for foo.php?id=1
to foo/1.html , foo/2.html etc

-Original Message-
From: Mark Cubitt [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 10:50 PM
To: electroteque; [EMAIL PROTECTED]
Subject: RE: [PHP] creating flat versions of php pages


Are all the news stories in a database?

If so we are current in devolopment of a simaliar site (although not news),
we are using Perl scripts to build all the HTML pages (both Index's and
Pages) during the evening (4am), it takes about 8 secs to build 2500 pages
and the Perl scripts could be a lot more efficiant, we are using PHP todo
all the admin and stat areas of the site.

Static HTML pages not only increase the speed but they also improve SEO
(Search Engine Optimasion) if handled correctly.

Don't know if this will help you but maybe it is a an idea.

Also i'm sorry if this answer takes this a little off topic.

regards

Mark Cubitt

 -Original Message-
 From: electroteque [mailto:[EMAIL PROTECTED]
 Sent: 24 February 2003 11:13
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] creating flat versions of php pages


 i dont understand what you mean , anyway, this is a short term
 situation as
 the site is pretty slow and cpu intensive,  the setup is a sun solaris box
 running apache 1.3 and php3 , just had a meeting today to push
 through apahe
 2 and php 4.3 ut wont happen for a while , we need a solution in the next
 month, we basically need a system that will trawl the site or the latest
 news and flatten them so they are less taxing on the server as
 our last time
 cost us dearly , 170,000 hits in one day !
 so would flattening to html solve our problem or is the server
 going to get
 hammered anyway ?

 Gonzo [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   hi guys we have 2 very high traffic sites and we need
   to be able to make these pages load faster , we are
   coming up with a solution to make flat file versions of
   the sites in the short term before we start using
   caching technologhies is this the right way to go about
   this ?
 
  I think anyone trying to answer this would need to know
  more about your setup.  Caching is not necessarily the
  answer if a dynamic page is dynamic enough every time to
  be different.  (Please keep this on-list)
 
   also whats is the best way to parse a php page
   ie foo.php?id=1, foo.php?id=2 with the contents of each
   story to a file and update all the links. maybe with
   naming conventions like foo/1.html, foo/2.html in a mod
   rewrite style
 
  I like using Variables from URI:
 
http://nirvani.org/software/variables_from_uri/
 
  Gonzo
 
 



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



 **
 
  This email has been virus checked by the Eclipse Internet
 MAILsafe service
 **
 
  www: http://www.eclipse.net.uk/email:
 [EMAIL PROTECTED]
 **
 






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



RE: [PHP] creating flat versions of php pages

2003-02-24 Thread Dan Rossi
better still , is there a simple way to preg_replace index.php?fooID=1 to
index/1.html from a href link?

-Original Message-
From: Mark Cubitt [mailto:[EMAIL PROTECTED]
Sent: Monday, February 24, 2003 10:50 PM
To: electroteque; [EMAIL PROTECTED]
Subject: RE: [PHP] creating flat versions of php pages


Are all the news stories in a database?

If so we are current in devolopment of a simaliar site (although not news),
we are using Perl scripts to build all the HTML pages (both Index's and
Pages) during the evening (4am), it takes about 8 secs to build 2500 pages
and the Perl scripts could be a lot more efficiant, we are using PHP todo
all the admin and stat areas of the site.

Static HTML pages not only increase the speed but they also improve SEO
(Search Engine Optimasion) if handled correctly.

Don't know if this will help you but maybe it is a an idea.

Also i'm sorry if this answer takes this a little off topic.

regards

Mark Cubitt

 -Original Message-
 From: electroteque [mailto:[EMAIL PROTECTED]
 Sent: 24 February 2003 11:13
 To: [EMAIL PROTECTED]
 Subject: Re: [PHP] creating flat versions of php pages


 i dont understand what you mean , anyway, this is a short term
 situation as
 the site is pretty slow and cpu intensive,  the setup is a sun solaris box
 running apache 1.3 and php3 , just had a meeting today to push
 through apahe
 2 and php 4.3 ut wont happen for a while , we need a solution in the next
 month, we basically need a system that will trawl the site or the latest
 news and flatten them so they are less taxing on the server as
 our last time
 cost us dearly , 170,000 hits in one day !
 so would flattening to html solve our problem or is the server
 going to get
 hammered anyway ?

 Gonzo [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
   hi guys we have 2 very high traffic sites and we need
   to be able to make these pages load faster , we are
   coming up with a solution to make flat file versions of
   the sites in the short term before we start using
   caching technologhies is this the right way to go about
   this ?
 
  I think anyone trying to answer this would need to know
  more about your setup.  Caching is not necessarily the
  answer if a dynamic page is dynamic enough every time to
  be different.  (Please keep this on-list)
 
   also whats is the best way to parse a php page
   ie foo.php?id=1, foo.php?id=2 with the contents of each
   story to a file and update all the links. maybe with
   naming conventions like foo/1.html, foo/2.html in a mod
   rewrite style
 
  I like using Variables from URI:
 
http://nirvani.org/software/variables_from_uri/
 
  Gonzo
 
 



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



 **
 
  This email has been virus checked by the Eclipse Internet
 MAILsafe service
 **
 
  www: http://www.eclipse.net.uk/email:
 [EMAIL PROTECTED]
 **
 






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