Changing Include Tag On All Pages

Pages: 1, 2
free web hosting

Read Latest Entries..: (Post #11) by littleweseth on Sep 9 2005, 05:23 AM. (Line Breaks Removed)
If you're on a mac box, bbedit is the answer to every text based problem (well the ones that you couldn't be bothered learning PERL for, anyway). Unfortunately, you problably aren't on a mac.My personal favourite is SciTE on win/linux. CrimsonEdit is good too, but really it's just a KATE imitation. I'm not sure if either of these do multiple-file search and replace, though, and... read more.
Read the FIRST post of this Topic. - Express your Opinion! Contribute Knowledge :-).

Free Web Hosting, No Ads > CONTRIBUTE > Computers > Programming Languages > PHP Programming

Changing Include Tag On All Pages

Amezis
I want to change an include tag (include menu.htm) to include menu.php on all my pages on my website. Is there any fast way to do this, or do I have to edit all of my pages manually?
unsure.gif

Reply

kasm
QUOTE(Amezis @ Aug 19 2005, 06:08 AM)
I want to change an include tag (include menu.htm) to include menu.php on all my pages on my website. Is there any fast way to do this, or do I have to edit all of my pages manually?
unsure.gif
*


I don't think there is method to change it at once. You have to change htm to php in every page yhat u uses menu.

Reply

HmmZ
impossible

You will have to do it manually sad.gif

Reply

Amezis
Ok... I think I'll change everything that is included then... like the footer etc, maybe i'll need to have it in PHP later... Thanks for the info anyway...

Reply

Hamtaro
Well, if you are wanting menu.htm to function as a PHP script (without manually changing everything), you could add this to .htaccess:

CODE
AddType application/x-httpd-php .htm


That way you don't have to change everything that references it to menu.php (as that can get tiring if you have many files). Hope that helped you.

Reply

Amezis
Umm I think i'll change everything anyway... But thank you anyway.

Reply

Lozbo
Come on guys! Im really surprised! Does not any one know the "Find and Replace" function? (and dont tell me you dont use dreamweaver). Macromedia Dreamweaver has a very very powerful function, beyond what it looks. You can search and entire site for finding and replacing items, a whole folder.

When you click control + find and open up your "Find and Replace" dialog box, you have a section called "find in:" where you can select from various destinations, including: "current document", "selected text", "open documents" (last one depending on the version i think), and: "folder... (browse)" (among others).

Here you select the folder which you want to search. Then you have the "search" section which you set to "code" (it also has the value for searching "text" in the document(s), only text but no html nor other kind of code, and "specific tag", which can for example, remove desired atributes from any given tag).

Then you have the "find" text box, where you type what you want to replace, example "<?php include ("menu.htm"); ?>" and the "replace" text box, which you could set to: ""<?php include ("menu.php"); ?>".

Yes, some times dreamweaver does more that what you want with your code, it leaves garbage in it, but in cases like this, it could save you a looooooooooot of work smile.gif

 

 

 


Reply

arboc7
I was going to say, if you have Dreamweaver, use find and replace. But if you don't...well, notepad has one, but you can't edit multiple files at once, so I don't know how else to help you...Sorry!

Reply

Tyssen
QUOTE(arboc7 @ Sep 8 2005, 12:23 PM)
I was going to say, if you have Dreamweaver, use find and replace. But if you don't...well, notepad has one, but you can't edit multiple files at once, so I don't know how else to help you...Sorry!

There are plenty of text-based HTML editors that do allow multiple file search and replace though. Get yourself one and it'll be done in a second.

Reply

Lozbo
QUOTE(Tyssen @ Sep 7 2005, 08:49 PM)
There are plenty of text-based HTML editors that do allow multiple file search and replace though. Get yourself one and it'll be done in a second.
*


Ive used Crimson Editor, the only editor i know. And as i dont have it installed right now on this machine i couldnt say if it can search multiple files, but i believe it can. And its freeware! But its only for windows i think. Could you point out more of those editors?

Reply

Latest Entries

littleweseth
If you're on a mac box, bbedit is the answer to every text based problem (well the ones that you couldn't be bothered learning PERL for, anyway). Unfortunately, you problably aren't on a mac.

My personal favourite is SciTE on win/linux. CrimsonEdit is good too, but really it's just a KATE imitation. I'm not sure if either of these do multiple-file search and replace, though, and I can't check (short of installing X11 on this mac and then SciTE, but i'm feeling lazy right now).

Of course, if you felt like using PHP for this job, you could do something like
a) read all filenames into an array, using opendir, readdir, et. al.
cool.gif open each file sequentially, reading contents into string - say $StringWithTheFileInIt = file_get_contents ($filename) or something.
c) do $new_string = preg_replace ("/include\s+?(\s+?'menu.htm'\s+?);/i", "/include ('menu.php');/", $StringWithTheFileInIt);. That scary-lookin thing just looks through $StringWithTheFileInIt, and replaces the old text with the new. The \s+? are to allow for any whitespace you may or may not have put in.
d) overwrite the old file with the contents of $new_string, using fopen ( $filename, 'w' ).
e) rinse, lather, repeat until done.

Since you're using menu.php, i'm assuming that you know what most of that means :| If you do do this - i recommend you back up your stuff first in case you make a mistake and things go horribly wrong. I know the true pain of accidentally overwriting 10mb of text files with the string 'hello world'...... not cool.

Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Pages: 1, 2
Similar Topics

Keywords : changing, include, tag, pages

  1. Create Dynamic Html/php Pages Using Simple Vb.net Code
    Taking your application data, and creating a webpage for others to vie (1)
  2. Changing Hosts?
    (1)
    I have a qupis account with an alpha package And... I found this new hosting site 000webhost And was
    wondering How do I cancel my qupis hosting and change to it....
  3. Question About Changing Domain Names.
    (8)
    Hey guys how's it going! I just had a quick question about changing domain names. My domain
    now is fearclan.trap17.com, and I wanted to change it to fearclan.org. How should I do it? Do I use
    the credit system and it will give me my own domain for free? Or do I have to buy a domain name from
    godaddy or something and then change it? I really need an answer for this as soon as possible.
    Thank you so much guys! /laugh.gif" style="vertical-align:middle" emoid=":lol:" border="0"
    alt="laugh.gif" />....
  4. The Worst Experience In My Life Yesterday
    life changing (1)
    i was with one of my friends. we went to a roller rink. it was around 9:00 pm she was giving 6
    people rides home so theres 8 people in the van. i new 1 out of the 6 people. she new them all.
    1guy5girls me and my friend Kaitlyn. one of the girls in the middle row sed "lets ride on the bumper
    agen" i didn't no what they rely where going to go. we pulled to a back road and 2 of the girls
    got out and got on the back bumper and held on to the top railing. 3 people including me where
    telling them this is not a good idea they sed " don't worry we did this before" we dr....
  5. Changing Root Script
    (0)
    I decided to go with paid hosting with computinghost.com. When I chose my initial installation, in
    my ignorance, I didn't know you couldn't install both the Joomla installation and the
    Soholaunch website builder, so I checked both. They installed the Joomla and not the Soho. Since I
    have never looked at Joomla and know nothing about using it, I would like the other installation. I
    first tried live chat, but they said contact sales. So I sent an email and got a ticket number.
    BPM-881376 When I try to check on the status I get this message: Fatal error: ERROR: You ....
  6. Simple Javascript And Password System
    How to protect your pages with password (6)
    The quickest way to get a password protection system up and running is to use a Prompt box in
    JavaScript that has a title like "Enter your Email Address". Only you and the relevant users know
    what the password should be, could even be one each, that can be sorted out at the next page then
    pass the "input" directly through the url by changing the .href, like
    http://www.iSource.net.nz/users/?leTmeIn= The page that then processes this should also check for
    the referring page, and three fails from an IP if you like the php (the next page): CODE
    <?php // processdo....
  7. Php Allow Url Include Question!
    Need an admin to clarify something... (10)
    Hi, i've just signed up to your hosting over the last few days, and its been very fustrating
    that you don't allow the directive: allow_url_include. Do you think that there could be anyway
    that you could turn it on? i've installed a login and hit counter script and i had to edit half
    of it. I also want to 'include' my page list on all of my pages, to make it easier to
    update them, but the only way i would be able to do this is upload a page list to every directory,
    which defeates the purpose. And i can't use SSI because i can't use PHP with ....
  8. Changing From Free Hosted To Paid Hosted [resolved]
    How dows it affect my account (3)
    I recently purchased a paid hosting account and since I was a previous trap 17 free hosted account
    user I wanted to knwo what will the changes be and and how will i see the upgrade on my account.
    Will the server completely change from the gamma server that im currently on to the delta server or
    will it remain the same. Also I did purchase 3S. Thanks......
  9. How Do I Change The Default Windows Font Size?
    Without changing DPI, of course. (3)
    I know there's an option in Ubuntu to change all the font sizes of the general system, the
    windows, and etc. Now I'm trying to do this in Windows. I've changed everything about
    the windows except for the general system size. How do I do this?....
  10. Pagination
    ? (3)
    People they create the databases in which like the news stories are placed. Then that news stories,
    they are placed on certain page to be displayed and readable by other users on the web-site. How
    people do that thing paging, like you can see bottom, whenever, you go to Any CMS engines. Need the
    concept how you can create, 1, 2 or 3 pages, then next and back buttons, last and beginning page.....
  11. Protect Pages
    HOW? (20)
    I create certain pages for my web-site, and I would like to protect them that no one can hack or see
    their source codes. So, if everybody knows how to do it, please post a reply over here. List of
    the best ways, I can do it. Thanks.....
  12. Changing Trap17 Domain?
    (2)
    Hello. I think I've heard about this somewhere or another on this site, but am not sure.
    Currently, my domain is http://sherwoodinfo.trap17.com ...is there any way I can get it changed to
    http://sherwood.trap17.com , I checked and it seems that is available. Thank you!!....
  13. Php--> Content-only Pages
    Create easy to edit php pages. (9)
    Description Learn to create easy to edit content-only pages with php. By parsing your layout into
    your pages, you can reduce file sizes and files will become much neater. Try it out Ok, lets
    start by creating a file called template.php. CODE <?php
    //--------------------------------- //Layout top section //---------------------------------
    $top = <<< html <!-- include HTML header code here --> <body>
    INSERT CODE FOR [b]TOP[/b] OF LAYOUT HERE. html;
    //--------------------------------- //Layout bottom sec....
  14. Php - Forms, Date And Include
    Working with POST and GET and also the Date() function (0)
    /--------PHP FORMS, DATE AND INCLUDE TUTORIAL BY FLASHY--------\ Hi and welcome to my
    tutorial. I will show you how to make simple PHP forms with the POST and GET statements. I will
    also show show you the Date() function too, aswell as the include() function. OK, so first you need
    a good understanding of HTML, and you need to create your form using that. So lets start off with
    the HTML form. 1. Create a page called form.html. 2. Insert your standard tags like: CODE
    <html> <head> <title>Working with php forms.</title> </he....
  15. Some Pages On My Site Won't Even Load..
    (6)
    Ever since today, my site has been working just fine. I'm maintaining the amount of points I
    need, and the server status has been and still is fine. However, a while ago I tried to access my
    site and it wasn't loading. When I loaded the root URL, it worked fine though. I went to the
    file manager and noticed that the file I was trying to previously access was .php, and the index
    file at my root URL was .html. I deleted the index.html file and made a index.php file, then tried
    loading it again. Safari gave me the following message: QUOTE Safari can’t ope....
  16. Site Error For Php Pages
    Needs to Be Fixed Immediately (6)
    My site has been using Qupis for over a month now, and a few of my pages are php files. My site has
    been operating properly until today. My html pages are working properly, but all of my php pages
    are giving me the following errors. QUOTE Warning: Unknown: open_basedir restriction in effect.
    File(/home/disneyre/public_html/info.php) is not within the allowed path(s): (1) in Unknown on line
    0 Warning: Unknown: failed to open stream: Operation not permitted in Unknown on line 0 Fatal
    error: Unknown: Failed opening required '/home/disneyre/public_html/info.php&....
  17. What Is Fun Anymore?
    Changing the definition of 'fun' (5)
    Child comes home, flips on the flips on the tv. Toasts the waffle, spreads the peanut butter with a
    grim face. Ready for some 'fun.' But this isn't the fun that you and I know and have
    come to love. I remember when fun used to be playing in the park, building a castle out of my
    sister's leftover girl scout cookie boxes. But not anymore, that is boring, a waste of time. I
    remember when being creative was fun thing to do. Why is it, that when a child of today is
    asked whether they would like to game, they remark, 'Sure, what site?'....
  18. Changing Dns Records
    How to change my DNS records? (5)
    I need to change my DNS records, that is, to add several CNAME records... Now, I registered my top
    level domain (.net) through my ISP, and they in turn registered my domain at some other registrar...
    Now, my ISP doesn't give me CPanel to update my DNS info, if I don't buy their hosting plan
    (which is pathetic compared to Trap17 free account)... I had them change my nameservers to Trap17
    servers, and now, they tell me I need to edit CNAME records on Trap17 nameservers... I must admit
    I'm not really familiar with how all that DNS administration works, so I want....
  19. Harry Potter: The Deathly Hallows
    WARNING: MAY INCLUDE SPOILERS! ONLY READ IF YOU HAVE READ THE WHOL (18)
    I was wondering, can this be a discussion for the seventh and final book of the Harry Potter
    series? Because I really want to talk about it. Great book! Do you think that the ending is a
    bit.. predictable? I mean, it was kind of obvious (to me) that Hermione and Ron would
    eventually.. Marry each other? As with Harry and Ginny. But I like Harry's kid the best, the one
    that looks like him. Albus Severus, right? Or was it Albus Snape? Hmm.. I remember it was Albus
    _______.. ....
  20. Problem With Firefox, Latest Version, Not Loading Pages
    any ideas? (4)
    Hi all Ive had this problem for a little while now, i cant say exactly when but it started with
    sites such as youtube and has spread out from there really, the biggest culprits are youtube and
    myspace. The issue is that if i was on youtube and wanted to watch a video i would obviously click
    the link, firefox would then show the loading bar and my page loading timer would start but it would
    never actually begin loading, the status bar would say "loading" or if i clicked the link again it
    would show "stopped" yet the loading bar would be there. Needless to say the loadin....
  21. Changing The Windows Xp Splash Screen
    another quick tutorial (10)
    First make create 16 bit 640*480 image and save it as boot.bmp in 'c:\windows'
    directory Click Start|Run and type c:\boot.ini. The file opens in Notepad. Look for an entry
    similar to this. CODE
    "multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft
    Windows XP Professional" /noexecute=optin /fastdetect" Add /noguiboot /bootlogo at the
    end of the line so that it looks like this. CODE
    "multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft
    ....
  22. Dynamic Php Pages
    Nice tutorial (5)
    This is a really good tutorial on making php pages that normally appear as
    www.domainname.com/links.php appear as www.domainname.com/index.php?page=links
    http://nuwen.com/tutorials/php-dynamic-pages ....
  23. Changing Legal Age For Driving
    (43)
    Now this is a good debate I think as it's something I'm not happy with as I have haven't
    passed yet. I first started having driving lesson at 17 and I didn't fully understand that I
    would have to take quite a few as I have learning disabilities and I quit them. As for my brother
    he has been taking them for a couple of months now bu the thing that has pissed him off quite a bit
    is that they are supposedly chnaging the age of when a newbie can learn how to drive and that will
    include even when they have passed. They are supposed to be poutting the age of ....
  24. How To: Make A Simple Php Site
    Making one file show up on all pages using php (21)
    I have looked all over the site and could not find anything that was like this simple, or just like
    this at all.. For some people i know that you are using a basic HTML site...and having a big menu
    if you want to add somthing you have to go into every one of the pages and add or remove or edit
    what you want to do, but with somthing verry simple all you would have to do is edit one file, and
    all of the pages that have the PHP script on them would suddenly change to what that one file is.
    So to start off if you are planning on using this little tirck, the page that you a....
  25. Include File.php?id=something
    using the include() function (13)
    Well, I am making a full CMS system for my site, and want to make the index.php file to include the
    view.php?id=1 file. I tried with this code, but it didn't work: CODE <?php include
    'view.php?id=1' ?> This is the error I get: CODE Warning:
    main(view.php?id=1) [function.main]: failed to open stream: Invalid argument
    in C:\server\xampp\htdocs\test\index.php on line 1 Warning:
    main() [function.include]: Failed opening 'view.php?id=1' for inclusion
    (i....
  26. Changing Background Color In Php
    usefull for templating. (5)
    Tutorial on how to change background color with PHP I will be descibing to similiar ways that
    you can change the background color of your website with php and leave it at that till the user
    changes it again. We are going to do this with CSS. You can either have your cSS info on your page
    or in a spereate document. The first thing youll have to do is decide if your going for the linked
    stylesheet or directly on your page. IF you link it you'll need to have this code in you
    tags. CODE <style type="text/css"> <?php include ("st....
  27. Changing A Gmail Password
    how do u do it? (10)
    hi i have a gmail account well a couple of them and i know that someone has been getting on my
    account and screwing with it however i dont know how im supposed to get on and change my password.
    i've tried even getting them to send me information and what not when i forget my password but
    all the same i can never get to a point where i can change it and it kinda is making me upset. my ex
    gets on my account and yells at my friends telling them that i've changed and that i dont want
    anything to do with them and thats wrong i love my friends. anywayz if you know how ....
  28. Php Include Root Ref
    whats the root? (6)
    Every one knows that we can include files in our site, so we have a folder with 2 files, an
    index.php with a menu.php included. But they are on the same folder, what if we wanted to make a
    relative reference for it, so we will always put include("/files/menu.php") and it will always work
    wherever that file is (the file calling the include). Ive had troubles with this, as it doesnt seem
    to be working, i have to change to the dot notation (like ../../../../../files/menu.php) in order to
    keep my includes right. Does any one know what the root is for the include or how can ....
  29. Test Your Php Pages W/o Upload/internet
    complete *working* guide on how to test your php pages (57)
    In this tutorial, I'm going to show you how to test your PHP pages without the Internet or
    uploading the files to your trap17 server. This tutorial is similar to doom's, but the links he
    provided does not work, so I decided to make my own tutorial with working links. The program that I
    will be using for this tutorial is called XAMPP . XAMPP is a modification of the popular Apache
    server, and I'm using XAMPP because of its simplicity to install as well as maintain. The
    current version of XAMPP is 1.4.13 and it has the following bundled in the download: QUOT....
  30. Changing A Dynamic Ip
    How to change your dynamic IP. (18)
    In this tutorial I will tell you how to change a dynamic IP if you have Windows XP. First of all go
    to - Start >> Run - and type 'cmd'. A window with a black background and grey text. In
    this window type 'ipconfig' and text should come up saying: IP Address ............. *IP
    HERE* Subnet Mask ................ *SUBNET MASK HERE* Default Gateway .......... *DEFAULT GATEWAY*
    Write this down on a bit of paper on in notepad. You will need them later. Now type
    'ipconfig/release' - this will terminate your internet connection - but don't g....

    1. Looking for changing, include, tag, pages

Searching Video's for changing, include, tag, pages
Similar
Create
Dynamic
Html/php
Pages Using
Simple
Vb.net Code
- Taking
your
application
data, and
creating a
webpage for
others to
vie
Changing
Hosts?
Question
About
Changing
Domain
Names.
The Worst
Experience
In My Life
Yesterday -
life
changing
Changing
Root Script
Simple
Javascript
And Password
System - How
to protect
your pages
with
password
Php Allow
Url Include
Question!
; - Need an
admin to
clarify
something...
Changing
From Free
Hosted To
Paid Hosted
[resolved] -
How dows it
affect my
account
How Do I
Change The
Default
Windows Font
Size? -
Without
changing
DPI, of
course.
Pagination -
?
Protect
Pages - HOW?
Changing
Trap17
Domain?
Php-->
Content-only
Pages -
Create easy
to edit php
pages.
Php - Forms,
Date And
Include -
Working with
POST and GET
and also the
Date()
function
Some Pages
On My Site
Won't
Even Load..
Site Error
For Php
Pages -
Needs to Be
Fixed
Immediately
What Is Fun
Anymore? -
Changing the
definition
of
'fun'
;
Changing Dns
Records -
How to
change my
DNS records?
Harry
Potter: The
Deathly
Hallows -
WARNING: MAY
INCLUDE
SPOILERS!
; ONLY READ
IF YOU HAVE
READ THE
WHOL
Problem With
Firefox,
Latest
Version, Not
Loading
Pages - any
ideas?
Changing The
Windows Xp
Splash
Screen -
another
quick
tutorial
Dynamic Php
Pages - Nice
tutorial
Changing
Legal Age
For Driving
How To: Make
A Simple Php
Site -
Making one
file show up
on all pages
using php
Include
File.php?id=
something -
using the
include()
function
Changing
Background
Color In Php
- usefull
for
templating.
Changing A
Gmail
Password -
how do u do
it?
Php Include
Root Ref -
whats the
root?
Test Your
Php Pages
W/o
Upload/inter
net -
complete
*working*
guide on how
to test your
php pages
Changing A
Dynamic Ip -
How to
change your
dynamic IP.
advertisement



Changing Include Tag On All Pages



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE