Jump to content

hcdarkmage

Members
  • Posts

    326
  • Joined

  • Last visited

Everything posted by hcdarkmage

  1. Thank you for at least pointing me in the right direction. i looked up my problem and solved it. Again, thank you.
  2. Okay, so I was on here and I figured the problem out for my insert query, but this one really baffles me. I have a SELECT query that is supposed to retrieve the last contact id so that I may add 1 to it, but for some reason it isn't working. I tried it in my query editor and it works fine, but this is just strange. Any help on this would be greatly appreciated. The last ID, as it is now is 138. $getNum = "SELECT contact_id FROM contact_form2 ORDER BY contact_id DESC LIMIT 1"; $contactID = mysql_query($getNum) or die(mysql_error()); echo "<!-- ".$contactID." is the retrieved ID. -->"; //Testing code $contactid = $contactID+1; echo "<!-- ".$contactid." is the Contact ID. -->"; //Testing code When I run the script I check the source and I see this: Can anyone help me with this problem????
  3. Never mind . . . like the subject line said, I was over thinking the whole thing. $userid = $GLOBALS['modSiteInfo']->user_id; $getNum = "SELECT contact_id FROM contact_form2 ORDER BY contact_id DESC LIMIT 1"; $result = mysql_query($getNum) or die(mysql_error()); $contact = mysql_result($result); if($contact != ""){ $contactid = $contact + 1; }else{ $contactid = 1; } $datepost = date("Y-m-d h:i:s"); $getFields = "SELECT * FROM contact_field WHERE user_id = '$userid'"; $fields = mysql_query($getFields) or die(mysql_error()); while($row = mysql_fetch_array($fields)){ $fieldid = $row['field_id']; $fieldname = $row['fieldname']; $sql = "INSERT INTO contact_form2 (user_id, contact_id, datepost, field_id, content) VALUES ('".$userid."','".$contactid."','".$datepost."','".$fieldid."','".$_POST[$fieldname]."')"; mysql_query($sql) or die(mysql_error()); }
  4. Okay . . . new tactic. I got it to go into my first WHILE loop, but I'm not getting it to go into the INSERT query. Can anyone help point out where I'm going wrong? echo "<!-- The form has been submitted!! -->"; //Testing code /* Testing for now! */ $getNum = "SELECT contact_id FROM contact_form2 ORDER BY contact_id DESC LIMIT 1"; $result = mysql_query($getNum) or die(mysql_error()); $userid = $GLOBALS['modSiteInfo']->user_id; $getCount = "SELECT COUNT(*) FROM contact_field WHERE user_id= '$userid'"; $fcount = mysql_query($getCount) or die(mysql_error()); $fieldcount = mysql_result($fcount); echo "<!-- ".$fieldcount." is the field count. -->"; //Testing code $contact = mysql_result($result); echo "<!-- ".$contact." is the retrieved ID. -->"; //Testing code if($contact != ""){ $contactid = $contact + 1; }else{ $contactid = 1; } echo "<!-- ".$contactid." is the Contact ID. -->"; //Testing code $datepost = date("Y-m-d h:i:s"); echo "<!-- ".$datepost." is the date posted. -->"; //Testing code $getFields = "SELECT * FROM contact_field WHERE user_id = '$userid'"; $fields = mysql_query($getFields) or die(mysql_error()); while($row = mysql_fetch_array($fields)){ $fieldid = $row['field_id']; $fieldname = $row['fieldname']; $f = 0; echo "<!-- Inside the first while loop! -->"; //Testing code echo "<!-- ".$fieldid." ".$fieldname." ".$_POST[$fieldname]." Something!!! -->"; //Testing code while ($f < $fieldcount) { $sql = "INSERT INTO contact_form2 (user_id, contact_id, datepost, field_id, content) VALUES ('".$userid."','".$contactid."','".$datepost."','".$fieldid."','".$_POST[$fieldname]."')"; mysql_query($sql) or die(mysql_error()); $f++; echo "<!-- information inserted. -->"; //Testing code } }
  5. What does this have to do with the original problem at hand? Not cool!
  6. Okay . . . My JS script is now submitting. I put a bunch of "echo" scripts for around in my submit script to see what is being hit. Everything is fine until it hits my while loop: echo "The form has been submitted!!"; //Testing code /* Testing for now! */ $getNum = "SELECT contact_id FROM contact_form2 ORDER BY contact_id DESC LIMIT 1"; $result = mysql_query($getNum) or die(mysql_error()); $userid = $GLOBALS['modSiteInfo']->user_id; $fields = "SELECT * FROM contact_field WHERE user_id = '$userid'"; $fieldcount = count($fields); echo "<br />".$fieldcount." is the field count."; //Testing code $contact = mysql_result($result); echo "<br />".$contact." is the retrieved ID."; //Testing code if($contact != ""){ $contactid = $contact + 1; }else{ $contactid = 1; } echo "<br />".$contactid." is the Contact ID."; //Testing code $datepost = date("Y-m-d h:i:s"); echo "<br />".$datepost." is the dat posted."; //Testing code while($row = mysql_fetch_array($fields)){ $fieldid = $row['field_id']; $fieldname = $row['fieldname']; $f = 0; echo "<br />Inside the first while loop!"; //Testing code while ($f < $fieldcount) { $sql = "INSERT INTO contact_form2 (user_id, contact_id, datepost, field_id, content) VALUES ('".$userid."','".$contactid."','".$datepost."','".$fieldid."','".$_POST[$fieldname]."')"; mysql_query($sql) or die(mysql_error()); $f++; echo "<br />information inserted."; //Testing code } } Can anyone help me figure this out?
  7. I was actually getting nothing. So I thought I would change the insert to look like this: $getNum = "SELECT contact_id FROM contact_form2 ORDER BY contact_id DESC LIMIT 1"; $result = mysl_query($getNum) or die(mysql_error()); $userid = $GLOBALS['modSiteInfo']->user_id; $fields = "SELECT * FROM contact_field WHERE user_id = '$userid'"; $fieldcount = count($fields); $contact = mysql_result($result); if($contact != ""){ $contactid = $contact + 1; }else{ $contactid = 1; } $datepost = date("Y-m-d h:i:s"); while($row = mysql_fetch_array($fields)){ $fieldid = $row['field_id']; $f = 0; while ($f < $fieldcount) { $sql = "INSERT INTO contact_form2 (user_id, contact_id, datepost, field_id, content) VALUES ('".$userid."','".$contactid."','".$datepost."','".$fieldid."','".$_POST[$fieldid]."')"; mysql_query($sql) or die(mysql_error()); $f++; } } Figuring that would work, I was testing it, but for some reason my submit button stopped working. I went to see what was wrong and I see the issue has something to do with the JS that checks for required fields and makes sure they are filled: <script language=JavaScript> function checkRequiredField(){ for (i=0; i<fieldsid.length; i++){ var field = document.frmSend[fields[i]]; if (fieldsrequire[i]=="yes" && (fieldstype[i] == "textbox" || fieldstype[i] == "textarea")){ if (!field.value){ alert("'"+ fieldstext[i] +"' <? echo $lang['contactform']['requiredis'] ?>"); return false; } }else if (fieldsrequire[i]=="yes" && fieldstype[i] == "radio"){ var blnChecked = false; for(j=0; j<field.length;j++){ if (field[j].checked){ blnChecked = true; break; } } if (blnChecked==false) { alert("'"+ fieldstext[i] +"' <? echo $lang['contactform']['requiredis'] ?>"); return false; } } } return true; } </script>
  8. Okay . . . how to explain the problem. I have a dynamic form that doesn't have set field names, so inserting the information into a database is giving me problems. I didn't write the code, but I do need to figure out the solution. The form itself looks like: echo " <script language=JavaScript> var fieldsid = new Array(); var fields = new Array(); var fieldsrequire = new Array(); var fieldstype = new Array(); var fieldstext = new Array(); var fieldscount = 0; </script> <table border=0 cellpadding=2 width=100% align=center> <form name=frmSend action=\"". $GLOBALS['ActivePage']."?homeinclude=$homeinclude\" method=post> <input type=hidden name=pageaction value=\"post\"> <input type=hidden name=sendToEmail value=".$sendToEmail." /> <b>".$lang['contactform']['contactform']."</b><hr size=1><br />"; $oContact_Field->data = array("field_id", "fieldname", "fieldtype", "fieldtext", "width", "height","fieldrequire"); $oContact_Field->order = "sequence asc"; $result = $oContact_Field->getList(); while($myrow=mysql_fetch_row($result)){ echo " <script language=JavaScript> fieldsid[fieldscount]=\"$myrow[0]\"; fields[fieldscount]=\"$myrow[1]\"; fieldstype[fieldscount]=\"$myrow[2]\"; fieldsrequire[fieldscount]=\"$myrow[6]\"; fieldstext[fieldscount]=\"$myrow[3]\"; fieldscount++; </script>"; $requiredflag = ($myrow[6]=="yes"?"*":""); echo "<tr><td valign=top width=20%>".stripslashes($myrow[3])." $requiredflag</td>"; switch($myrow[2]){ case "textbox": echo "<td valign=top><input type=text style=\"width:{$myrow[4]}px\" name=\"$myrow[0]\" value=\"${$myrow[1]}\"></td>"; break; case "drop": echo "<td valign=top><select name=\"$myrow[0]\" style=\"width:{$myrow[4]}px\">"; $oContact_FieldOption->data = array("optionvalue"); $oContact_FieldOption->where = "field_id=$myrow[0]"; $oContact_FieldOption->order = "option_id asc"; $resultOption = $oContact_FieldOption->getList(); while($myrowOption=mysql_fetch_row($resultOption)){ echo "<option value=\"$myrowOption[0]\">$myrowOption[0]</option>"; } echo "</select></td>"; break; case "checkbox": $oContact_FieldOption->data = array("optionvalue"); $oContact_FieldOption->where = "field_id=$myrow[0]"; $oContact_FieldOption->order = "option_id asc"; $resultOption = $oContact_FieldOption->getList(); echo "<td><table border=0 cellpadding=0 cellspacing=0><tr>"; while($myrowOption=mysql_fetch_row($resultOption)){ $checked= $fieldvalue==$myrowOption[0]?"checked":""; echo "<td style=\"width:{$myrow[4]}px\"><input type=checkbox name=\"$myrow[0]\" value=\"$myrowOption[0]\" $checked>$myrowOption[0]</td>"; } echo "</tr></table></td>"; break; case "radio": $oContact_FieldOption->data = array("optionvalue"); $oContact_FieldOption->where = "field_id=$myrow[0]"; $oContact_FieldOption->order = "option_id asc"; $resultOption = $oContact_FieldOption->getList(); echo "<td><table border=0 cellpadding=0 cellspacing=0><tr>"; while($myrowOption=mysql_fetch_row($resultOption)){ $checked= ($$myrow[1]==$myrowOption[0]?"checked":""); echo "<td style=\"width:{$myrow[4]}px\"><input type=radio name=\"$myrow[0]\" value=\"$myrowOption[0]\">$myrowOption[0]</td>"; } echo "</tr></table></td>"; break; case "textarea": echo "<td valign=top><textarea style=\"width:{$myrow[4]}px; height:{$myrow[5]}px\" name=\"$myrow[0]\">${$myrow[1]}</textarea></td>"; break; } echo "</tr>"; } echo " <tr><td> </td><td align=left><img id=\"CaptchaImage\" src=\"/shared/administrator/blogger/Captcha.php?NoCache=".rand(0,1073741824)."\"> <br /> <input type='BUTTON' onclick='RefreshCaptcha();' value=\"Can't Read\"><br> <input type=\"Text\" name=\"CaptchaGuess\" required=\"Yes\" size=\"25\" style=\"width:100px;\"></td></tr>"; But to insert it into the database, I need to take each form field and put it in a different row. I know how to call the information later for emailing, but I am having a problem with the INSERT statement. So far, though this isn't correct, I have something like this: $getNum = "SELECT contact_id FROM contact_form2 ORDER BY contact_id DESC LIMIT 1"; $result = mysl_query($getNum) or die(mysql_error()); $userid = $GLOBALS['modSiteInfo']->user_id; $fields = "SELECT * FROM contact_field WHERE user_id = '$userid'"; $fieldcount = count($fields); $contact = mysql_result($result); if($contact != ""){ $contactid = $contact + 1; }else{ $contactid = 1; } $datepost = date("Y-m-d h:i:s") foreach($_POST as $key => $value) { $fieldid = $$key; $content = $$value; } $f = 0; while ($f < $fieldcount) { $sql = "INSERT INTO contact_form2 (user_id, contact_id, datepost, field_id, content) VALUES ('".$userid."','".$contactid."','".$datepost."','".$fieldid."','".$content."')"; mysql_query($sql) or die(mysql_error()); $f++; } Could anyone help me figure this out?
  9. Check to make sure that the path to your images works. Also make sure that the images are in the proper folder that you are calling. If you are using Firefox, lookinto a little addon called firebug. It can help you see if your paths are right.
  10. here is a piece of code that helped someone else with a similar problem: $pic[array_rand($pic)] Just modify it to your needs: $hbanner[array_rand($hpics)] <img src='<?php echo $hbanner; ?>' width='723' height='306' alt='Center 4 IVF' border='0'>
  11. Try putting an echo before your code: <?php echo "<form method=\"POST\" action=\"".$_SERVER["PHP_SELF"]."\"> <p><strong>Your E-Mail Address:</strong><br/> <input type=\"text\" name=\"email\" size=\"40\" maxlength=\"150\"> <p><strong>Action:</strong><br/> <input type=\"radio\" name=\"action\" value=\"sub\" checked> subscribe <input type=\"radio\" name=\"action\" value=\"unsub\"> unsubscribe <p><input type=\"submit\" name=\"submit\" value=\"Submit Form\"></p> </form>"; ?>
  12. There we go! That's what I was looking for. Try AlexWD's suggestion:
  13. try: <?php echo "/img/" . $pic[rand(0,2)]; ?> I always had a problem with array syntax.
  14. Fairly simple code: <?php $pic = array( "image1.jpg", "image2.jpg", "image3.jpg", "image4.jpg", "image5.jpg" ); echo "<img src='img/".$pic[rand(1,5)]."' />"; ?>
  15. A good place to learn the basics is http://www.w3schools.com/.
  16. Try this. Change $sel = ($_GET['page'] == $url ) ? ' id="selected" ' : ''; to $sel = ("index.php?page=".$_GET['page'] == $url ) ? 'id="selected" ' : ''; I hope my syntax is right. If not, I'm sure someone will correct it.
  17. foreach($_menu as $url => $name){ $sel = ($_GET['page'] == $url ) ? ' id="selected" ' : ''; //<--- Here is your 'select' script. $str .= "<li ". $sel ."><a href=" . $url . " >" . $name . "</a>\n"; } I'm not sure if this helps, but this is the line that calls the 'selected' part of your css file. As for why it isn't highlighted anymore, when we changed the conditions of the menu, we changed the conditions of what it was looking for. Let me see if I can find a solution, or if someone else can find the solution.
  18. Glad we could help. If this is solved, don't forget to mark it as such by using the solved button.
  19. 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.
  20. 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.
  21. When we started to give you advice on how to make your title and metatags dynamic, we didn't have all the facts (or code for that matter) and we tried to help you with what we had. Now we have just screwed up your site. You are doubling code when you shouldn't have to. I re-posted the original index.php code that you gave us earlier and noticed a few things that would make it hard for dynamic metas and stuff with the header.php and footer.php. Apparently, your index.php takes care of both of those for all the pages. Recopy the original code, and reset your site back to what it was. It looks like a different approach will be needed for getting the dynamic title and metatags.
  22. I guess it's a good thing that I copied your index.php code before suggesting any changes: <?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/"; ?> <!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" /> <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> <?php if (file_exists($html_path.$file)) include $html_path.$file; ?> </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> I noticed one line in the code that should stand out (if one was looking properly ). <?php if (file_exists($html_path.$file)) include $html_path.$file; ?> This code incorporates the separate pages into the index.php page. That and 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; }
  23. Before you do any of the suggested above, could you please post the code from home.php or one of the other pages that are called. I think I may have found a problem with what has been suggested so far.
  24. I can see how this is confusing. On those pages that you are asking about (home.php, contact.php, etc.) do they have the same initial setup? if so then you just repeat the code for each page so that you get the proper stuff. For instance home.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/"; define('TITLE', 'This is the page title.'); // <--- Change the page title here include('./php/header.php'); ?> <div id="main-content"> //insert home.php contents here. </div> <?php include('./php/footer.php'); ?> The same would go for any page that you have. As for the meta tags, you can do the same thing as the title, like what was posted at the begining of this post. Just define it under the title definition.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.