473,399 Members | 3,302 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Change HTML page before it is being sent to the client

Hi,

This is probably a basic question.

I need to change all the web pages before they are being sent to the client.
I'm using a CMS(drupal) but I don't want to tuch it. I want to put some filter or something on top of it and for example replace all the <div> tags with <span> tags.

How can I do that?

Thanks
Jan 19 '08 #1
3 1310
stepterr
157 100+
Hi,

This is probably a basic question.

I need to change all the web pages before they are being sent to the client.
I'm using a CMS(drupal) but I don't want to tuch it. I want to put some filter or something on top of it and for example replace all the <div> tags with <span> tags.

How can I do that?

Thanks
I've never used Drupal but you could use some other editor such as Textpad to do a replace all for a specfic word(s) in your current document or on all files in a folder.
Jan 20 '08 #2
Markus
6,050 Expert 4TB
You could use a simple preg_replace()

[php]
<?php
$__string = "<div>hello world, how's it going?";
$__newString = preg_replace("/<div/", "<span", $__string);
echo $__newString;
?>
[/php]
Jan 20 '08 #3
I want to replace the code dynamically and automatically on the server side without touching the original code.

Drupal is just an example of a working CMS which I don't want to change only replace all the div tags with span tags.

I can't change the pages by hand because they are created dynamically.

My question is, can I put some code on top of everything to do the job?
Can I put some kind of filter that all the pages will go through before being sent to the client.

Thanks.
Jan 20 '08 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ramesh | last post by:
hi, I have some basic questions. Can anybody explain me the following doubt: 1. In my asp page, right click and selected HTML source code. Added following method. <script...
2
by: Hazzard | last post by:
I just realized that the code I inherited is using all asp.net server controls (ie. webform controls) and when I try to update textboxes on the client side, I lose the new value of the textbox when...
3
by: mca | last post by:
Hi everyone, I'm new to asp.net and i have a question about separating the html code from the programming code. i have an unknown numbers of entries in my table. I want to make a hyperlink...
3
by: Rahul Agarwal | last post by:
Hi In our web page we use a combination of HTML and server side controls and some of them have a custom attribute based on which we need to find and replace the values once the HTML is ready. ...
5
by: LP | last post by:
Hi, After html of .aspx page has been generated, but before it has been sent to a client, I want to interecept it, and slightly modify it. I can't find anyway to get html of a page. How can I do...
1
by: J. Shane Kunkle | last post by:
A customer would like to redirect visitors to a "goodbye" page when they click on an outside link on their website. The website is quite large and I would rather not wade thru all the existing...
13
by: =?Utf-8?B?S2VzdGZpZWxk?= | last post by:
Hi Our company has a .Net web service that, when called via asp.net web pages across our network works 100%! The problem is that when we try and call the web service from a remote machine, one...
8
by: Darrel | last post by:
I'm helping convert a 300+ page .html site into an ASP.net site. The client wants to set up 301 redirects for all of the old html pages. I've used ISAPI for this type of thing in the past, as it...
10
by: happyse27 | last post by:
Hi All, I got this apache errors(see section A1 and A2 below) when I used a html(see section b below) to activate acctman.pl(see section c below). Section D below is part of the configuration...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.