Server Parased Include

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Server Parased Include

Post by tecktalkcm0391 »

Is there anyway that I could make something to upload to a server that would go on every page and add some HTML right before the </body> tag. (Without Using any PHP)
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Well, server side includes usually entail renaming the file .shtml. If file extensions / user permissions to execute PHP are what you're worried about, you could always setup mod_rewrite to redirect all requests to a PHP file that would retrieve the static file and add the PHP tag.
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Server Parased Include

Post by RobertGonzalez »

tecktalkcm0391 wrote:Is there anyway that I could make something to upload to a server that would go on every page and add some HTML right before the </body> tag. (Without Using any PHP)
You are trying to do this dynamically, I presume?
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Post by tecktalkcm0391 »

Yeah, Like if you get a free account on 150m.com you get adds added to your page automatically right after the <body> tag
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

Yeah, I think mod_rewrite is the way to go.
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Post by tecktalkcm0391 »

Can someone please tell me how to do that, cause I get so lost with mod_rewrite... does anyone know of a "Mod_Rewrite for Dummies" site?...lol
User avatar
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Post by Ambush Commander »

I'm sure a Google would lead you to the resource you desire.

http://www.google.com/search?q=mod%20rewrite
User avatar
tecktalkcm0391
DevNet Resident
Posts: 1030
Joined: Fri May 26, 2006 9:25 am
Location: Florida

Post by tecktalkcm0391 »

Google. Its not helping at this moment. Anybody?
User avatar
n00b Saibot
DevNet Resident
Posts: 1452
Joined: Fri Dec 24, 2004 2:59 am
Location: Lucknow, UP, India
Contact:

Post by n00b Saibot »

User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Re: Server Parased Include

Post by RobertGonzalez »

tecktalkcm0391 wrote:Is there anyway that I could make something to upload to a server that would go on every page and add some HTML right before the </body> tag. (Without Using any PHP)
Ok, let me wrap my mind around this. You want to take an HTML page that is on the server, open it and add some code just before the </body> tag, and you want to do it without using PHP? How about Perl? What are you trying to accomplish with this and why? That might help us better help you.
User avatar
jayshields
DevNet Resident
Posts: 1912
Joined: Mon Aug 22, 2005 12:11 pm
Location: Leeds/Manchester, England

Post by jayshields »

He is wanting to have every webpage on his server have some extra HTML code in it in a specific place. The extra HTML code and specific place will be the same across all files.

The files will not be modified, but the HTML will be modified on the fly when the user is viewing a webpage.

If a HTML file on the server contained this:

Code: Select all

<html>
<head><title>something</title></head>
<body>something</body>
</html>
When viewed it would look like this:

Code: Select all

<html>
<head><title>something</title></head>
<body>something{WHATEVER EXTRA STUFF HERE}</body>
</html>
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

There's always auto_prepend_file and its sibling.
Post Reply