navjak Posted April 25, 2007 Share Posted April 25, 2007 Hi Guyz!! Iam New to PHP and trying to generate a report for my project. Iam using php5.1.4 and Apache Server 2.0. I dont know where I have gone wrong and facing problem in executing the script. I could et the HTML output where the user can select his choice of report but the php script is not getting executed fully. I have attached my script below. All I could get is the echo statements at the begining of the php script. Iam not able to execute the script which is inside the class and functions. Please help me in this. Regards, Jaknav. Iam calling the file name in the browser. File Name: ABC.php <html> <body> <form action="<?php $PHP_SELF; ?>" method="post"> <table border="0" align="center" cellpadding="5" cellspacing="0"> <tr> <td align="right" valign="middle">BuildName:</td> <td> <select name="BuildName"> <option value="CRM89">CRM89</option> <option value="CIS88">CIS88</option> </select> </td> </tr> <tr> <td align="right" valign="middle">BuildType:</td> <td> <select name="BuildType"> <option value="STD">STANDARD</option> <option value="CODE">Code</option> </select> </td> </tr> </table> <input type="submit" /> </form> <?php set_time_limit(0); set_include_path(get_include_path() . PATH_SEPARATOR . dirname(__FILE__) . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "ScoobySnacks"); echo "include path = " . get_include_path() . "\n"; require_once("ScoobyScheduler.php"); class ScoobyBuildTypeAverageTime extends ScoobyScheduler { function BuildTypeAverageTime() { Statements 1 . . N $BuildName=$_POST['BuildName']; $BuildType=$_POST['BuildType']; echo "Build Name is {$_POST['BuildName']}"; echo "Build Type is {$_POST['BuildType']}"; if (!$this->BuildTypeAvgTimeByWeek($this->BuildClasses[$p],$BuildName,$BuildType)) { return false; } if (!$this->BuildTypeAvgTimeByMonth($this->BuildClasses[$p],$BuildName,$BuildType)) { return false; } if (!$this->BuildTypeAvgTimeByYear($this->BuildClasses[$p],$BuildName,$BuildType)) { return false; } } return true; } function BuildTypeAvgTimeByWeek($BuildClass,$BuildName,$BuildType) { Statements 1...n} function BuildTypeAvgTimeByMonth ($BuildClass,$BuildName,$BuildType) { Statements 1...n} function BuildTypeAvgTimeByYear ($BuildClass,$BuildName,$BuildType) { Statements 1...n} } # End of Class $SBATObject = new ScoobyBuildTypeAverageTime("BuildTypeAverageTime"); if ($SBATObject->rc > 0) { echo "Error constructing object SBATObject. Exiting.\n"; exit(1); } $SBATObject->BuildTypeAverageTime(); $SBATObject->Scooby->Log->WriteSectionHeader(Date("H:i:s") . " Finished", "Mediumpurple"); ?> </body> </html> Quote Link to comment Share on other sites More sharing options...
ToonMariner Posted April 25, 2007 Share Posted April 25, 2007 hmmm we somewhere in ther you will need $sched = new ScoobyBuildTypeAverageTime; after that you can access the methods using $sched->BuildTypeAverageTime(); and so on.... Quote Link to comment Share on other sites More sharing options...
btherl Posted April 26, 2007 Share Posted April 26, 2007 Try adding more echo statements until you find the exact location that execution stops. That may give you enough clues to fix it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.