hawkee,
I have the title part working on my site,I used [if($category) print $category; if($subcategory) print $subcategory; print $title;] so that it would diplay $title before anyone clicked on $category or $subcategory. The value of $title is Products, so it just prints after $category or $subcategory is clicked, so my title becomes Art($category)Products($title).
My problem is that each page is loaded inside of my header as page1.html. All listings on the page are from $category or $subcategory. I'm not sure how to go about getting the keywords part to work. I don't need keywords for every page, just $category or $subcategory.
Your welcome to look at my site to see what I'm talking about.
Thank You
My variables:
$page = $_GET['page'];
$search = $_GET['search'];
$search = str_replace("-", " ", $search);
$search = stripslashes($search);
$category = $_GET['category'];
$subcategory = $_GET['subcategory'];
variable I added:
$title = ' Products';
The change I made:
<?php if($category) print $category; if($subcategory) print $subcategory; print $title; ?>this is the area I want to change because they stay the same:
What I am wondering is if I can create a php page structured like this
if($category='Arts_and_Entertainment') then ($meta_keywords='') and ($meta_description='');
if($category='Betting_Systems') then ($meta_keywords='') and ($meta_description='');
if($category='Business/Investing') then ($meta_keywords='') and ($meta_description='');
with all of my $categories and $subcategories keywords and descriptions and then call this page from my header?
My title works using this:
<?php if($category) print $category; if($subcategory) print $subcategory; print $title; ?>$title = ' Products';
onload title = Products, if any catagory (say Art) is clicked title = Art Products, and the same with the subcatagories
Is there a way that I could use the out-put from that to load keywords and descriptions for each category/subcategory?
@jrharper I'm sorry, but I'm just not very clear about what you are doing. Are you using the code provided on this page or are you building something entirely different? If you need some general programming questions answered you might want to try searching StackOverflow. It's a very good Q&A development resources.
Problem Solved !!!
First I want to thank you for the code and letting me use this place as a backboard for my thoughts.
I wanted to use your code, but I only have page1.html that is displayed inside a header. What is displayed on page1.html is controlled by 2 variables that make up the menu, $category and $subcategory. To solve my problem I created a title.php file that is an if/elseif statement.
if($category == '' && $subcategory == '') {
print('Products');
}
elseif ($category == 'Arts-and-Entertainment') {
print('Arts and Entertainment');
}
elseif($category == 'Betting-Systems') {
print('Betting Systems');
}
elseif($category == 'Business-/-Investing') {
print('Business / Investing');
It has $subcategory in the same file lower down.(it's 746 lines long) I did this to format the output. then I put include('title.php') between the title tags.
Now I can copy the file twice and save them as description.php and keyword.php and all I have to do is change the print('') statements and then include them between the tags.
I'm not too clear what you mean. Can you illustrate your point with some example URLs and the code changes you made?