Current location: Hot Scripts Forums » General Web Coding » HTML/XHTML/XML » newbie HTML question


newbie HTML question

Reply
  #1 (permalink)  
Old 04-08-05, 05:54 AM
mrlocom mrlocom is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
newbie HTML question

concerning about my page http://www.mrlo.com/1.htm , i want to make hyperlinks , for example the word "abnegation" in line 3 , i want to link to a page http://encarta.msn.com/dictionary_/abnegation.html .

i use frontpage and of course i know how to create a single hyperlink , but i don't want to create all the link in the page http://www.mrlo.com/1.htm manually because it is too time consuming. Can anyone suggest a HTML code that can automatically create all the hyperlinks ? Each links are the same with http://encarta.msn.com/dictionary_/xxxxx.html , the only difference is the words in the "xxxxx" substitute for each different words inside the page.

Hope you can understand my question and offer me some help.


Thanks
Reply With Quote
  #2 (permalink)  
Old 04-08-05, 08:20 AM
kjmatthews kjmatthews is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: Boston, MA
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
There is no "HTML code" to do that kind of thing. Remember that HTML is not code, it is "markup," and as such only describes what is there, not how it acts or how it looks.

To do what you want - dynamically add hyperlinks to each word - you would need to use some kind of server-side language (like PHP or ASP) that can generate the links for you and spit them out as HTML.
Reply With Quote
  #3 (permalink)  
Old 04-08-05, 07:02 PM
mrlocom mrlocom is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re:

can anyone help me ? PHP or other language is ok .

thanks
Reply With Quote
  #4 (permalink)  
Old 04-09-05, 12:54 AM
kjmatthews kjmatthews is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: Boston, MA
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
Do you have access to MySQL and databases on your server?
Reply With Quote
  #5 (permalink)  
Old 04-09-05, 01:52 AM
mrlocom mrlocom is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re:

yes , i am using CPanel 10.0 with all the features with unlimited MySQL .
Reply With Quote
  #6 (permalink)  
Old 04-10-05, 10:10 PM
kjmatthews kjmatthews is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: Boston, MA
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
The best way I can think of would be to put all the words into a database and pull them out alphabetized and dynamically generate the links. This would be a really easy script to write - a matter of a couple hours, if that. I'm sure someone in the PHP forums would be happy to write one for you, but honestly, you could write this yourself with a book and some study. And then you'd have the bonus of knowing a little PHP/MySQL and being able to use that in the future!
Reply With Quote
  #7 (permalink)  
Old 04-11-05, 02:16 AM
mrlocom mrlocom is offline
Newbie Coder
 
Join Date: Apr 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
please offer me some help . i would be grateful for that . thanks.
Reply With Quote
  #8 (permalink)  
Old 04-11-05, 08:44 AM
kjmatthews kjmatthews is offline
Wannabe Coder
 
Join Date: Jun 2004
Location: Boston, MA
Posts: 134
Thanks: 0
Thanked 0 Times in 0 Posts
Like I said, writing the PHP script is easy, and giving it to you here is just letting you stay uninformed:
PHP Code:

<?php

//insert your "connect to database" function here

//get words in alphabetical order from database named "tablename"
$sql "select * from tablename order by name";
$query mysql_query($sql);
$number_words count($query);
$result mysql_fetch_array($query);

/*now loop the result $query for however many words there are and display the resultant link*/
for ($i=0$i<$number_words$i++) {
 
$word $result[$i];
 echo(
"<a href=\"http://encarta.msn.com/dictionary_/$word.html\">$word</a><br />");
}
?>
This will list all the words in your database in on long column, complete with links. To sort them all into rows as you have done, well, that takes a little more work.

What we can't do for you is set up your database. You'll have to do that for yourself, whether through your web hosts control panel or whatever. This book should be all the help you need and more, both to modify the above script for your needs and to set up this and future databases. You should post any questions you have in the PHP forum.
Reply With Quote
  #9 (permalink)  
Old 04-11-05, 12:07 PM
rdprogrammer rdprogrammer is offline
Coding Addict
 
Join Date: Aug 2004
Location: Tulsa, Oklahoma
Posts: 250
Thanks: 0
Thanked 0 Times in 0 Posts
this could be done in javascript i think, ask in those forums
__________________
Contact me directly at:
AIM: RDProgrammer
MSN: RDProgrammer@hotmail.com
Email 1: Richard@RDProgrammer.com
Email 2: RDProgrammer@hotmail.com
Website: RDProgrammer.com
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
html tutoral thefrtman HTML/XHTML/XML 5 04-27-09 10:25 AM
Newbie Question: DATETIME storage format? jenf PHP 6 08-22-04 04:19 PM
NEWBIE QUESTION: Forms - Assigning Values to Variables jenf JavaScript 1 07-23-04 03:36 PM
general question about php and html timfoster PHP 3 05-17-04 12:29 PM


All times are GMT -5. The time now is 08:43 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.