Web Design Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsWeb DesignWeb Design Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old October 17th, 2004, 02:37 AM
LukeLHD LukeLHD is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 130 LukeLHD User rank is Private First Class (20 - 50 Reputation Level)LukeLHD User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 13 h 55 m 2 sec
Reputation Power: 5
Send a message via AIM to LukeLHD
Changing one word in a html file..

Hi

I was working a website for someone, and now i've found that all I need to do to change the web page is to change a link in my html code.
What i've done it like so:
Code:
	<div id="innercontent">
		<script language="javascript" type="text/javascript" src="about.txt"></script>
	</div>

and that "about.txt" loads in the needed code, and is all I need to change when a user clicks on a link. Is this possible to make this change dynamically? Maybe with a small external calculation file? maybe using javascript, asp, html, css, php? Anything really.
In pseudo code, what I need to do is:
Code:
(when user clicks on link):
'link'.txt

simple as that really. Maybe the calculation can be done in an external php file or something? I only know basic javascript, and html and css, so I don't really know if it's possible to do another way.

Anything will do, just so long as it's easier than making an exact html page with simply that word changed for each link.

Many thanks,
-Luke

Reply With Quote
  #2  
Old October 17th, 2004, 01:31 PM
tony84 tony84 is offline
tony
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2004
Location: manchester uk
Posts: 670 tony84 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 11 m 38 sec
Reputation Power: 5
Send a message via AIM to tony84 Send a message via MSN to tony84
php include?

ive used that on my site for the links internal and external
__________________
Free Forum hosting for clans

Reply With Quote
  #3  
Old October 17th, 2004, 02:26 PM
LukeLHD LukeLHD is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 130 LukeLHD User rank is Private First Class (20 - 50 Reputation Level)LukeLHD User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 13 h 55 m 2 sec
Reputation Power: 5
Send a message via AIM to LukeLHD
Quote:
Originally Posted by tony84
php include?

ive used that on my site for the links internal and external

Thanks for the reply.
Can you possibly offer a way of how I might implement the code? Can I put php code inside the html file, in a similar way to javascript?

Thanks,
-Luke

Reply With Quote
  #4  
Old October 17th, 2004, 02:30 PM
tony84 tony84 is offline
tony
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2004
Location: manchester uk
Posts: 670 tony84 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 11 m 38 sec
Reputation Power: 5
Send a message via AIM to tony84 Send a message via MSN to tony84
<?php include('page.php'); ?>

type that where you want the include file

your page also needs to be php ie saved as php with
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?> at the very top of the page

and your page.php should look like this
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
text to be displayed here

</body>
</html>

Reply With Quote
  #5  
Old October 17th, 2004, 02:54 PM
LukeLHD LukeLHD is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2003
Posts: 130 LukeLHD User rank is Private First Class (20 - 50 Reputation Level)LukeLHD User rank is Private First Class (20 - 50 Reputation Level) 
Time spent in forums: 13 h 55 m 2 sec
Reputation Power: 5
Send a message via AIM to LukeLHD
Brilliant, thanks mate!

But I still have a couple more queries...

So firstly, i'm right in thinking i've changed my index page to php now, right? And it's got html and php code inside?

OK, so is it possible to link to a certain external page depending on what link a user clicks on?

For example: "if user clicks on home button then the external text file to load in is 'home.txt'." Could you possibly offer a minute or two to give me a simple method of doing this? I'd be extremely grateful.

My best assumption would be to use a variable, and whichever link the user clicks on is what the variable changes to, then I simple put "variable.text" to load in.
I already know how to load in, so it's simply a matter of the part for reading what the user clicks on, and making that a variable.

Thanks a lot,
-Luke

Reply With Quote
  #6  
Old October 17th, 2004, 03:12 PM
tony84 tony84 is offline
tony
Dev Shed Novice (500 - 999 posts)
 
Join Date: Apr 2004
Location: manchester uk
Posts: 670 tony84 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 Day 13 h 11 m 38 sec
Reputation Power: 5
Send a message via AIM to tony84 Send a message via MSN to tony84
<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"; ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>

<body>
<a href="http://www.website.com/home.txt">text here</a>

</body>
</html>

have that as the file that will be in the include tag

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignWeb Design Help > Changing one word in a html file..


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway