Jump to content

Debugging PHP script


iman

Recommended Posts

I think this is where part of my script is going wrong and think it might be line 3 but not sure. I am trying to get a service id (servid) from the service.

 

 

if (defined(strtoupper("MY_SERVICE_".$this->servid)))

    {

      $cname="my_service_$this->servid";

      $this->service=new $cname($this);

    }

    else

      $this->service=new my_service($this);

Link to comment
https://forums.phpfreaks.com/topic/38423-debugging-php-script/
Share on other sites

Thanks Project Fear, the $cname = "my_service_".$this->servid; seemed to work; however it didn't fix my problem and I think my problem is more complicated than I can fix here. I have several included that fetch data from the databases depending on the sites and their service id's and my global variables work (global is hardcoded) but my servid doesn't seem to work. Any of my dropdown selectors (data comes from the database based upon servid) based upon the service id are blank. Not sure what do do now because all of those sites have a form with empty drop downs...

 

Again, thanks for the help! :)

Link to comment
https://forums.phpfreaks.com/topic/38423-debugging-php-script/#findComment-184736
Share on other sites

Well the code is very complicated and it has a lot of nested scripts. There are local variables (menus) that are called from the db that populate dropdown selectors for each web site, then there are global variables like 'states' that can populate dropdown selectors across all of the sites. The global variables are working and the local variables are not because the code wants a servid and I think it cannot find one. If you go to www.myyachtcharters.com/find.php you will see global dropdowns populated. But if you select 'irie schooner'  from the results you will see that none of the local variables populated. Basically, this code was written over many years to speed the process 'to market' of building web sites with databases and form data and I am not sure it is something I can debug here but there is so much time, blood, sweat and tears invested that I wanted to try. I would be happy to provide additional information if this is something you think you can fix... or maybe you are just curious and want to solve a complex puzzle? The code has tons of debug lines everywhere but you have to be at a level in php that I am just not at yet.

Link to comment
https://forums.phpfreaks.com/topic/38423-debugging-php-script/#findComment-186811
Share on other sites

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.