iman Posted February 14, 2007 Share Posted February 14, 2007 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 More sharing options...
btherl Posted February 14, 2007 Share Posted February 14, 2007 What are you expecting to happen and what actually happens when you run this script? Link to comment https://forums.phpfreaks.com/topic/38423-debugging-php-script/#findComment-184341 Share on other sites More sharing options...
JasonLewis Posted February 14, 2007 Share Posted February 14, 2007 this looks a bit buggy to me. $cname="my_service_$this->servid"; try this instead: $cname = "my_service_".$this->servid; Link to comment https://forums.phpfreaks.com/topic/38423-debugging-php-script/#findComment-184389 Share on other sites More sharing options...
iman Posted February 14, 2007 Author Share Posted February 14, 2007 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 More sharing options...
JasonLewis Posted February 15, 2007 Share Posted February 15, 2007 so are you getting any other errors? Link to comment https://forums.phpfreaks.com/topic/38423-debugging-php-script/#findComment-185308 Share on other sites More sharing options...
iman Posted February 17, 2007 Author Share Posted February 17, 2007 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.