Jump to content

[SOLVED] Body ID not being passed


devxtec

Recommended Posts

I have a PHP Script which uses a body id to to identify the data that needs to be loaded on the page, The body id is passed through the URL of the web page ( http://www.example.com/index.php?bod=22 ) This bod value is then picked up by the PHP script and used to pull the correct data from the MySQL database.

 

When I moved the website from a server running MySQL 4 & PHP 4 to a server running MySQL 5 & PHP 5 it broke the site. To verify that it was the bod ID not being passed I had the site echo out the current bod id when switching between pages. Each time it would echo out a blank value which the site then interprets to load up the default page content.

 

My question is would the bod id not being passed be an apache problem or a PHP issue?

 

Here is the index.php code which checks for the bod id.

 

<?php

require_once("DSI_website.php");

$site = new DSISite( "www.example.com", "localhost" );

 

if( isset($bod) )

        {

        $site->Generate_Page($bod);

        }

else

        {

        $site->Generate_Page();

        }

 

echo $site->page;

?>

 

And here is the Generate Page function.

 

Function Generate_Page( $page_index="default" ) {

                $this->page = "";

                $this->page .= $this->Start_Page();

                $this->page .= $this->Output_Header();

                $this->page .= $this->Output_Links();

                $this->page .= "<div id=\"sub\">\n";

                $this->page .= $this->Output_Ads();

                $this->page .= $this->Output_Body( $page_index );

                $this->page .= "</div>\n";

                $this->page .= $this->Output_Footer();

                $this->page .= $this->Finish_Page();

        }

 

Any help is greatly appreciated.  ;D

Link to comment
https://forums.phpfreaks.com/topic/117341-solved-body-id-not-being-passed/
Share on other sites

And the sad thing about this is register_globals were turned off in php 6 years ago in 2002 and no code should have been written after that point in time that relied on them being on. There are going to be a lot of unhappy people and a lot of work fixing code when php6 comes out.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.