473,567 Members | 2,960 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Readin page title from db and outputting to web page

1 New Member
Hi

Please be very gentle! I am not a programmer! I have a question which I'm sure you'll all think is very easy. I have a directory which writes out categories from a db. When you click on a category, whatever links are in that category are written out to the web page. I can add or delete categories etc. What I want to know is how to change the 'TITLE' of the asp page to the actual category name. At the moment on categories.asp the page title is Categories. When I click on a category the web page changes and the query result is ouput to the website - but the page title is still 'Categories'. I want to change the 'Categories' title to the actual category I'm in. Do I need to create a new field in the db so asp/vbscript can read and ouput from that?

Thanks

Ian
Mar 15 '07 #1
1 1094
jhardman
3,406 Recognized Expert Specialist
Hi

Please be very gentle! I am not a programmer! I have a question which I'm sure you'll all think is very easy. I have a directory which writes out categories from a db. When you click on a category, whatever links are in that category are written out to the web page. I can add or delete categories etc. What I want to know is how to change the 'TITLE' of the asp page to the actual category name. At the moment on categories.asp the page title is Categories. When I click on a category the web page changes and the query result is ouput to the website - but the page title is still 'Categories'. I want to change the 'Categories' title to the actual category I'm in. Do I need to create a new field in the db so asp/vbscript can read and ouput from that?

Thanks

Ian
This seems like a pretty easy problem, and I think I've done something like that a couple of times. My first question is when you say "title" are you referring to the actual [HTML]<title>categori es</title>[/HTML] or a page header [HTML]<h1>Categorie s</h1>[/HTML] ?

My second question is, is there already a field in the database that has the info you want? Or if not, is there a simple logical statement from which you can derive the info? If either of these is true, you don't need to add a new field to the database.

Example of a logical statement:
Expand|Select|Wrap|Line Numbers
  1. if request("category") = "toothpaste" then
  2.    response.write "<h1>Toothpaste - make your teeth gleam!</h1>"
  3. elseif request("category") = "deoderant" then
  4.    response.write "<h1>Deoderant - smell like a star!</h1>"
  5. end if
If the field already exists in the database that has the exact phrasing you want, then you just need to say:

Expand|Select|Wrap|Line Numbers
  1. <h1><%= objRS("categoryName") %></h1>
of course you need to refer to the database connection as it is already done on your page. If this looks nothing like what is already on your page, post your code and you may get a better response.

There is a good asp database connection tutorial at w3schools.com
Mar 16 '07 #2

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

Similar topics

6
38322
by: the wonderer | last post by:
This is an elementary question, but I've not been able to find the answer, so here goes: I am developing a site using php. I have the html header information in a file that I include in all the pages using the require_once function. That is, each page includes the line <?require_once('PageStart.php')?>
13
14992
by: mark | last post by:
IF I have something like this: <title><?php print($pagetitle); ?></title> <body> <?php include("folders/my_include.php"); ?> </body> </html> and my_include.php contains the value to the variable ($pagetitle). How do I get the value before the code for the <title> is written. This is just a
8
8395
by: Dynamo | last post by:
Yep its me again, I have succesfully created a login page for my site. I have used the PHP_SELF so that once the user has succesfully logged on the page reloads. Everything works fine the first time somebody tries to log in but when they revisit, the log on page is bypassed and it goes straight to the information page. I have a sneaky...
5
1682
by: Jeremy Ames | last post by:
I have run into a major road block with my page development projects. I am trying to add a literal control to my asp.net page and I got an error stating that the control could not be added because of code blocks (<% %>) on the page. Most of these blocks can be handled by adding a label control to the form so it is not that big of deal, but one...
6
4854
by: scottyman | last post by:
I can't make this script work properly. I've gone as far as I can with it and the rest is out of my ability. I can do some html editing but I'm lost in the Java world. The script at the bottom of the html page controls the form fields that are required. It doesn't function like it's supposed to and I can leave all the fields blank and it still...
11
1872
by: Victor Lagerkvist | last post by:
Greetings, I know it's usually a bad habit to include several questions in a single message, but they are quite related. I have declared and defined a function named readin, whose purpose is to get input from stdin and save the result in a character array (provided the input does not exceed the maximum limit). Somehow it feels natural that...
4
10493
by: Peter Nimmo | last post by:
Hi, I am writting a windows application that I want to be able to act as if it where a Console application in certain circumstances, such as error logging. Whilst I have nearly got it, it doesn't seem to write to the screen in the way I would expect. The output is:
10
10395
Ajm113
by: Ajm113 | last post by:
Making a History Page for BIG Sites Intro: Ok, let's say after a while your website has grown massive. We're talking search engine, forum and video hosting -- you've got a LOT of content. And you are wondering, "Why do I need yet another feature for my big site?" Well, some people can become forgetful every time they see content on your...
2
1480
by: Stuartsblog | last post by:
Is it possible to return the Page title in php ? I can return the end of the url with $_SERVER however it is the "Page Title" that I require. Thanks
0
7690
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7909
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8115
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7961
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6273
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5492
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5216
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
1
2093
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
0
930
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.