Happy New Year, folks!
I am having an issue that’s been dragging my life for quite some time. I am creating a website for my church maranatha.tv.
The site’s Menu and Content are pulled from a MySQL database I created. As far as this goes, everything is fine; content is pulled from my database with no issues.
My problem is as follow:
I am including an online bible, which is a third party script I downloaded. This scripts come with its own database, which I have installed for use in my web server. I used Include() to include the index.php file of the online bible script, from its folder.
Of course, this script has its own folder and a set of files which makes up the entire bible script. I use an if condition so that when the user clicks on the menu button BIBLE, the bible index.php file is included instead of text from my database. This way of adding the third party script is rendering some unwanted results such as layout distortion (which I don’t care at this point), broken links (main issue), and links (although broken) are sent to new pages, instead of staying within my site’s template.
I need to find a way to make my script modular so everything renders as intended. Here’s my content function:
[php]
function content(){
// DETERMINE which page ID to USE in our query below ***************************************************
if (!isset($_GET['jesusid'])) {
$pageid = '1';
} else {
$pageid = preg_replace('#[^0-9]#i', '', $_GET['jesusid']);} // filter everything but numbers for security)
//preg_replace($pattern, $replacement, $string);//preg_replace() Function structure
// Query the body section for the proper page
$query = mysql_query ("SELECT body_text,title,linklabel, author FROM content WHERE id = '$pageid' LIMIT 1 ") or die (mysql_error());
while ($row = mysql_fetch_array($query)) {
echo ucwords($row[‘title’]).’ por ';
echo ‘’.$row[‘author’]. ‘
’;
echo ucwords($row['body_text']);
//Add Bible Script
if (ucwords($row[‘title’])==‘Biblia’) //use row title – UPPERCASED word
{
include (‘bible/__WINDOWS/search.php’);
}
}
}
?>
[/php]
Just click on the BIBLE button, and then on any link within that page and you will see what I mean. I am still learning PHP and I don’t have any background integrating external scripts to an existing database. I hope someone can help me. Thanks in advance for your assistance.