Login    Forum    Register    Search    FAQ

Board index » HELP AND ADVICE » G33K'S CORNER




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: apache + website
 Post Posted: Mon Apr 13, 2009 12:36 am 
Offline
that was a stupid comment btw
User avatar

Joined: Wed Mar 03, 2004 12:40 pm
Posts: 109345
Location: manchester
i have 4500 + webpages i need to change
there all static. i need to add 2 small peaces of php code
3000 pages the header is the same so i could make a small script
the footer line injection is diff on every page as a line count but the injecton code is always the same
rather than get all complex with a loop script - injction points alwaty the same
ie - header is
</div></div></div></div><div id="top_nav">

id like to have a easy way to make apache render the code as
</div></div></div></div><?php slappy.php?><div id="top_nav">

ony every page off that virtual host- now how do i do itmod proxy / layout / php sed ? or load it all in sql and inset on the select ? any ideas welcome as i recon a pure sed scrip on whole site - 4500 + pages = lots of room for error - any ideas ?

_________________
Image
Image


Top 
 Profile  
 
 Post subject: Re: apache + website
 Post Posted: Mon Apr 13, 2009 1:28 pm 
Offline
Bow down to the master
User avatar

Joined: Mon Oct 01, 2007 6:38 pm
Posts: 2499
Location: Between .local and dev:null :D
Maybe by hand? :P :lol:

Can't you tell the script to look for a plan a, b or c in the loop?
For example, if a page doesn't have "plan a" in the footer, then search for "plan b". If not, search for "plan c", etc....
When I mean "plan a", a known piece of code in most of the pages. Unless you would end up with a million DIFFERENT cases :shock:

_________________
Image
My work blog | My Flickr | Complaints form | Get Image


Top 
 Profile  
 
 Post subject: Re: apache + website
 Post Posted: Mon Apr 13, 2009 11:05 pm 
Offline
Decidedly uninterested
User avatar

Joined: Thu Mar 18, 2004 11:10 pm
Posts: 10184
Location: I watch you while you sleep
Try writing a simple script that finds the first instance of '</div></div></div></div><div id="top_nav">' on a page and then replaces it? You could run it as a find first that outputs the amended text to a log file for checking before you commit, I suppose? :geek:

_________________
Image
The Pancreas of S.T.F.U. | Never take life too seriously - nobody gets out alive anyway.
Disco_jim: um..... I have no excuse. | Chips: Thank the Beef | Rev Dr: Beef, I think i wee'd a little


Top 
 Profile  
 
 Post subject: Re: apache + website
 Post Posted: Tue Apr 14, 2009 10:48 am 
Offline
that was a stupid comment btw
User avatar

Joined: Wed Mar 03, 2004 12:40 pm
Posts: 109345
Location: manchester
well sed does what i want and iv got it working but im having trouble with it interpreting spaces and some eliments of html code ie > atm so progress has been made
id rather just have a small apache module tbh :)

_________________
Image
Image


Top 
 Profile  
 
 Post subject: Re: apache + website
 Post Posted: Sun Apr 26, 2009 12:50 am 
Offline
a norweigen silly curtain loving bitch
User avatar

Joined: Thu Mar 04, 2004 1:35 pm
Posts: 4977
Location: Kath
jesus rick. such a noob

_________________
Image
UBER Admin
Follow it is I teh Diabetes man on TWITTER
http://twitter.com/tehdiabetesman


Top 
 Profile  
 
 Post subject: Re: apache + website
 Post Posted: Sun Apr 26, 2009 9:13 am 
Offline
Decidedly uninterested
User avatar

Joined: Thu Mar 18, 2004 11:10 pm
Posts: 10184
Location: I watch you while you sleep
Did you sort it out in the end Rick? :scratch:

_________________
Image
The Pancreas of S.T.F.U. | Never take life too seriously - nobody gets out alive anyway.
Disco_jim: um..... I have no excuse. | Chips: Thank the Beef | Rev Dr: Beef, I think i wee'd a little


Top 
 Profile  
 
 Post subject: Re: apache + website
 Post Posted: Sun Apr 26, 2009 10:19 am 
Offline
Saints ftw!!
User avatar

Joined: Fri Apr 23, 2004 6:22 pm
Posts: 7877
Location: /dev/null
wowyouareacow=GCHQ= wrote:
jesus rick. such a noob



hahahahah :grin:

_________________
Insert unfunny comment here ->


Top 
 Profile  
 
 Post subject: Re: apache + website
 Post Posted: Sun Apr 26, 2009 1:34 pm 
Offline
that was a stupid comment btw
User avatar

Joined: Wed Mar 03, 2004 12:40 pm
Posts: 109345
Location: manchester
Quote:
Did you sort it out in the end Rick? :scratch:

yeah - perl ftw :thumbl:

_________________
Image
Image


Top 
 Profile  
 
Display posts from previous:  Sort by  
 
Post new topic Reply to topic  [ 8 posts ] 

Board index » HELP AND ADVICE » G33K'S CORNER


Who is online

Users browsing this forum: No registered users and 6 guests

 
 

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
  • Shoutbox
  • Shout Message


test
cron