TOA Posted June 15, 2010 Share Posted June 15, 2010 Still not sure what index.php is doing. If you want to use it as a placeholder type file, then you need to write in some conditions that say "if this is the case include home.html else include another file". Index should have the structure: (in pseudo) include header decision block to determine what page to show and title to put up include footer Or am I missing your intentions? Quote Link to comment https://forums.phpfreaks.com/topic/204842-how-can-i-add-dynamic-titles-and-dynamic-meta-descriptions-to-my-pages/page/3/#findComment-1072543 Share on other sites More sharing options...
TOA Posted June 15, 2010 Share Posted June 15, 2010 seems to be getting closer but everything repeats twice and the formatting is still awful. See my previous post. You're outputting it in two places (home and index) Quote Link to comment https://forums.phpfreaks.com/topic/204842-how-can-i-add-dynamic-titles-and-dynamic-meta-descriptions-to-my-pages/page/3/#findComment-1072544 Share on other sites More sharing options...
healthbasics Posted June 15, 2010 Author Share Posted June 15, 2010 seems to be getting closer but everything repeats twice and the formatting is still awful. See my previous post. You're outputting it in two places (home and index) Can't we fix this without starting all over from scratch? The whole logic of the entire thing has been changed, there is hardly a file that hasn't been edited yet. It doesn't matter to me if more is changed in the way the index works as long as everything looks right. I really wish I just paid somebody to do this at this point... :'( Quote Link to comment https://forums.phpfreaks.com/topic/204842-how-can-i-add-dynamic-titles-and-dynamic-meta-descriptions-to-my-pages/page/3/#findComment-1072550 Share on other sites More sharing options...
healthbasics Posted June 15, 2010 Author Share Posted June 15, 2010 Still not sure what index.php is doing. If you want to use it as a placeholder type file, then you need to write in some conditions that say "if this is the case include home.html else include another file". Index should have the structure: (in pseudo) include header decision block to determine what page to show and title to put up include footer Or am I missing your intentions? My only intentions were to simply get dynamic title and meta descriptions (and I decided to throw in keywords too) - I didn't and don't care how. I just want to mantain the look and function of my site but to have dynamic titles nad meta descriptions. Quote Link to comment https://forums.phpfreaks.com/topic/204842-how-can-i-add-dynamic-titles-and-dynamic-meta-descriptions-to-my-pages/page/3/#findComment-1072551 Share on other sites More sharing options...
hcdarkmage Posted June 15, 2010 Share Posted June 15, 2010 Still not sure what index.php is doing. If you want to use it as a placeholder type file, then you need to write in some conditions that say "if this is the case include home.html else include another file". Index should have the structure: (in pseudo) include header decision block to determine what page to show and title to put up include footer Or am I missing your intentions? Those conditions are actually in the code. I have posted what they where, but, for the sake of consitency, I will post them once more. In index.php he has these lines of code: include "menu.inc.php"; function menu($_menu){ $str = ''; foreach($_menu as $url => $name){ $sel = ($_GET['page'] == $url ) ? ' id="selected" ' : ''; $str .= "<li ". $sel ."><a href=" . $url . " >" . $name . "</a>\n"; } echo $str; } $page = ( isset($_GET['pg']) ? $_GET['pg'] : ((isset($_GET['page']))? $_GET['page']:'home')); $file = basename($page).'.php'; $html_path = "php/"; and <?php if (file_exists($html_path.$file)) include $html_path.$file; ?> These lines are what is causing the double posting. I just suggested that he return it to the original and we try and help him with another way of getting the dynamic things in there. Using a header and footer file would defeat the purpose of what he already had. Quote Link to comment https://forums.phpfreaks.com/topic/204842-how-can-i-add-dynamic-titles-and-dynamic-meta-descriptions-to-my-pages/page/3/#findComment-1072554 Share on other sites More sharing options...
TOA Posted June 15, 2010 Share Posted June 15, 2010 Still not sure what index.php is doing. If you want to use it as a placeholder type file, then you need to write in some conditions that say "if this is the case include home.html else include another file". Index should have the structure: (in pseudo) include header decision block to determine what page to show and title to put up include footer Or am I missing your intentions? Those conditions are actually in the code. I have posted what they where, but, for the sake of consitency, I will post them once more. In index.php he has these lines of code: include "menu.inc.php"; function menu($_menu){ $str = ''; foreach($_menu as $url => $name){ $sel = ($_GET['page'] == $url ) ? ' id="selected" ' : ''; $str .= "<li ". $sel ."><a href=" . $url . " >" . $name . "</a>\n"; } echo $str; } $page = ( isset($_GET['pg']) ? $_GET['pg'] : ((isset($_GET['page']))? $_GET['page']:'home')); $file = basename($page).'.php'; $html_path = "php/"; and <?php if (file_exists($html_path.$file)) include $html_path.$file; ?> These lines are what is causing the double posting. I just suggested that he return it to the original and we try and help him with another way of getting the dynamic things in there. Using a header and footer file would defeat the purpose of what he already had. Guess I'm seeing it in a different way Quote Link to comment https://forums.phpfreaks.com/topic/204842-how-can-i-add-dynamic-titles-and-dynamic-meta-descriptions-to-my-pages/page/3/#findComment-1072555 Share on other sites More sharing options...
blacksharkmedia Posted June 15, 2010 Share Posted June 15, 2010 Why not use MySql? You can make 2 new fields along product/page details in your mysql table like seo_title, seo_description, seo_keywords... And on the page you just display them acording to your product/page ID from url or sessions. This way you cand modify them any time you add a new product/page from the admin pannel Quote Link to comment https://forums.phpfreaks.com/topic/204842-how-can-i-add-dynamic-titles-and-dynamic-meta-descriptions-to-my-pages/page/3/#findComment-1072557 Share on other sites More sharing options...
healthbasics Posted June 15, 2010 Author Share Posted June 15, 2010 @hcdarkmage I actually like the separate header footer files better than what I had before if we can make it work. That index file was extremely cluttered. This is nice this way if only I could get it to work. @DevilsAdvocate If that's what's required but I had to scrap the last 6 hours of work. I'm not sure i could return everything the way it was quickly or easily either. I've made changes to almost every file of the site. I could put it back to it's non php equivalent i think but php seems like a better system if only I could make it work. I thought this was going to be much easier and faster to accomplish than what it really was. @blacksharkmedia I don't even want to think about starting something new here. I don't have My SQL and I don't know all that much about it other than I believe it's a free open source DB platform. I just want to finish up this small task asap and restore my site to normal function. My SQL implimentation if and when justified I would definitely hire a developer for - as you may have noticed I am not a developer. Quote Link to comment https://forums.phpfreaks.com/topic/204842-how-can-i-add-dynamic-titles-and-dynamic-meta-descriptions-to-my-pages/page/3/#findComment-1072560 Share on other sites More sharing options...
hcdarkmage Posted June 15, 2010 Share Posted June 15, 2010 I see a way we can help you, without starting all over, with all the pages you have. index.php: <?php include "menu.inc.php"; function menu($_menu){ $str = ''; foreach($_menu as $url => $name){ $sel = ($_GET['page'] == $url ) ? ' id="selected" ' : ''; $str .= "<li ". $sel ."><a href=" . $url . " >" . $name . "</a>\n"; } echo $str; } $page = ( isset($_GET['pg']) ? $_GET['pg'] : ((isset($_GET['page']))? $_GET['page']:'home')); $file = basename($page).'.php'; $html_path = "php/"; if (file_exists($html_path.$file)) include $html_path.$file; ?> header.php: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title><?php echo TITLE ?></title> <link rel="shortcut icon" href="img/favicon.ico" /> <link rel="stylesheet" href="css/style.css" type="text/css" media="screen" /> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta http-equiv="content-language" content="en-us" /> <meta http-equiv="imagetoolbar" content="false" /> // Subtract what you need to and echo the meta information here. <meta name="author" content="Adroon Design | www.adroon.com" /> <meta name="copyright" content="Copyright (c) Health Basics LLC 2010" /> <meta name="description" content="Andrea Stevens is a clinical nutritionist specializing in consultations on digestive system dysfunction and children with neurological and developmental disorders as well as educational programs focusing on natural whole foods and wellness. Health Basics is an international distributor of natural health products, vitamins and supplements." /> <meta name="keywords" content="metabolic typing, body ecology, body ecology diet, digestive problems, digestive disorders, food sensitivities, dysbiosis, autism, asperberger syndrome, aspergers syndrome, asperger's syndrome, asperger, aspergers, asperger's, ASD, spectrum disorder, GI problems, GI disorders, gastrointestinal problems, gastrointestinal disorders, whole foods nutritionist, natural nutritionist, functional nutritionist, functional healthcare, organic foods, organic, holistic healing, holistic healthcare, digestive system disorders, candidiasis, candida, candida related problems, yeast related problems, yeast overgrowth, infant feeding, infant feeding problems, failure to thrive, children eating problems, children neurological problems, neurological problems, eating problems, seizures, behavior problems, learning problems, learning disabilities, learning disability, attention deficit disorder, ADD, attention deficit disorder, attention deficit hyperactivity disorder, ADHD, hyperactivity, hyperactivity disorder, DAN Protocol, leaky gut, crohns, crohn's, crohns disease, crohn's disease" /> <meta name="mssmarttagspreventparsing" content="true" /> <meta name="robots" content="index, follow, noarchive" /> <meta name="revisit-after" content="7 days" /> <meta name="google-site-verification" content="LLvcG6P8wvTcKL-RrhBEs7w0uMFrax06UrzaExDYvEY" /> <!--[if lt IE 7]> <script type="text/javascript" src="css/unitpngfix.js"></script> <![endif]--> </head> <body> <div id="wrapper"> <div id="header"> <div id="nav"> <a style="float:left" href="http://www.healthbasics.net/"><big><b>Health Basics™</b></big></a> <a href="<?php echo $_SERVER['PHP_SELF'].'?page=home'?>">Home</a> | <a href="<?php echo $_SERVER['PHP_SELF'].'?page=calendar'?>">Calendar</a> | <a href="http://shop.healthbasics.net/">Online Store</a> | <a href="./blog/">Blog</a> </div> <div id="bg"></div> </div> <div id="main-content"> <div id="left-column"> <div id="logo"> <img src="img/logo.png" alt="" width="150" height="150" align="left" /> <span class="logotxt1">Health</span> <span class="logotxt2">Basics</span> <span class="logotxt3">TM</span><br /><span style="margin-left:15px;">The website of Andrea Stevens, M.S., C.N.S., C.M.T.A. Clinical Nutritionist</span> </div> <div class="box2"> <p><center>Using Whole Food Nutrition and Digestive System Health to Achieve your Health Goals Naturally</center></p> <ul style="margin-top:10px;"> <li>Consultations specializing in Digestive System Dysfunction and Children with Neurological and Developmental Disorders</li> <li>Educational Programs focusing on Natural, Whole Foods and Wellness</li> </ul> </div> footer.php: </div> <div id="right-column"> <div id="main-image"><img src="img/andrea.jpg" height="240px" width="240px" alt="" /></div> <div class="sidebar"> <ul id="menu"> <? #include $html_path."menu.html"; menu($_menu); ?> <h3>Contacts</h3> <p> Health Basics LLC<br /> Toll Free: +1 877 HBNET 50<br /> Phone: +1 610 857 1399<br /> Fax: +1 815 550 1543<br /> Email: <a href="mailto:contact@healthbasics.net">contact@healthbasics.net</a><br /> Skype: health.basics </p> <h3>Subscribe</h3> <form method="post" action="http://healthbasics.net/blog/"> <input type="hidden" name="ip" value="<?=$_SERVER['REMOTE_ADDR']?>" /> <p> Your email:<br /> <input type="text" name="email" value="Enter email address..." size="20" onfocus="if (this.value == 'Enter email address...') {this.value = '';}" onblur="if (this.value == '') {this.value = 'Enter email address...';}" /> </p> <p> <input type="submit" name="subscribe" value="Subscribe" /> <input type="submit" name="unsubscribe" value="Unsubscribe" /> </p> </form> <p> <!-- comment out paypal <form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank"> <input type="hidden" name="cmd" value="_s-xclick"> <input type="hidden" name="hosted_button_id" value="10802546"> <input type="image" src="img/paypal.png" border="0" name="submit" alt="PayPal - The safer, easier way to pay online!"> <img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1"> </form> --> </p> <p> </p> <p> <!-- comment out amazon <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&location=http%3A%2F%2Fwww.amazon.com%2F&tag=healbasi07-20&linkCode=ur2&camp=1789&creative=9325" target="_blank"><img src="img/amazon.gif" alt="" width="200px" height="26px"/></a> --> </p> </div> </div> </div> <div id="footer"> <div id="footer_copy"> © 2010 <a href="http://healthbasics.net">Health Basics LLC</a>. All rights reserved. Developed by <a href="http://adroon.com">Adroon Design</a><br/> <a href="http://shop.healthbasics.net/pages/disclaimer">Disclaimer</a> </div> <div id="footer_links"> <a href="http://www.facebook.com/pages/edit/picture.php?success=1&id=243139889898#/pages/Health-Basics/243139889898" target="_blank"><img src="img/facebook.png" alt="" /></a> <a href="http://twitter.com/HealthBasicsLLC" target="_blank"><img src="img/twitter.png" alt="" /></a> <a href="http://www.linkedin.com/profile?viewProfile=&key=61284894&authToken=Ic-E&authType=name" target="_blank"><img src="img/linkedin.png" alt="" /></a> </div> </div> </div> </body> </html> and home.php or any other page: <?php define(TITLE, "Health Basics | The Website Of Andrea Stevens, M.S., C.N.S., C.M.T.A. Clinical Nutritionist"); define(METATAGDESC, "Andrea Stevens is a clinical nutritionist specializing in consultations on digestive system dysfunction and children with neurological and developmental disorders as well as educational programs focusing on natural whole foods and wellness. Health Basics is an international distributor of natural health products, vitamins and supplements."); define(METAKEYWORDS, "metabolic typing, body ecology, body ecology diet, digestive problems, digestive disorders, food sensitivities, dysbiosis, autism, asperberger syndrome, aspergers syndrome, asperger's syndrome, asperger, aspergers, asperger's, ASD, spectrum disorder, GI problems, GI disorders, gastrointestinal problems, gastrointestinal disorders, whole foods nutritionist, natural nutritionist, functional nutritionist, functional healthcare, organic foods, organic, holistic healing, holistic healthcare, digestive system disorders, candidiasis, candida, candida related problems, yeast related problems, yeast overgrowth, infant feeding, infant feeding problems, failure to thrive, children eating problems, children neurological problems, neurological problems, eating problems, seizures, behavior problems, learning problems, learning disabilities, learning disability, attention deficit disorder, ADD, attention deficit disorder, attention deficit hyperactivity disorder, ADHD, hyperactivity, hyperactivity disorder, DAN Protocol, leaky gut, crohns, crohn's, crohns disease, crohn's disease"); include('./php/header.php'); ?> <h2>Philosophy & Focus</h2> <p>My primary goal is to assist clients in achieving the highest degree of health possible for themselves and their families. Drawing upon up-to-date scientific findings as well as forgotten but highly valuable knowledge - which includes old-fashioned methods of food preparation - I enjoy helping others to use natural ways to support their health and avoid illness and disease. Prescription medication, with its highly undesirable side effects, should not be the first or primary method of addressing ill health.</p> <p><br /> The human body is wonderfully designed with countless mechanisms to stay healthy and balanced. If we can provide the body with all the natural raw materials (an abundance of nutrients, pure water, clean air, and love and intimacy among them) that it needs, as well as support the elimination of waste material and toxins, the body can heal many conditions and increase its levels of health, energy and vitality.</p> <p><br /> <div class="box"> <center><b><i><p>Essential Nutrients in... Waste out!</p> <p>This is a model that all living organisms follow in order to thrive and flourish.</p></b></i></center> </div> <p><br /> <p>Before turning to over-the-counter and prescription medications - which primarily suppress symptoms instead of address the underlying causes of dysfunction - understanding, and then supporting, the natural processes of the body will often result in a marked decrease or elimination of those symptoms. Symptoms are nature's way of calling our attention to problems in the body. Perhaps we are meant to listen to those signals and then correct the habits in our lifestyle that contribute to the underlying dysfunction (which then results in specific symptoms). These habits usually involve failing to provide the body with enough of the raw materials it needs, and hampering its detoxification, or waste removal, pathways.</p> <p><br /> <p>The answer to our health problems doesn't lie in treating (suppressing) symptoms, but in addressing the causes - which are generally some combination of nutritional deficiencies and waste buildup within the body.</p> <p><br /> <p>Two major concepts govern my approach. The first is that of biochemical individuality, which states that no two people are exactly alike and, therefore, no one dietary program is best for everyone... the Metabolic Typing philosophy addresses this. Secondly, I believe - as most physicians did prior to the mid 20th century - that overall health is directly dependent upon the health of the gastrointestinal or digestive tract... the Body Ecology approach addresses this.</p> <p><br /> <p>I hold a firm belief in the inherent power, wisdom, and uniqueness in each of us. Eating natural, unaltered whole foods grown or raised in a healthy and socially responsible manner, along with proper digestive system-processing of those foods, are key to achieving optimal health, energy and vitality.</p> <p><br /> <div class="box"> <center><b><i><p>We need to Understand the <b>BASICS</b> of Body Functioning and the <B>BASICS</B> of Health-Supporting Food in order to Achieve BASIC Good Health. </p></b></i></center> </div> <p><br /> <p>Specific conditions which can be successfully treated through Whole Food Nutrition and Optimal Digestive System Functioning include:</p> <p><br /> <p>Overt Digestive Problems</p> <ul> <li>Infant and Child Feeding Problems</li> <li>Reflux/GERD</li> <li>Food Sensitivities, Allergies, Intolerances</li> <li>Heartburn/Indigestion</li> <li>Bloating/Gas</li> <li>Constipation</li> <li>Diarrhea / Loose Bowel Movements</li> <li>Irritable Bowel Syndrome (IBS)</li> </ul> <p><br /> <p>Systemic Problems Related to an Underlying Unhealthy Digestive System</p> <ul> <li>Candidiasis</li> <li>Autism Spectrum Disorder</li> <li>Attention Deficit Disorder (ADD), Attention Deficit Hypactivity Disorder (ADHD) and other Behavior and Learning Problems</li> <li>Epilepsy and Seizures</li> <li>Autoimmune Conditions like Rheumatoid Arthritis, Lupus, Multiple Sclerosis</li> <li>Chronic Fatigue</li> <li>Fibromyalgia</li> <li>"Mysterious Medical Maladies" - conditions unable to be successfully diagnosed or treated within the traditional healthcare system</li> </ul> <p><br /> <p>Prevention of Health Problems and Disease</p> <ul> <li>Pregnancy Preparation</li> <li>Pregnancy</li> <li>Graceful Aging</li> <li>Optimal Levels of Energy, Vitality and Health</li> </ul> <?php include('./php/footer.php'); ?> Less cluttered and easier to edit, if needs be. Quote Link to comment https://forums.phpfreaks.com/topic/204842-how-can-i-add-dynamic-titles-and-dynamic-meta-descriptions-to-my-pages/page/3/#findComment-1072565 Share on other sites More sharing options...
healthbasics Posted June 15, 2010 Author Share Posted June 15, 2010 Wow you guys are great. Thanks so much. It works like a charm now Quote Link to comment https://forums.phpfreaks.com/topic/204842-how-can-i-add-dynamic-titles-and-dynamic-meta-descriptions-to-my-pages/page/3/#findComment-1072575 Share on other sites More sharing options...
hcdarkmage Posted June 15, 2010 Share Posted June 15, 2010 Glad we could help. If this is solved, don't forget to mark it as such by using the solved button. Quote Link to comment https://forums.phpfreaks.com/topic/204842-how-can-i-add-dynamic-titles-and-dynamic-meta-descriptions-to-my-pages/page/3/#findComment-1072577 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.