gabriel_vzw Posted February 16, 2008 Share Posted February 16, 2008 Hey all, I am a novice php user who used a simple CMS for the layout of my site. The URL is www.fmmetrocog.org. The content is built like: <?php extract($_GET); print "<div id=\"content\">"; if (empty($content)){ $content = "content/index/content.html"; } include("php_ssi/configure.php"); include("php_ssi/db.php"); include ($content); Then each link is built like: <a href="index.php?content=content/about/history/content.html">//places the html file in the div I am integrating a previously existing mysql databse into my CMS but am running into a problem. I cannot place the rows which are being retrieved from the my sql, so it pulls up a blamk screen. What I need to do is find a way so I can place the existing data in my CMS. The existing database info I am integrating is built: include("php_ssi/configure.php"); include("php_ssi/db.php"); print "<div id=\"rightnav\">"; print "<h2> Announcements</h2>"; print "<p>"; $query = "select * from announcement WHERE end_date >= $todays_date LIMIT 1"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); if ($num_rows != "0") { include("shared/php/announcement/announce.php"); //announce.php inserted below <? include("php_ssi/configure.php"); include("php_ssi/db.php"); $todays_date = date("Ymd"); $announce_count = 0; $switch_color = 0; $query = "select * from announcement WHERE end_date >= $todays_date ORDER by date ASC;"; $result = mysql_query($query); $num_rows = mysql_num_rows($result); if ($num_rows != "0") { while ($row = mysql_fetch_array($result)) { $record_id = $row['record_id']; $title = $row['title']; $year = substr($date, 0, 4); $month = substr($date, 4, 2); $day = substr($date, 6, 2); $date = $month."-".$day."-".$year; $title = str_replace("&squot;", "'", $title); stripslashes($title); echo " $title <a href='/announcements/index.php?display_record=$record_id' target='_blank'>[More...]<br/></a> ________________________<br /> "; $announce_count++; } } ?> //announce.php ends } else if ($num_rows == "0"){ $announce_count=0; } print "</p>"; print "<h2> Surveys</h2>"; include("php_ssi/configure.php"); include("php_ssi/db.php"); include("shared/php/survey/survey.php"); print "</div>"; The only line I really need to worry about is the bolded: $title <a href='/announcements/index.php?display_record=$record_id' >[More...]<br/></a> //this produces the specific announcement I tried to make my CMS print it by using my method of <a href="index.php?content='/announcements/index.php?display_record=$record_id'> Which should place it in my index.php $content variable. However it is blank since I believe ??? because it already contains the index.php?display_record=$record_id' snippet. Any pointers on how to integrate the previous DB items into my $content would be awesome. If you go to the URL and click on the announcement you can see the terrible result which is occurring! Link to comment https://forums.phpfreaks.com/topic/91442-newbie-cms-problem/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.