Jump to content

ScotDiddle

Members
  • Posts

    204
  • Joined

  • Last visited

    Never

Everything posted by ScotDiddle

  1. angelcool, When you right-click on your missing image and select Properties, it says that the image is: 10-network.net/yummy.jpg , but if you enter: http://10-network.net/yummy.jpg into a browser, you get 404: The requested URL /yummy.jpg was not found on this server. I would check test.php to see how you are building your <img element. Scot L. Diddle, Richmond VA
  2. NightSlyr, When all of the "for" loops had "i" as the var name, some would work, and some would not... It was never consistant, even if I made the same DHTML menu selections one test after another. Ones that "worked" on one pass may, or may not alert the same value for "i" on subsequent tests using the exact same user selections. Once I went to unique var names, I got the expected results every time. Here is my new Image() code: Thanks. Scot L. Diddle, Richmond VA <?php $getVariable = $_GET['variable']; $DHTMLResponseParm = $getVariable; $DHTMLResponseParmQuery = stristr($getVariable,'DHTMLResponse!'); if ($DHTMLResponseParmQuery) { // Make the passed DHTML Parm into something human-readable... $DHTMLPassedParmsPieces = explode('!', $DHTMLResponseParm); $DHTMLHeading = $DHTMLPassedParmsPieces[0]; $DHTMLData = $DHTMLPassedParmsPieces[1]; $DHTMLDataPieces = explode(',,', $DHTMLData); $newDHTMLArray = array(); foreach ($DHTMLDataPieces as $IDX => $DHTMLDataOut) { switch($IDX) { case 0; $newDHTMLArray[$IDX] = 'DBs%' . $DHTMLDataOut; break; case 1; $newDHTMLArray[$IDX] = '|SysIDs%' . $DHTMLDataOut; break; case 2; $newDHTMLArray[$IDX] = '|Metrics%' . $DHTMLDataOut; break; case 3; $newDHTMLArray[$IDX] = '|TransID%' . $DHTMLDataOut; break; case 4; $newDHTMLArray[$IDX] = '|DateRange%' . $DHTMLDataOut; break; case 5; $newDHTMLArray[$IDX] = '|UniqueDates%' . $DHTMLDataOut; break; case 6; $newDHTMLArray[$IDX] = '|Sort%' . $DHTMLDataOut; break; case 7; $newDHTMLArray[$IDX] = '|DataRestrictions%' . $DHTMLDataOut; break; case 8; $newDHTMLArray[$IDX] = '|DOW%' . $DHTMLDataOut; break; case 9; $newDHTMLArray[$IDX] = '|Month%' . $DHTMLDataOut; break; case 10; $newDHTMLArray[$IDX] = '|Year%' . $DHTMLDataOut; break; case 11; $newDHTMLArray[$IDX] = '|Documentation%' . $DHTMLDataOut; break; case 12; $newDHTMLArray[$IDX] = '|Reset%' . $DHTMLDataOut; break; } // END switch($IDX) { } //END foreach ($DHTMLDataPieces as $IDX => $DHTMLDataOut) { $getVariable = $DHTMLHeading . '!' . implode('', $newDHTMLArray); } // END if ($DHTMLResponseParmQuery) { $_SESSION['variable'] = $getVariable; if (stristr($getVariable,'@')) { $_SESSION['autoSuggestRestrictionVar'] = $_SESSION['variable']; } $userInputQuery = stristr($getVariable, 'DHTMLResponse!'); if ($userInputQuery) { $_SESSION['POST'] = $_SESSION['variable']; } require('placeParm.php'); // Go find out what to do with the incoming JS parm value... ?> and: pllaceParm.php: <?php $callingProgram = $_SESSION['callingProgram']; $passedJavascriptParm = $_SESSION['variable']; $autoSuggestParm = FALSE; $DHTMLProcessing = FALSE; switch ($callingProgram) { case 'autoSuggest.php' : $savePHPElements = $passedJavascriptParm; $PaamayimNekudotayimSearch = stristr($passedJavascriptParm,'::'); // Set around line 193 in 'include/AJAXAutoSuggest.php' if ($PaamayimNekudotayimSearch) { $passedJavascriptParm = explode('::', $passedJavascriptParm); } $passedJavascriptParm = $passedJavascriptParm[0]; $passedJavascriptParm = trim($passedJavascriptParm ); $tranIDOut = array(); $autoSuggestParm = TRUE; $currentArray = $_SESSION['autoSuggestTranIDs']; $deleteResults = deleteFromArray($currentArray, $passedJavascriptParm, FALSE); if (is_array($deleteResults)) { $returnedArray = $deleteResults; $_SESSION['autoSuggestTranIDs'] = $returnedArray; } $DHTMLResponseQuery = stristr($savePHPElements, 'DHTMLResponse!'); $radioButtonQuery = stristr($savePHPElements, 'DataRestrictionRadioButton'); $commaQuery = stristr($savePHPElements, ','); if ( (!$DHTMLResponseQuery) && (!$radioButtonQuery) && (!$commaQuery) ) { $_SESSION['usersSelectedTranID'][] = $savePHPElements; } break; case 'DHTMLViaArrayProcessing.php' : $DHTMLProcessing = TRUE; $savePHPElements = $passedJavascriptParm; $atSearch = stristr($passedJavascriptParm,'@'); // // Set in 'DHTMLViaArrayProcessing.php' around line 904 in function clk() { // // via : (javascript) // // case 'DataRestrictionRadioButton' : // userSelection = userSelectedItem + '@' + userSelectedValue; // break; // // Used to determine which direction the user restrictions travel... // if ($atSearch) { $passedJavascriptParm = explode('@', $passedJavascriptParm); $passedJavascriptParm = $passedJavascriptParm[1]; $passedJavascriptParm = trim($passedJavascriptParm ); $autoSuggestParm = TRUE; if($passedJavascriptParm == 1) { $currentArray = $_SESSION['autoSuggestRestrictionLimitTop']; } if($passedJavascriptParm == 2) { $currentArray = $_SESSION['autoSuggestRestrictionLimitLow']; } } $bangSearch = stristr($passedJavascriptParm,'!'); if ($bangSearch) { unset($_SESSION['DHTMLPassedParm']); $_SESSION['DHTMLPassedParm'] = $passedJavascriptParm; // Vis. : DHTMLResponse!1,0,0,0,,1,0,0,0,0,0,0,0,0,0,,1,0,0,0,0,0,,$_SESSION['TranIDs],,1,0,,1,0,,1,0,0,,$_SESSION['DataRestrictions], } break; case 'autoSuggestRestrictions.php' : $savePHPElements = $passedJavascriptParm; $asterixSearch = stristr($passedJavascriptParm,'*'); // // Set around line 180 in 'autoSuggestRestrictions.php' // // Vis.: passedVariable = 'restrictionLimit' + '*' + userSelectedRestrictionLimit[idx]; // // Used to save the user selected restriction for display on subsequent calls // to overLib display via "Show". // if ($asterixSearch) { $passedJavascriptParm = explode('*', $passedJavascriptParm); $passedJavascriptParm = $passedJavascriptParm[1]; $passedJavascriptParm = trim($passedJavascriptParm ); $_SESSION['autoSuggestRestrictionLimit'] = array(); $_SESSION['autoSuggestRestrictionLimit'][0] = $passedJavascriptParm; } break; } if ( (!$autoSuggestParm) && (!$DHTMLProcessing) ) { // Turn on to produce Error... // $passedJavascriptParm = 'Hi Mom'; $functionLine = __LINE__ + 2; $stristrResult1 = stristr($passedJavascriptParm,'SORT'); if ($stristrResult1) { // Then incoming param is a complex type, which must be broken down // into constituient components... $pieces = explode('@', $passedJavascriptParm); $passedJavascriptType = $pieces[0]; $passedJavascriptParm = $passedJavascriptType; } $switchResult = checkParm($passedJavascriptParm); if (!$switchResult) { $stristrResult2 = stristr($passedJavascriptParm, '~'); if ($stristrResult2) { // Then incoming param is a complex type, which must be broken down // into constituient components... $widthAndHeight = explode('~', $passedJavascriptParm ); foreach($widthAndHeight as $oneOrTheOther) { $pieces = explode('@', $oneOrTheOther); $lenghtOrWidth = $pieces[1]; $passedJavascriptParmArray[$pieces[1]][] = $pieces[0]; } $passedJavascriptParm = $passedJavascriptParmArray; } else { $stristrResult3 = stristr($passedJavascriptParm,'tableName'); if ($stristrResult3) { $pieces = explode('@', $passedJavascriptParm); $passedJavascriptParm = $pieces[0]; $_SESSION['selectedTable'] = $pieces[2]; $checkJavascriptParm = $passedJavascriptParm; switchOnPassedParmType($checkJavascriptParm,$whichParam = NULL); } } // If an array is the result of breaking down an incoming complex param, process each array item... if (is_array($passedJavascriptParm)) { foreach($passedJavascriptParm as $IDX => $javascriptParm) { if (($IDX == 'W') || ($IDX == 'H')) { $whichParam = $IDX; $checkJavascriptParm = $passedJavascriptParm[$IDX][0]; } if ($whichParam == 'W') { $_SESSION['javascriptScreenWidth'] = $passedJavascriptParm[$IDX][0]; } if ($whichParam == 'H') { $_SESSION['javascriptScreenHeight'] = $passedJavascriptParm[$IDX][0]; } } } } function switchOnPassedParmType($checkJavascriptParm,$whatTypeOfParamDoesSwitchHaveToDealWith) { $_SESSION['paramValue'] = $checkJavascriptParm; $_SESSION['paramType'] = $whatTypeOfParamDoesSwitchHaveToDealWith; $isInt = checkInt($checkJavascriptParm); if ($isInt) { $passedJavascriptParm = 'INT'; } else { $passedJavascriptParm = $checkJavascriptParm; } $functionLine = __LINE__ + 2; $switchResult = checkParm($passedJavascriptParm); if(!$switchResult) { $_SESSION['placeParmSwitchError'] = "UNKNOWN Javascript Parm (\$passedJavascriptParm :: $passedJavascriptParm) passed to PlaceParm.php...<br /><br />See Line : $functionLine in program 'placeParm.php'. The Parm came from the javascript function clk(param); in <br /><br /><ul><ul>'UpgfDateSelect.php' around Line 1960, and is fed in either<br /><br /><ul><ul>'UpgfDateSelect.php' or 'buildUIQuery.php' </ul></ul></ul></ul> \n"; } else { unset($_SESSION['placeParmSwitchError']); } } function checkInt($i) { // return 0 if not int and return 1 if $i is int if (ereg("^[0-9]+[.]?[0-9]*$", $i, $p)) { return 1; } else { return 0; } } } function checkParm($parameterToCheck) { $passedJavascriptParm = $parameterToCheck; switch($passedJavascriptParm) { case 'resetSession' : /** * * Set in 'include/UpgfMetricsCloseLevel1Window.php' * */ require('include/resetSession.php'); break; case 'INT' : if ($_SESSION['paramType'] == 'W') { $_SESSION['javascriptScreenWidth'] = $_SESSION['paramValue']; } if ($_SESSION['paramType'] == 'H') { $_SESSION['javascriptScreenHeight'] = $_SESSION['paramValue']; } break; case 'dateSelect' : case 'dateRange' : $_SESSION['javascriptDateParm'] = $passedJavascriptParm; break; case 'Internet Explorer' : case 'Firefox' : $_SESSION['usersBrowser'] = $passedJavascriptParm; break; case 'PDFYes' : $_SESSION['generatePDF'] = TRUE; break; case 'PDFNo' : $_SESSION['generatePDF'] = FALSE; break; case 'dateRangeTrue' : $_SESSION['dateRangeQuery'] = TRUE; break; case 'dateRangeFalse' : $_SESSION['dateRangeQuery'] = FALSE; break; case 'newTableSelected' : $selectedTable = $_SESSION['selectedTable']; $functionLine = __LINE__ + 2; switch($selectedTable) { case 'Tran_Count_By_Date' : $_SESSION['returnTrip'] = TRUE; $_SESSION['choosenSysIDTable'] = 'Tran_Count_Per_Hour_By_SysID'; $_SESSION['chooseSysIDTableChanged'] = TRUE; $_SESSION['indelibleTable'] = 'tran_count_by_date'; $_SESSION['indelibleDocFormat'] = 'tran_count_by_date'; $_SESSION['displayTableName'] = 'Tran_Count_Per_Hour_By_SysID'; $_SESSION['tableAlias'] = 'Tran_Count_Per_Hour_By_SysID'; $_SESSION['respTimeQueryBoolean'] = FALSE; break; case 'Tran_Response_Time_By_Date' : $_SESSION['returnTrip'] = TRUE; $_SESSION['choosenSysIDTable'] = 'Tran_Response_Time_By_Date'; $_SESSION['chooseSysIDTableChanged'] = TRUE; $_SESSION['indelibleTable'] = 'tran_count_by_date'; $_SESSION['indelibleDocFormat'] = 'tran_count_by_date'; $_SESSION['displayTableName'] = 'Tran_Response_Time_By_Date'; $_SESSION['tableAlias'] = 'Tran_Response_Time_By_Date'; $_SESSION['respTimeQueryBoolean'] = TRUE; break; case 'Transactions_By_Count' : $_SESSION['returnTrip'] = TRUE; $_SESSION['choosenSysIDTable'] = 'Tran_Count_Per_Day_By_TransID'; $_SESSION['chooseSysIDTableChanged'] = TRUE; $_SESSION['indelibleTable'] = 'transactions_by_count'; $_SESSION['indelibleDocFormat'] = 'transactions_by_count'; $_SESSION['displayTableName'] = 'Tran_Count_Per_Day_By_TransID'; $_SESSION['tableAlias'] = 'Tran_Count_Per_Day_By_TransID'; $_SESSION['respTimeQueryBoolean'] = FALSE; break; case 'Tran_Response_Time_By_TranID' : $_SESSION['returnTrip'] = TRUE; $_SESSION['choosenSysIDTable'] = 'Tran_Response_Time_By_TranID'; $_SESSION['chooseSysIDTableChanged'] = TRUE; $_SESSION['indelibleTable'] = 'transactions_by_count'; $_SESSION['indelibleDocFormat'] = 'transactions_by_count'; $_SESSION['displayTableName'] = 'tran_response_time_by_tranid'; $_SESSION['tableAlias'] = 'tran_response_time_by_tranid'; $_SESSION['respTimeQueryBoolean'] = TRUE; break; default : $varName = $selectedTable; if (!isset($varName)) { $varName = '*** Not Set ***'; } if (!$varName == NULL) { $varName = '*** Null ***'; } $_SESSION['errorTable'] = $selectedTable; $_SESSION['errorProgram'] = 'placeParm.php'; $_SESSION['chooseTableErrorBoolean'] = TRUE; $_SESSION['functionLine'] = $functionLine; break; } break; // The following case is true if the user hit the reset button // during 'UpgfMetricsDateSelectChoose.php processing... case 'chooseDateResetRequest' : $selectedTable = 'Transactions_By_Count'; $_SESSION['returnTrip'] = TRUE; $_SESSION['choosenSysIDTable'] = 'Transactions_By_Count'; $_SESSION['chooseSysIDTableChanged'] = TRUE; $_SESSION['indelibleTable'] = 'Transactions_By_count'; $_SESSION['indelibleDocFormat'] = 'Transactions_By_count'; $_SESSION['respTimeQueryBoolean'] = FALSE; $_SESSION['displayTableName'] = 'Transactions_By_count'; break; // The following case is true if the user hit the reset button // during 'UpgfMetricsDateSelect.php processing... case 'dateResetRequest' : $numberOfSysIDsChoosen = $_SESSION['countOfChoosenSysIDs']; if ($numberOfSysIDsChoosen > 1) { $_SESSION['patientsRequired'] = TRUE; } else { $_SESSION['patientsRequired'] = FALSE; } break; case 'AOR1' : if (!isset($_SESSION['AOR1Selected'])) { $_SESSION['AOR1Selected'] = TRUE; } else { $_SESSION['AOR1Selected'] = FALSE; } break; case 'AOR2' : if (!isset($_SESSION['AOR2Selected'])) { $_SESSION['AOR2Selected'] = TRUE; } else { $_SESSION['AOR2Selected'] = FALSE; } break; case 'AOR3' : if (!isset($_SESSION['AOR3Selected'])) { $_SESSION['AOR3Selected'] = TRUE; } else { $_SESSION['AOR3Selected'] = FALSE; } break; case 'AOR4' : if (!isset($_SESSION['AOR4Selected'])) { $_SESSION['AOR4Selected'] = TRUE; } else { $_SESSION['AOR4Selected'] = FALSE; } break; case 'AOR5' : if (!isset($_SESSION['AOR5Selected'])) { $_SESSION['AOR5Selected'] = TRUE; } else { $_SESSION['AOR5Selected'] = FALSE; } break; case 'AOR6' : if (!isset($_SESSION['AOR6Selected'])) { $_SESSION['AOR6Selected'] = TRUE; } else { $_SESSION['AOR6Selected'] = FALSE; } break; case 'AOR7' : if (!isset($_SESSION['AOR7Selected'])) { $_SESSION['AOR7Selected'] = TRUE; } else { $_SESSION['AOR7Selected'] = FALSE; } break; case 'FAF1' : if (!isset($_SESSION['FAF1Selected'])) { $_SESSION['FAF1Selected'] = TRUE; } else { $_SESSION['FAF1Selected'] = FALSE; } break; case 'ODM1' : if (!isset($_SESSION['ODM1Selected'])) { $_SESSION['ODM1Selected'] = TRUE; } else { $_SESSION['ODM1Selected'] = FALSE; } break; case 'AOR1' : if (!isset($_SESSION['AOR1Selected'])) { $_SESSION['AOR1Selected'] = TRUE; } else { $_SESSION['AOR1Selected'] = FALSE; } break; default : $switchResult = FALSE; return $switchResult; break; } $switchResult = TRUE; return $switchResult; } function deleteFromArray(&$array, $deleteIt, $useOldKeys = FALSE) { $key = array_search($deleteIt,$array,TRUE); if($key === FALSE) { return FALSE; } unset($array[$key]); if(!$useOldKeys) { $array = array_values($array); } return $array; } ?>
  3. mark110384, The thing to remember is that PHP has the first crack at the rendering of the html page. You can do anything you want with PHP, including writing JS code. Cut-n-paste the following into a PHP-ready server and you will see. Good luck. Scot L. Diddle, Richmond VA <?php /** * * Hard-coded PHP value assignment in JS * */ $image = '../images/mk2002_thumbnail.bmp'; $sp = ' '; $content = array(); $content[0] = 'Space'; $content[1] = 'Content - Expand to fit whole area'; $content[2] = 'more content info'; ?> <script type="text/javascript"> sts_ai("i0",[1,"<table border =\"1\" width=\"210\" height=\"150\" cellpadding=\"0\" cellspacing=\"0\" style=\"font-size:11px; font-family:Verdana; margin:5px;\">\r\n <tr>\r\n <td width=\"91\" rowspan=\"12\" class=\"STYLE10\"> <img src=\" <?php echo $image; ?> \" alt=\"\" name=\"p\" width=\"81\" height=\"73\" id=\"p\" /></td>\r\n <td width=\"300\" class=\"STYLE10\"> <?php echo $sp; ?> </td>\r\n </tr>\r\n <tr>\r\n <td><a href=\"#\" style=\"color:#000000\"><strong style=\"color:#0000FF\">Item Title </strong>[/url] </td>\r\n </tr>\r\n \r\n <tr>\r\n <td> <?php echo $content[0]; ?> </td>\r\n </tr>\r\n <tr>\r\n <td> <?php echo $content[1]; ?> </td>\r\n </tr>\r\n <tr>\r\n <td> <?php echo $content[2]; ?> </td>\r\n </tr>\r\n <tr>\r\n <td> <?php echo $sp; ?> </td>\r\n </tr>\r\n \r\n</table>"],[],"i0","i0"); </script> <?php /** * * PHP from Loop: JS Example... * */ $somePHPArray = array(); $somePHPArray = range(1,12); echo "<script type=\"text/javascript\"> \n"; for ($i = 0; $i < count($somePHPArray); $i++) { echo "alert('Array Item Value for IDX : ' + '$i' + ' = ' + '" . $somePHPArray[$i] . "'); \n "; } echo "</script> \n"; /** * * PHP from Loop: HTML Example... * */ /* Output: row 1 1 2 3 row 2 4 5 6 row 3 7 8 9 row 4 10 11 12 */ $somePHPArray = array(); $somePHPArray = range(1,12); $rowCount = 1; echo "\t<table border =\"1\" width=\"210\" height=\"150\" cellpadding=\"0\" cellspacing=\"0\" style=\"font-size:11px; font-family:Verdana; margin:5px;\">\r\n \n"; foreach($somePHPArray as $IDX => $arrayItemValue) { $modulo = $IDX % 3; if ($modulo === 0) { // Only 3 items per row ( besides the "Row Count" Identifier ) if ($IDX > 0) { // don't write closeing </tr> on first pass... echo "\t\t</tr> \n"; } echo "\t\t<tr> \n"; echo "\t\t\t<td style=\"padding: 5,5,5,5;\"> \n"; echo "\t\t\t\trow " . $rowCount . " \n"; // Once per row $rowCount++; } echo "\t\t\t<td style=\"padding: 5,5,5,5;\"> \n"; echo "\t\t\t\t$arrayItemValue \n"; echo "\t\t\t</td> \n"; } echo "\t</table> "; ?>
  4. Nightsslyr, Thanks for taking the time to respond... My application is interacting with the ZZEE DHTML Menu ( http://www.zzee.com/dhtml-menu/ ) Here is the code where I tried to pass JS parms to PHP... this version concatenates all known values, and sends 'em off once... The original code called: "clk()" for each hit case statement, then alerted that var so-and-so had just sent to PHP. In that scenario, Zend Studio debugger showed one call to transferJSParmToPHP.php, and while it was processing, I got alerts from the rest of the column case statements, and it never called "clk()" again. /** * * See what the user has been up too... * */ function returnChecked() { /* * * Grab the user submitted values and send 'em off to PHP for subsequent processing. * */ // // totalNumberOfColumns set around line 130 in this program. // /** * * Once for each column. * */ for (column = 0; column < totalNumberOfColumns; column++) { // alert (column); // Vis. : 16 checkedIDX = 0; // For each Column, Start with the first child. booleanResponseCount[column] = new Array(); // Create 2nd array level... // Once for each child // Odd column numbers are heading spacers... if (column == 6) { // Tran IDs ( Data Entry ) childCount[column] = 1; // This is a lie... } if (column == 24) { // Reset ( Data Entry ) childCount[column] = 1; // This is a lie... } for (child = 0; child < childCount[column]; child++) { // alert (column); switch (column) { case 0 : checkedBoolean = DBs[child].getChecked(); colText = 'DBs'; break; case 2 : checkedBoolean = SysIDs[child].getChecked(); colText = 'SysIDs'; break; case 4 : checkedBoolean = Metrics[child].getChecked(); colText = 'Metrics'; break; case 6 : checkedBoolean = '$SESSION[\'TranID\']'; colText = 'TranIDs'; break; case 8 : checkedBoolean = DateRangeBoolean[child].getChecked(); colText = 'DateRangeBoolean'; break; case 10 : checkedBoolean = UniqueDateBoolean[child].getChecked(); colText = 'UniqueDateBoolean'; break; case 12 : checkedBoolean = SortOrder[child].getChecked(); colText = 'SortOrder'; break; case 14 : checkedBoolean = DataRestrictions[child].getChecked(); colText = 'DataRestrictions'; break; case 16 : checkedBoolean = DOW[child].getChecked(); colText = 'DOW'; break; case 18 : checkedBoolean = Month[child].getChecked(); colText = 'Month'; // alert(checkedBoolean); break; case 20 : checkedBoolean = Year[child].getChecked(); colText = 'Year'; break; case 22 : checkedBoolean = Documentation[child].getChecked(); colText = 'Documentation'; break; case 24 : checkedBoolean = '$SESSION[\'Reset\']' colText = 'Reset'; break } // Let's see what our childern are up too... // alert ('Col : ' + colText + ' Child: ' + child + ' Boolean : ' + checkedBoolean); booleanResponseCount[column][checkedIDX] = checkedBoolean; checkedIDX++; } // END for (child = 0; child < childCount[column]; child++) { } // END for (column = 0; column < totalNumberOfColumns; column++) { for(i in booleanResponseCount) { if (i == (totalNumberOfColumns -1)) { // alert(booleanResponseCount); // Vis. : 1,0,0,0,,1,0,0,0,0,0,0,0,0,,1,0,0,0,0,0,,$SESSION['TranID'],,1,0,,1,0,,1,0,0,,1,0,0,,1,0,0,0,0,0,0,0,,1,0,0,0,0,0,0,0,0,,1,0,0,,1,0,0,,$SESSION['Reset'], // Col 1 : 1,0,0,0,, // Col 2 : 1,0,0,0,0,0,0,0,0,, // Col 3 : 1,0,0,0,0,0,, // Col 4 : $SESSION['TranID'],, // Col 5 : 1,0,, // Col 6 : 1,0,, // Col 7 : 1,0,0,, // Col 8 : 1,0,0,, // Col 9 : 1,0,0,0,0,0,0,0,, // Col 10 : 1,0,0,0,0,0,0,0,0,, // Col 11 : 1,0,0,, // Col 12 : 1,0,0,, // Col 13 : $SESSION['Reset'], clk('DHTMLResponse', booleanResponseCount) ; } } } // END function returnChecked() { /* * * END post-submit processing * */ /** * * Pass the user's selection to PHP for subsequent decison making... * */ function clk(itemIn,valueIn) { userSelectedItem = itemIn; userSelectedValue = valueIn; switch(userSelectedItem) { case 'DataRestrictionRadioButton' : userSelection = userSelectedItem + '@' + userSelectedValue; break; case 'DHTMLResponse' : userSelection = userSelectedItem + '!' + userSelectedValue; break; default : userSelection = userSelectedItem + '^' + userSelectedValue; break; } // alert(userSelectedValue); passParm = new Image(); iURL="transferJSParamToPHP.php?variable=" + userSelection; passParm.src=iURL; // transferJSParamToPHP.php parses the userSelection and sets // processing instruction via php switch statement... } For my "for (i= ..." issue, here is the relevant code... I used to have each "for" staement like this: "for (i=0; i <= (childCount[colIDX] - 1); i++) {" An alert(i) returned random numbers, but ususally "3"; I found it curious that colIDX was always correct internal to the "for" statements, even though I use the same var name for each loop. /** * * Database Selections column 1 Processing * */ DBs = []; colIDX = 0; /** * * Once for each Database * * */ for (a=0; a <= (childCount[colIDX] - 1); a++) { DBs[a] = menu[menuIDX].getItem([colIDX, a]); DBs[a].setRadio(0); DBs[a].onclick = function() { // this.setChecked(!this.getChecked()); this.setChecked(true); }; // We need to set the initial state of the checkbox item DBs[a].setChecked(false); }; // Default for DB Selection: DBs[0].setChecked(true); /** * * SysIDs column 2 Processing * */ SysIDs = []; colIDX = 2; /** * * SysIDs[<?php echo $SysIDLast; ?>] = 'ALL' * * (currently : 9) * * :: When clicked, we need to turn off all SysIDs's * already selected. * */ // Set up SysIDs[9] first, because it will be referenced immediately... // Set up the last SysID <?php $SysIDLast = $_SESSION['SysIDCount'] - 1; $countOfPreviousSysIDs = $_SESSION['SysIDCount'] - 2; ?> allOff = ''; SysIDChildCount = <?php echo $countOfPreviousSysIDs ; ?> SysIDs[<?php echo $SysIDLast; ?>] = menu[menuIDX].getItem([colIDX, <?php echo $SysIDLast; ?>]); SysIDs[<?php echo $SysIDLast; ?>].setRadio(1); SysIDs[<?php echo $SysIDLast; ?>].onclick = function() { this.setChecked(!this.getChecked()); if (this.getChecked()) { // Here we see if any other SysIDs's have previously been selected, // and turn them off if they have been. for (b = 0; b <= <?php echo $countOfPreviousSysIDs; ?>; b++) { // Re-set the initial state of the checkbox item SysIDs[b].setChecked(true); } // END: for (b=0; b<=$countOfPreviousSysIDs; b++) { } // END: if (this.getChecked()) { else { // User turned off the "ALL" button... Resest other buttons to default for (b=0; b<=<?php echo $countOfPreviousSysIDs; ?>; b++) { // Re-set the initial state of the checkbox item SysIDs[b].setChecked(false); } // END: for (b=0; b<= $countOfPreviousSysIDs; b++) { SysIDs[0].setChecked(true); } returnChecked(); // See what the user did and save if for post-submit processing. }; // END: SysIDs[9].onclick = function() { /** * * Once for each SysIDs * * */ for (c = 0; c<=<?php echo $countOfPreviousSysIDs; ?>; c++) { SysIDs[c] = menu[menuIDX].getItem([colIDX, c]); SysIDs[c].onclick = function() { this.setChecked(!this.getChecked()); if ( SysIDs[<?php echo $countOfPreviousSysIDs; ?> + 1].getChecked()) { SysIDs[c - 1].setChecked(false); } searchResult = checkSysIDs(SysIDChildCount); // Don't let the user leave things blank... if (searchResult == 'All Off') { SysIDs[0].setChecked(true); } allOff = ''; returnChecked(); // See what the user did and save it for post-submit processing. }; // We need to set the initial state of the checkbox item SysIDs[c].setChecked(false); } // Select at least one SysIDs... SysIDs[0].setChecked(true); /** * * Metric Selections column 3 Processing * */ Metrics = []; colIDX = 4; /** * * Once for each Metric * * */ for (d = 0; d <= (childCount[colIDX] - 1); d++) { Metrics[d] = menu[menuIDX].getItem([colIDX, d]); Metrics[d].setRadio(2); Metrics[d].onclick = function() { this.setChecked(!this.getChecked()); // Don't let the user leave things blank... if ( (Metrics[0].getChecked() == false ) && (Metrics[1].getChecked() == false ) && (Metrics[2].getChecked() == false ) && (Metrics[3].getChecked() == false ) && (Metrics[4].getChecked() == false ) && (Metrics[5].getChecked() == false ) ) { Metrics[0].setChecked(true); } returnChecked(); // See what the user did and save it for post-submit processing. }; // We need to set the initial state of the checkbox item Metrics[d].setChecked(false); }; // Default for Metrics Selection: Metrics[0].setChecked(true); /** * * Trans ID column 4 Processing * */ /** * * // Trans ID overLib Caption fits here. * * Trans ID Processing takes place in : 'javascript/UpgfDHTMLMenuGenerator.js' * * in function: ZZME.prototype.mover=function(ev) { * * as a call to : overLibDisplay(currentColumn); * * where currentColumn is defined as: this.caption * * colIDX = 6; * */ /** * * Date Range column 5 Processing * */ /** * * Once for each Metric Date Range Radio button (Two: Yes or No) * * */ DateRangeBoolean = []; colIDX = 8; for (e = 0; e <= (childCount[colIDX] - 1); e++) { DateRangeBoolean[e] = menu[menuIDX].getItem([colIDX, e]); DateRangeBoolean[e].setRadio(3); DateRangeBoolean[e].onclick = function() { this.setChecked(!this.getChecked()); // Don't let the user leave things blank... if ( (DateRangeBoolean[0].getChecked() == false ) && (DateRangeBoolean[1].getChecked() == false ) ) { DateRangeBoolean[0].setChecked(true); } returnChecked(); // See what the user did and save it for post-submit processing. }; // We need to set the initial state of the checkbox item DateRangeBoolean[e].setChecked(false); }; // Default for DateRangeBoolean Selection: DateRangeBoolean[0].setChecked(true) /** * * Unique Date column 6 Processing * */ /** * * Once for each Date Uniqueness Query Range Radio buttons (Two: true or false) * * */ UniqueDateBoolean = []; colIDX = 10; for (f = 0; f <= (childCount[colIDX] - 1); f++) { UniqueDateBoolean[f] = menu[menuIDX].getItem([colIDX, f]); UniqueDateBoolean[f].setRadio(4); UniqueDateBoolean[f].onclick = function() { this.setChecked(!this.getChecked()); // Don't let the user leave things blank... if ( (UniqueDateBoolean[0].getChecked() == false ) && (UniqueDateBoolean[1].getChecked() == false ) ) { UniqueDateBoolean[0].setChecked(true); } returnChecked(); // See what the user did and save it for post-submit processing. }; // We need to set the initial state of the checkbox item UniqueDateBoolean[f].setChecked(false); }; // Default for UniqueDateBoolean Selection: UniqueDateBoolean[0].setChecked(true); /** * * Sort column 7 Processing * */ /** * * Once for each SortOrder Option Radio Button ( Three to choose from ) * * */ SortOrder = []; colIDX = 12; for (g = 0; g <= (childCount[colIDX] - 1); g++) { SortOrder[g] = menu[menuIDX].getItem([colIDX, g]); SortOrder[g].setRadio(5); SortOrder[g].onclick = function() { this.setChecked(!this.getChecked()); // Don't let the user leave things blank... if ( (SortOrder[0].getChecked() == false ) && (SortOrder[1].getChecked() == false ) && (SortOrder[2].getChecked() == false ) ) { SortOrder[0].setChecked(true); } returnChecked(); // See what the user did and save it for post-submit processing. }; // We need to set the initial state of the checkbox item SortOrder[g].setChecked(false); }; // Default for SortOrder Selection: SortOrder[0].setChecked(true); /** * * Data Restrictions column 8 Processing * */ /** * * Once for each Data Restriction Option Radio Button ( Three to choose from ) * */ DataRestrictions = []; colIDX = 14; for (h = 0; h <= (childCount[colIDX] - 1);h++) { DataRestrictions[h] = menu[menuIDX].getItem([colIDX, h]); DataRestrictions[h].setRadio(6); DataRestrictions[h].onclick = function() { this.setChecked(!this.getChecked()); /* * * Send off the user's selection to PHP so we can decide later, * * (in AJAXAutoSuggest.php) which array of values we present to the user. * * case 'TopX' : * $dataArrayIn = $topX; * break; * * case 'LowX' : * $dataArrayIn = $lowX; * break * */ if (DataRestrictions[1].getChecked() == true) { clk('DataRestrictionRadioButton', 1); } if (DataRestrictions[2].getChecked() == true) { clk('DataRestrictionRadioButton', 2); } // Debug toggle: debug = false; if(debug) { // alert('Debug Mode'); } // Turn on overLib if user is requesting limits... if ( (DataRestrictions[1].getChecked() == true) || (DataRestrictions[2].getChecked() == true) ) { if (DataRestrictions[1].getChecked() == true) { if (debug) { // Eliminate MOUSEOFF parm... return overlib('', SRC, 'autoSuggestRestrictions.php', TIMEOUT, 4500, CAPTION, '<font color=#F6F9F9> High Range Limit </font><br/><br/>', CAPTIONSIZE, '9px', WIDTH, 440, HEIGHT, 420, STICKY, CENTER, WRAP, FIXX, 496, FIXY, 38, FGCOLOR, '#F6F9F9', BGCOLOR, 'GREEN', CLOSECOLOR, '#F6F9F9', NOBORDER, VAUTO, FOLLOWSCROLL, CLOSECOLOR, '#F6F9F9', CLOSETEXT, '<font="verdana" size="12px"><stong>X</font></strong><br /><br/>' ); } else { return overlib('', SRC, 'autoSuggestRestrictions.php', TIMEOUT, 4500, CAPTION, '<font color=#F6F9F9> High Range Limit </font><br/><br/>', CAPTIONSIZE, '9px', WIDTH, 440, HEIGHT, 420, STICKY, CENTER, WRAP, FIXX, 496, FIXY, 38, FGCOLOR, '#F6F9F9', BGCOLOR, 'GREEN', CLOSECOLOR, '#F6F9F9', NOBORDER, VAUTO, MOUSEOFF, FOLLOWSCROLL, CLOSECOLOR, '#F6F9F9', CLOSETEXT, '<font="verdana" size="12px"><stong>X</font></strong><br /><br/>' ); } } if (DataRestrictions[2].getChecked() == true) { if (debug) { // Eliminate MOUSEOFF parm... return overlib('', SRC, 'autoSuggestRestrictions.php', TIMEOUT, 4500, CAPTION, '<font color=#F6F9F9> Low Range Limit </font><br/><br/>', CAPTIONSIZE, '9px', WIDTH, 440, HEIGHT, 420, STICKY, CENTER, WRAP, FIXX, 496, FIXY, 38, FGCOLOR, '#F6F9F9', BGCOLOR, 'GREEN', CLOSECOLOR, '#F6F9F9', NOBORDER, VAUTO, FOLLOWSCROLL, CLOSECOLOR, '#F6F9F9', CLOSETEXT, '<font="verdana" size="12px"><stong>X</font></strong><br /><br/>' ); } else { return overlib('', SRC, 'autoSuggestRestrictions.php', TIMEOUT, 4500, CAPTION, '<font color=#F6F9F9> Low Range Limit </font><br/><br/>', CAPTIONSIZE, '9px', WIDTH, 440, HEIGHT, 420, STICKY, CENTER, WRAP, FIXX, 496, FIXY, 38, FGCOLOR, '#F6F9F9', BGCOLOR, 'GREEN', CLOSECOLOR, '#F6F9F9', NOBORDER, VAUTO, MOUSEOFF, FOLLOWSCROLL, CLOSECOLOR, '#F6F9F9', CLOSETEXT, '<font="verdana" size="12px"><stong>X</font></strong><br /><br/>' ); } } } // Don't let the user leave things blank... if ( (DataRestrictions[0].getChecked() == false ) && (DataRestrictions[1].getChecked() == false ) && (DataRestrictions[2].getChecked() == false ) ) { DataRestrictions[0].setChecked(true); } returnChecked(); // See what the user did and save it for post-submit processing. }; // We need to set the initial state of the checkbox item DataRestrictions[h].setChecked(false); }; // Default for DataRestrictions Selection: DataRestrictions[0].setChecked(true) /** * * DOW column 9 Processing * */ /** * * Once for each DOW Option Radio Button ( Eight to choose from ) * * */ DOW = []; colIDX = 16; for (i = 0; i <= (childCount[colIDX] - 1); i++) { DOW[i] = menu[menuIDX].getItem([colIDX, i]); DOW[i].setRadio(7); DOW[i].onclick = function() { this.setChecked(!this.getChecked()); // Don't let the user leave things blank... if ( (DOW[0].getChecked() == false ) && (DOW[1].getChecked() == false ) && (DOW[2].getChecked() == false ) && (DOW[3].getChecked() == false ) && (DOW[4].getChecked() == false ) && (DOW[5].getChecked() == false ) && (DOW[6].getChecked() == false ) && (DOW[7].getChecked() == false ) ) { DOW[0].setChecked(true); } returnChecked(); // See what the user did and save it for post-submit processing. }; // We need to set the initial state of the checkbox item DOW[i].setChecked(false); }; // Default for SortOrder Selection: DOW[0].setChecked(true); /** * * Month column 10 Processing * */ /** * * Once for each Month Option Radio Button ( 13 to choose from ) * * */ Month = []; colIDX = 18; allOff = ''; monthChildCount = childCount[colIDX]; for (j = 0; j <= (childCount[colIDX] - 1); j++) { Month[j] = menu[menuIDX].getItem([colIDX, j]); Month[j].setRadio(; Month[j].onclick = function() { checkedResult = this.setChecked(!this.getChecked()); // Don't let the user leave things blank... searchResult = checkMonths(monthChildCount); if (searchResult == 'All Off') { Month[0].setChecked(true); } allOff = ''; returnChecked(); // See what the user did and save it for post-submit processing. }; // We need to set the initial state of the checkbox item Month[j].setChecked(false); }; // Default for Month Selection: Month[0].setChecked(true); /** * * Year column 11 Processing * */ /** * * Once for each Year Option Radio Button ( Number to choose from Varies ) * * */ Year = []; colIDX = 20; currentChildCount = childCount[colIDX]; allOff = ''; for (k = 0; k <= (childCount[colIDX] - 1); k++) { Year[k] = menu[menuIDX].getItem([colIDX, k]); Year[k].setRadio(9); Year[k].onclick = function() { this.setChecked(!this.getChecked()); // Don't let the user leave things blank... searchResult = checkYears(currentChildCount); if (searchResult == 'All Off') { Year[0].setChecked(true); } allOff = ''; returnChecked(); // See what the user did and save it for post-submit processing. }; // We need to set the initial state of the checkbox item Year[k].setChecked(false); }; // Default for SortOrder Selection: Year[0].setChecked(true); /** * * Documentation column 12 Processing * */ /** * * Once for each Documentation Option Radio Button ( 3 to choose from ) * * */ Documentation = []; colIDX = 22; for (l = 0; l <= (childCount[colIDX] - 1); l++) { Documentation[l] = menu[menuIDX].getItem([colIDX, l]); Documentation[l].setRadio(10); Documentation[l].onclick = function() { this.setChecked(!this.getChecked()); // Don't let the user leave things blank... if ( (Documentation[0].getChecked() == false ) && (Documentation[1].getChecked() == false ) && (Documentation[2].getChecked() == false ) ) { Documentation[0].setChecked(true); } returnChecked(); // See what the user did and save it for post-submit processing. }; // We need to set the initial state of the checkbox item Documentation[l].setChecked(false); }; // Default for SortOrder Selection: Documentation[0].setChecked(true); /** * * Reset column 13 Processing * */ /** * * No Children * * */ Reset = []; colIDX = 24; /** * * END DHTML Menu Generation * */ Just for giggles, here is the code which instantiates the ZZEE DHTML Menu : It lies just before the previous code /** * * 'include/metricsMenu.js' * * Called from 'DHTMLViaArrayProcessing.php' around line 354 as a PHP require include. * * Used to set up the initial DHTML JS Menu for the user interface. * */ /** * * Add Items to the new menu... * */ menu[menuIDX].addItems([ // Menu Col IDX : 0 -> Menu Item 1 {caption: "DB", subitems: [ // Here go the subitems of First. You can define subitems for any menu item. // Subitems syntax is absolutely the same as the syntax for "addItems" call: // you need to pass an array of objects. {caption: "CICS"}, {caption: "MVS", en: false}, {caption: "DB2", en: false}, {caption: "LINUX", en: false} ]}, // Separator Menu Col IDX : 1 {caption: "-"}, // Menu Col IDX : 2 -> Menu Item 2 {caption: "SysIDs", subitems: [ // // {caption: "AOR1"}, // Check box.. // {caption: "AOR2"}, // Check box.. // {caption: "AOR3"}, // Check box.. // {caption: "AOR4"}, // Check box.. // {caption: "AOR5"}, // Check box.. // {caption: "AOR6"}, // Check box.. // {caption: "AOR7"}, // Check box.. // {caption: "FAF1"}, // Check box.. // {caption: "ODM1"}, // Check box.. // {caption: "ALL"} // Radio button... If on, all SysID check boxes are turned off. // // If turn off after having been turned on, // // Item 0 will be turned on.... <?php foreach($_SESSION['SysIDJS'] as $IDX => $SysIDCaption) { if ($IDX === 0) { $SysIDCaptionOut = "\t" . $SysIDCaption . "\n"; } else { $SysIDCaptionOut = "\t\t" . $SysIDCaption . "\n"; } echo $SysIDCaptionOut; } ?> ]}, // Separator Menu Col IDX : 3 {caption: "-"}, // Menu Col IDX : 4 -> Menu Item 3 {caption: "Metrics", subitems: [ // Here go the subitems of First. You can define subitems for any menu item. // Subitems syntax is absolutely the same as the syntax for "addItems" call: // you need to pass an array of objects. {caption: "1 : Hourly Tran Count by SysID"}, {caption: "2 : Tran Response Time By SysID"}, {caption: "3 : Hourly Tran CPU Utilization By SysID (Under Construction)", en: false}, {caption: "4 : Tran Count By TranID"}, {caption: "5 : Tran Response Time By TranID"}, {caption: "6 : Tran CPU Utilization By TranID (Under Construction)", en: false} ]}, // Separator Menu Col IDX : 5 {caption: "-"}, /** * * Tran IDs : Menu Col IDX : 6 -> Menu Item 4 * * No Childern: Input Box * * overLib Loaded: autoSuggest.php * */ {caption: "Tran IDs"}, // Separator Menu Col IDX : 7 {caption: "-"}, /** * * Date Range Boolean Query : Menu Col IDX : 8 -> Menu Item 5 * */ {caption: "Date Range", subitems: [ {caption: "No"}, {caption: "Yes"} ]}, // Separator Menu Col IDX : 9 {caption: "-"}, /** * * Unique Date Boolean Query : Menu Col IDX : 10 -> Menu Item 6 * */ {caption: "Unique Dates", subitems: [ {caption: "No"}, {caption: "Yes"} ]}, // Separator Menu Col IDX : 11 {caption: "-"}, /** * * Sort Query : Menu Col IDX : 12 -> Menu Item 7 * */ {caption: "Sort", subitems: [ {caption: "Tran ID"}, {caption: "Low To High"}, {caption: "High To Low"} ]}, // Separator Menu Col IDX : 13 {caption: "-"}, /** * * Data Restrictions : Menu Col IDX : 14 -> Menu Item 8 * * Three Childern, two of which call an input box * * overLib Loaded: autoSuggestRestriction.php * */ {caption: "Data Restrictions", subitems: [ {caption: "No Restrictions"}, {caption: "Top \"x\""}, {caption: "Low \"x\""} ]}, // Separator Menu Col IDX : 15 {caption: "-"}, /** * * Day of Week Query : Menu Col IDX : 16 -> Menu Item 9 * */ {caption: "DOW", subitems: [ {caption: "N/A"}, {caption: "Mon"}, {caption: "Tue"}, {caption: "Wed"}, {caption: "Thu"}, {caption: "Fri"}, {caption: "Sat"}, {caption: "Sun"} ]}, // Separator Menu Col IDX : 17 {caption: "-"}, /** * * DB Calls generates the following two PHP values ($monthJS and $yearJS) * * ( Line: 97 in : 'DHTMLViaArrayProcessing.php' ) * */ /** * * Month Query : Menu Col IDX : 18 -> Menu Item 10 * */ {caption: "Month", subitems: [ <?php foreach($_SESSION['monthJS'] as $IDX => $monthCaption) { if ($IDX === 0) { $monthCaptionOut = "\t" . $monthCaption . "\n"; } else { $monthCaptionOut = "\t\t" .$monthCaption . "\n"; } echo $monthCaptionOut; } ?> ]}, // Separator Menu Col IDX : 19 {caption: "-"}, /** * * Year Query : Menu Col IDX : 20 -> Menu Item 11 * */ {caption: "Year", subitems: [ <?php foreach($_SESSION['yearJS'] as $IDX => $yearCaption) { if ($IDX === 0) { $yearCaptionOut = "\t" . $yearCaption . "\n"; } else { $yearCaptionOut = "\t\t" . $yearCaption . "\n"; } echo $yearCaptionOut; } ?> ]}, // Separator Menu Col IDX : 21 {caption: "-"}, /** * * Documentation Query : Menu Col IDX : 22 -> Menu Item 12 * */ {caption: "Documentation", subitems: [ {caption: "User Interface"}, {caption: "Programming"}, {caption: "Graph OOP"} ]}, // Separator Menu Col IDX : 23 {caption: "-"}, /** * * Rest : Menu Col IDX : 24 -> Menu Item 13 * */ {caption: "Reset"}, // Separator Menu Col IDX : 25 {caption: "-"} ]);
  5. Hi All, Too bad javascript is necessary to learn and hard to master. Q1: Why doesn't JS executed sequentially ? I have a JS application loop which is supposed to pass vars to PHP via new Image(), then alert the success of the transfer for each of the items in an array. Only the first var gets past to PHP, and while it is doing it's PHP thing, I receive alerts for all of the remaining vars. Q2. Why doesn't JS keep track of var name "i" in for(i=0; i<= someMaxLimit; i++) {} loops. Sounds crazy, I know... I have the aforementioned JS application which has about 13 different "for" loops, each has an alert showing the value of the array item, and the index being processed. ( "i" ). I used "i" for all of them, but the alert for "i" returns a value which is all over the map, but never larger than the largest "someMaxLimit" value. The only way I could get consistant, reliable results was to use: for (a=0; a<=maxValueForA; a++) {} --> b,c,d,e... for (m=0; m<=maxValueForM; m++) {} When I used a unique value for the index in each "for" loop, the alert for the index always returned the value I was expecting. The only explantion I could come up with for this behaivour goes back to Q1; It looks like JS doen't execute it's statements sequentially. Are the any noob tutorials out there that explain HOW JS works, rather than one on structure and syntax ? So far, I haven't found the right set of key words to enter into Google. I didn't officailly start this as a rant, but here goes: [/rant] Thanks in advance. Scot L. Diddle, Richmond VA
  6. Discomatt, You 'da Man !!!. Everyone who has trouble with PHP mail returning "false" should read this thread, and follow your links. My mail() function now work ! Thank-you very much. Scot L. Diddle, Richmonc VA
  7. Discomatt, I thought about that as well... Where is the "Apache/PHP" user defined ? ps -ef shows: nobody 11599 11183 0 11:44 ? 00:00:00 /usr/local/Zend/apache2/bin/http Thanks, Scot
  8. discomatt, Failed... While I am waiting on my Linux gurus to allow me additional sudo capabilities, I will read the link you sent. ~ sudo sendmail scotDiddle@MyCompany.com < HiMom.txt collect: Cannot write ./dfm83FuSLu012197 (bfcommit, uid=51, gid=51): Permission denied queueup: cannot create queue file ./qfm83FuSLu012197, euid=51: Permission denied ~ Thanks, Scot
  9. discomatt, I'm not sure... When I search for sendmail I get back circles... 541388 0 lrwxrwxrwx 1 root root 21 Jan 11 2007 /usr/sbin/sendmail -> /etc/alternatives/mta 327691 0 lrwxrwxrwx 1 root root 30 Jan 11 2007 /usr/lib/sendmail -> /etc/alternatives/mta-sendmail In alternatives I see: /etc/alternatives ls -ltr *send* lrwxrwxrwx 1 root root 26 Jan 11 2007 mta-sendmail -> /usr/lib/sendmail.sendmail My php.ini config file says sendmail lives in: sendmail_path = "/usr/sbin/sendmail -t -i" When I enter sendmail from my ptty window, I get back: "To address needed" I am a mainframe programmer, and have very little experience with u/linux. Scot
  10. Hi Folks, I am trying to understand why my Linux system returns false at any attempt with the mail() function. function_exists('mail'); returns true. I am using Zend Core (PHP 5.2) for Oracle. Any help will be appreciated. Scot L. Diddle, Richmond VA
  11. Perad, The following will show you all sort's of useful information... Scot L. Diddle, Richmond VA <?php echo "<pre> \n"; var_dump($_SERVER); echo "</pre> \n"; ?>
  12. Jarv, What happens if your move your second sql query to the top, like the following ? Scot <?php include_once("config.php"); include_once("functions.php"); // Check user logged in already: // checkLoggedIn("yes"); doCSS(); ?> <div id="header"> <p class="wrap"> <? print("\n <a href=\"post.php"."\">+ Add new header</a> ");?> </p> <h1 class="wrap">Avert Weekly Headers</h1> </div> <?php include_once("config.php"); $result = mysql_query("SELECT * FROM Headertbl ORDER BY HeaderDate DESC"); $result2 = mysql_query("SELECT * FROM keyword INNER JOIN keywordlist ON keyword.keyword_id=keywordlist.keyword_id WHERE keyword.HeaderID=".$HeaderID); while($row = mysql_fetch_array($result)){ echo '<div id="entry" class="wrap">'; $HeaderID = $row['HeaderID']; $HeaderImage = $row['HeaderImage']; $HeaderDate = $row['HeaderDate']; $HeaderPhotoNo = $row['HeaderPhotoNo']; $HeaderName = $row['HeaderName']; $PhotoID = $row['PhotoID']; $CountryID = $row['CountryID']; $result1 = mysql_fetch_array(mysql_query("SELECT * FROM country WHERE CountryID =".$CountryID)); $Country = $result1['country']; while($row1 = mysql_fetch_array($result2)) { $Keyword = $row1['keyword']; echo <<<EOF <div class="entry_header"> <b>Header Name:</b> $HeaderName <a href="edit.php?HeaderID=$HeaderID">Edit Header</a> | <a href="delete.php?HeaderID=$HeaderID">Delete Header</a><br /> <a href="upload.php?HeaderID=$HeaderID">Change Header</a><br /> <a href="http://www.avert.org/photo_search.php?search_keyword_id=&search_country_id=country-$CountryID&page_type=thumbnails&search=search">Other pictures from $Country</a> Keywords:$Keyword} <br /> <b>PhotoID:</b> $PhotoID <br /> <b>Header Photo No:</b> $HeaderPhotoNo <br /> <b>Header Date:</b> $HeaderDate <br /> <img src="headers/$HeaderImage"> </div> EOF; echo '</div>'; } } mysql_close($link); ?>
  13. Jarv, It looks like to me you are missing the '{' and '} for you second while loop. The way you have it coded : while($row1 = mysql_fetch_array($result2)) $Keyword = $row1['keyword']; only the last $Keyword will be passed to your html out.. Try : while($row1 = mysql_fetch_array($result2)) { $Keyword = $row1['keyword']; Then : } at the bottom of your script. Scot L. Diddle, Richmond VA
  14. MrRundog, It worked for me when I assigned the Second Level array a Key value a value of zero. Scot L. Diddle, Richmond VA <?php $data = Array ( 0 => Array ( 'release' => 8.1, 'environment' => Production, 'lang' => en-US, 'xmlns' => NULL, 'ApplicationArea' => Array ( 'Sender' => Array ( 'LogicalId' => 0, 'Component' => CarweBVRRWebService, 'Task' => strB2BGetVehicleByVRM, ), 'CreationDateTime' => '2008-06-25T13.52.52Z', 'BODId' => NULL, 'Destination' => Array ( 'DestinationNameCode' => 1, ) ), 'DataArea' => Array ( 'Error' => Array ( 'Header' => Array ( 'DocumentDateTime' => '2008-06-25T13.52.52Z' ) ), 'Vehicles' => Array ( 'Vehicle' => Array ( 'BodyStyle' => '4 DOOR SALOON', 'CO2' => 151, 'DateFirstRegistered' => '2001-12-03', ) ), ), ), ); $vehicle_array = $data[0]['DataArea']['Vehicles']['Vehicle']; print_r($vehicle_array) ?>
  15. l33t fl33t, Try: eval($actions[$_REQUEST['actions']]); // prints Success! Scot L. Diddle, Richmond VA
  16. jarv, After pasting your code into Zend Studio 5.5 IDE, two probmems were immediately apparent. 1. There is no closing '}' for your first 'While' Statement. 2. You cannont have and assigment in a HEREDOC string... Move your assignment: $Keyword = $row1['keyword']; above your 'echo <<<' statement. The error message relates to this statement. (Line 46) Scot L. Diddle, Richmond VA
  17. s_ainley87, Where my example has The IP's for HOST1, HOST2, and LOCALHOST hard-coded, for: case '777.888.999.555' : $mailServer = 'HOST1'; // Or: $mailServer = $serverName; $mailMethod = 'SENDMAIL'; $serverStatus = determineServerStatus($serverPort); break; change '777.888.999.555' to the IP address of your 'live' server, then change 'HOST1' to 'live', and change 'SENDMAIL' to whichever mail method is used on that server. Make similiar changes to the other two case statements. If you don't know, or are un-sure what the IP address is, after: $mailEnvelope = array(); $serverIP = $_SERVER['SERVER_ADDR']; $serverPort = $_SERVER['SERVER_PORT']; enter: echo "\$serverIP = ' . $serverIP . "<br /><br /> \n"; to find the IP, and: echo "\$serverPort = ' $serverPort . "<br /><br /> \n"; to find the port number. Follow this with: exit(); When you run the script on each sever, you will then have the values you need to complete the switch statements. Scot
  18. s_ainley87, Sure, First I built an array to hold the results we are looking for. $mailEnvelope = array(); This will end up holding : $mailEnvelope['hostName'] = $mailServer; $mailEnvelope['method'] = $mailMethod; $mailEnvelope['serverStatus'] = $serverStatus; Which is what you are looking for. This is determined by asking PHP to return some built-in values: $serverIP = $_SERVER['SERVER_ADDR']; $serverPort = $_SERVER['SERVER_PORT']; The first value received from the built-in $_SERVER array is the IP of the server where the script is running. The second value received is the port number on the server where the script is running. The statement : $sendMailParms = setMailEnvelope($serverIP, $serverPort); calls the setMailEnvelope function which will have the IP addresses hand-coded for your various servers... The ones shown in the example are dummys, and do no exist. While developing this, my own IP address was passed, (172.16.238.147) to the first function, and my port: 8080 was passed, because I was running as DEV. I had to hand-code the first case statement to: case '172.16.238.147' : // MY IP If you are only dealing with three servers, change the case statment paramaters to match the IP addresses. If you are dealing with more that three servers, you will need to add an new: case 'IP Address to Check' : // set your values here... break; as well as new: case 'PORT NUMBER to Check' : // set your values here... break; in the second function, if you have additional port numbers. Also, you will have to change the port numbers to match your environment. When a match is found (i.e., the script knows which server is is running on) it sets the parameters to be returned. Each case statment from the original function, when hit, also, calls: $serverStatus = determineServerStatus($serverPort); to determine the server status of the server the script is running on. ( It asks: Am I running on a production, development, or QA system ?) This will only be important or useful, if you have 2 ( or more ) apache servers running on one box. I have PROD and DEV both running under the same apache, but using different httpd.conf files, PROD uses port 80, while DEV uses port 8080. If you need your mailing script to behave differently depending on which port the php script is running on, the call to the second function provides this. The function returns the server status... Again this is up to you... You may not have a port 9000 in use for QA ( Quality Assurance ), and you can remove the case statement and it's assignment, and it's closing 'break' statment. After the original function has ended the information you will need later to determine which "SENDMAIL" environment you need to code for will be found in the "now filled in array" called: $mailEnvelope, which is returned to the original function, and fill in the value for : $sendMailParms The var_dump statement is purely for debugging, so you can see if you get the expected results back. Once you are satisfied, you can delete or comment-out the var_dump statement. You can now do something like: $host = $sendMailParms['hostname'] switch ($host) { case 'HOST1' : // code goes here for what ever HOST1 needs to do to send your mail.. break; case 'HOST2' : // code goes here for what ever HOST2 needs to do send to your mail.. break; // ... etc } And there you have it. Hope my explanation was satisfactory... If not, let me know, and we will get this to work for you. Scot L. Diddle
  19. s_ainley87, This is one possible solution... Scot L. Diddle, Richmond VA [pre] <?php $mailEnvelope = array(); $serverIP = $_SERVER['SERVER_ADDR']; $serverPort = $_SERVER['SERVER_PORT']; // $serverIP = '777.888.999.555'; // Hand Code to test new values // $serverName = $_SERVER['SERVER_NAME']; // Use if known.. $sendMailParms = setMailEnvelope($serverIP, $serverPort); var_dump($sendMailParms); exit; function setMailEnvelope($serverIP, $serverPort) { switch ($serverIP) { case '777.888.999.555' : $mailServer = 'HOST1'; // Or: $mailServer = $serverName; $mailMethod = 'SENDMAIL'; $serverStatus = determineServerStatus($serverPort); break; case '222.333.444.555' : $mailServer = 'HOST2'; // Or: $mailServer = $serverName; $mailMethod = 'SMTP'; $serverStatus = determineServerStatus($serverPort); break; case '127.0.0.1' : $mailServer = 'LOCALHOST'; // Or: $mailServer = $serverName; $mailMethod = 'SNAIL_MAIL'; $serverStatus = determineServerStatus($serverPort); break; default : echo "Could not Determine \$serverIP... Exiting <br />"; exit; break; } // END switch ($serverIP) { $mailEnvelope['hostName'] = $mailServer; $mailEnvelope['method'] = $mailMethod; $mailEnvelope['serverStatus'] = $serverStatus; return $mailEnvelope; } // END function setMailEnvelope($serverIP, $serverPort) { function determineServerStatus($serverPort) { switch($serverPort) { case '80' : $serverStatus = 'PROD'; break; case '8080' : $serverStatus = 'TEST'; break; case '9000' : $serverStatus = 'QA'; break; default : echo "Could not determine \$serverPort... Exiting. <br />"; exit; break; } Return $serverStatus; } // END function determineServerStatus($serverPort) { ?>
  20. PdYpsilon, This works: <?php $ft = $_POST['form_text']; $ft1 = 'http://MyDomain.com'; $ft2 = 'http://MyDomain.com http://YourDomain.com'; $toomuch1 = substr_count($ft1, 'http'); if ($toomuch1 >= 2){ die("Please only one link per entry!."); } else { echo "Right On!" . "<br /> <br /> \n"; } $toomuch2 = substr_count($ft2, 'http'); if ($toomuch2 >= 2){ die("Please only one link per entry!. <br /> <br />"); } else { echo "Right On!"; } ?> var_dump($ft) and see what value you are passing to the substr_count() function. Scot
  21. completeamateur, While developing, it is good to see those messages... suppose you were expecting to see $_GET[school_name]; back from a form, but you get: Informational message: '$_GET[skool_name] is uninitialized ' ... Pretty good clue that you have something misspelled somewhere... Scot Diddle, Richmond VA
  22. wiggst3r, I ran your code with the following and it worked perfectly. check the leading slashes on your file defs... <?php $local_file = 'images/' . 'ZOS.txt'; // a folder off of document_root $server_file = '/PUDATA/' . 'ZOS.DASD.USAGE.BY.APPLICATION.TXT'; // a folder off of FTP_ROOT $ftpServer = '123.456.789.123'; $ftpUserName = 'Me'; $ftpUserPass = 'MyPW'; // set up basic connection $conn_id = ftp_connect($ftpServer); // login with username and password $login_result = ftp_login($conn_id, $ftpUserName, $ftpUserPass); /* then the rest of your code un changed... */ ?>
  23. Hi There hitherescotty, I use JPGraph, and handle iterations like this: If you need more details, or have questions, contact me at: ScotDiddle 'at' webtdo 'dot' com Scot L. Diddle, Richmond VA <?php /** * * Partial contents of company_name_goes_hereGenerateGraph.php follows: * * Requested SysID from previous user input Panels * */ foreach ($requestedSysIDs as $graphSysID) { $graph = new Graph(); $_SESSION['currentGraphCounter'] = '00' . ++$currentGraphCount; $functionLine = __LINE__; switch($graphSysID) { case 'XYZ1' : case 'XYZ2' : case 'XYZ3' : case 'XYZ4' : case 'XYZ5' : case 'XYZ6' : case 'XYZ7' : $LPAR = 'LPAR1'; break; case 'XYZ1' : case 'XYZ' : $LPAR = 'LPAR2'; break; default : echo "Error on LPAR Selection in company_name_goes_hereGenerateGraph.php on line $functionLine"; exit; break; } $metric = $graphSysID; $tableAlias = strtolower($tableAlias); $graph->generateGraph($db,$LPAR,$dateType,$metric,$tableDateOut,$tableName,$tableAlias,$calendarUnit,$calendarValue,$sortOrder); // returns: $_SESSION['sparklineDisplay'] echo "</body> \n"; echo "</html> \n"; $graphFile = $_SESSION['graph'][$metric]; $graphFileName = $_SESSION['HTMLFileName']; $functionLine = __LINE__ + 2; $fh = fopen ("$graphFileName", "w"); if (!$fh) { echo "Error opening $graphFileName for write in program UpgrGenerateGraph.php on line $functionLine <br /> <br />"; exit; } else { $functionLine2 = __LINE__ + 2; $writeResults = fwrite($fh, $graphFile); if (!$writeResults) { echo "Error Writing $graphFileName in program UpgrGenerateGraph.php on line $functionLine2 <br /> <br />"; exit; } fclose($fh); } } // END foreach ($requestedSysIDs as $graphSysID) { /** * * Where the Graph class is defined here: * */ // END: company_name_goes_hereGenerateGraph.php /** * Generates JPGraph Image from users selected metrics criteria * * Called from: production/company_name_goes_hereGenerateGraph.php * */ class Graph { PUBLIC $dbConnect; // Instantiation PUBLIC $OracleInstance; // Instantiation Rose PUBLIC $currentClass; // Class Name PUBLIC $graphDB; // Which Major Metric PUBLIC $dateType; // Single Date, or Date Range PUBLIC $graphSysID; // Sub-system ID PUBLIC $graphTable; // Table of Interest PUBLIC $graphAlias; // transaction_by_count PUBLIC $queryRC; // Like the sign says... PUBLIC $SQLDateToConvert; // $SQLDate; PUBLIC $timestamp; // UNIX EPOCH DATE, created from $SQLDate PUBLIC $selectDate; // SQL Select Date for User Selection in Unix Timestamp format PUBLIC $minDate; // Starting Date for User Selection in Unix Timestamp format PUBLIC $maxDate; // Ending Date for User Selection in Unix Timestamp format PUBLIC $calendarUnit; // 'Month' or 'Year' PUBLIC $calendarValue; // 'Sep' | 'Oct' ... etc... OR '2007' | '2008' etc... PUBLIC $yearDate; // TRUE or False, depending on whether or not the incoming date is an INT PUBLIC $specificMonth; // TRUE or False, depending on whether or not the incoming Calendar Unit == // 'Month' PUBLIC $specificYear ; // TRUE or False, depending on whether or not the incoming Calendar Unit == // 'Year' PUBLIC $dbRows = array(); // Holds the results of the $mode = 'Row' query... PUBLIC $sortOrder; // Default ( or user-selected ) sort order... PUBLIC $PDFImage; // Holds the PDF image. PUBLIC $PDFFileName; // Holds the Name of the PDF Output file. PUBLIC $XMLFileName; // Holds the Name of the XML Output file. PUBLIC $ExcelFileName; // Holds the Name of the Excel Output file. PUBLIC $HTMLFileName; // Holds the Name of the HTML Output file. PUBLIC $imageAddress; // Holds the Name of the IP, and Port for images on HTML Graph Window content PUBLIC $c1; // Corner of PDF Image in header PUBLIC $c2; // Ditto PUBLIC $h; // Height of PDF Image in header function __construct() { require_once('include/debugFunctions.php'); require('include/determineCallingProgram.php'); $this->className = __CLASS__; require_once("include/jpgraph.php"); require_once("include/jpgraph_line.php"); require_once("include/jpgraph_date.php"); require_once("include/jpgraph_plotband.php"); require_once("include/jpgraph_bar.php"); require_once("include/jpgraph_log.php"); require_once("include//jpgraph_regstat.php"); require_once("include/writeFile.php"); $reportDate = Array(); $reportTime = Array(); require_once('classes/Oracle.class.php'); // Oracle Connect setup in production/company_name_goes_hereMetricsDateSelect.php $user = 'xxxx'; $password = 'xxxx'; $OCIID = 'xxxx'; // Correct Value = xxxx $this->OracleInstance = new Oracle($connectArray); $_SESSION['dbc'] = $this->OracleInstance; // Set debug mode for more information about query. $this->OracleInstance->Debug = 0; unset($_POST); error_reporting(E_ALL ^ E_NOTICE); set_time_limit(0); // pae Print Array, Then Exit $serverAddress = $_SERVER['SERVER_ADDR']; $serverPort = $_SERVER['SERVER_PORT']; $this->imageAddress = $serverAddress . ':' . $serverPort; } function getTimeRangeForSelectedMetric($db,$LPAR,$dateType,$metric,$tableDate,$tableName,$tableAlias,$calendarUnit,$calendarValue,$sortOrder) { require('include/assignIncomingParmValues.php'); $this->selectDate = $this->graphDate; $this->selectDate = $this->dateToTimestamp($this->selectDate); $tableAlias = strtolower($tableAlias); switch($tableAlias) { case 'tran_count_by_date' : $this->sql = "select distinct min(RECORDTIME) from db_prefix." . $this->graphTable . " where (EPOCHDATE = " . $this->selectDate . ") AND (SYSID='" . $this->graphSysID . "') AND (RECORDTYPE='R')"; break; case 'transactions_by_count' : $this->sql = "select distinct min(RECORDTIME) from db_prefix." . $this->graphTable . " where (EPOCHDATE = " . $this->selectDate . ") AND (SYSID='" . $this->graphSysID . "') AND (RECORDTYPE='R')"; break; } $mode = 'Column'; $this->queryResult = $_SESSION['dbc']->query($this->sql, $mode); // Check the return code for error messages... $this->queryRC = $_SESSION['dbc']->setQueryRC($this->queryResult); if (!$this->queryRC) { require('include/SQLMethodErrorDisplay.php'); } $MinTime = array(); foreach($this->dbRows as $transactionRecord) { $transactionLineOut[] = $transactionRecord; // printArray($transactionLineOut); // echo $transactionLineOut . "<br /> <br /> \n"; } // exit; } function generateGraph($db,$LPAR,$dateType,$metric,$tableDate,$tableName,$tableAlias,$calendarUnit,$calendarValue,$sortOrder) { require('include/assignIncomingParmValues.php'); $selectType = 'EOPCHDATE'; // Default if ($this->dateType == 'DateSingle') { if ($selectType == 'EOPCHDATE') { $this->selectDate = $this->graphDate; $this->selectDate = $this->dateToTimestamp($this->selectDate); $this->sql = "select * from db_prefix." . $this->graphTable . " where (EPOCHDATE = " . $this->selectDate . ") AND (SYSID='" . $this->graphSysID . "') AND (RECORDTYPE='R')"; } if ($selectType == 'Month') { $this->selectDate = $this->graphDate; $this->sql = "select * from db_prefix." . $this->graphTable . " where (REPORTMONTH = '" . $this->calendarValue . "') AND (REPORTYEAR='" . $this->metricDate . "') AND (SYSID='" . $this->graphSysID . "') AND (RECORDTYPE='R')"; } if ($selectType == 'Year') { // $this->selectDate = $this->graphDate; // $this->sql = "select * from db_prefix." . $this->graphTable . " where (REPORTMONTH = " . $this->calendarUnit . ") AND (REPORTYEAR='" . $this->metricDate . "')"; } if ($selectType == 'Weekday') { // $this->selectDate = $this->graphDate; // $this->sql = "select * from db_prefix." . $this->graphTable . " where (REPORTMONTH = " . $this->calendarUnit . ") AND (REPORTYEAR='" . $this->metricDate . "')"; } /** * * $metricDir Value is common for all graphs * */ $arrayOfTableAlias = array( 'tran_count_by_date', 'tran_count_by_date_range', 'tran_count_by_hour', 'tran_count_by_month', 'tran_count_by_week_day', 'tran_count_by_year', 'transactions_by_count', 'transactions_by_response_time' ); /** * * Metric Directory Definitions * */ $metricDir = 'company_name_goes_hereData/ISMetrics/MetricGraphs/' . $this->graphDB . '/' . $this->graphLPAR . '/'; $_SESSION['metricDir'] = $metricDir; $_SESSION['PDFDir'] = 'company_name_goes_hereData/PDF/' . $this->graphDB . '/' . $this->graphSysID . '/'; $_SESSION['ExcelDir'] = 'company_name_goes_hereData/Excel/' . $this->graphDB . '/' . $this->graphSysID . '/'; $_SESSION['XMLDir'] = 'company_name_goes_hereData/XML/' . $this->graphDB . '/' . $this->graphSysID . '/'; $functionline1 = __LINE__ + 2; $graphTable = $this->graphTable; $_SESSION['PDFTable'] = $this->graphTable; /** * * The includes just have the jpgraph class instantiations, and their associated parms. * */ switch($graphTable) { case 'cics_tran_count_by_hour' : $functionLine2 = __LINE__ + 2; switch($this->graphAlias) { case 'tran_count_by_date' : require('include/TCBHGraph.php'); // Tran_count_by_Hour for a specific date break; default : if ($this->graphAlias == '') { $this->graphAlias = '** UNDEFINED **'; } echo "<font color=\"red\">Error in program :: </font><font color=\"#205E75\">company_name_goes_hereGraph.class.php</font> <font color=\"red\">::</font> on Line <font color=\"red\">:: $functionLine2 ::</font> <br /><br /> \n"; echo "<ul> <ul><font color=\"blue\">Error Number <font color=\"red\">ISM-GRA1</font> :: <br /><br /><ul><ul>Error Message ::<br /><br /><ul><ul><font color=\"red\">:: </font><font color=\"#205E75\">ISMetrics Alias Table Name \$this->graphAlias (<font color=\"red\">$this->graphAlias)</font> is missing or invalid.</font> <font color=\"red\">::</font> </font><br /><br /><br /><br /></ul></ul></ul></ul></ul></ul> \n"; require('include/company_name_goes_hereMetricsErrorClose.php'); exit; break; } break; case 'cics_transactions_by_sysid' : $functionLine3 = __LINE__ + 2; switch($this->graphAlias) { case 'transactions_by_count' : $this->sql = "select * from db_prefix." . $this->graphTable . " where (EPOCHDATE = " . $this->selectDate . ") AND (RECORDTYPE='R') AND (SYSID='" . $this->graphSysID . "')"; require('include/TCGraph.php'); // Transactions_by_count for a specific date break; case 'transactions_by_responce' : $this->sql = "select * from db_prefix." . $this->graphTable . " where (EPOCHDATE = " . $this->selectDate . ") AND (RECORDTYPE='R') AND (SYSID='" . $this->graphSysID . "')"; require('include/TCRespGraph.php'); // Transactions_by_count for a specific date break; default : if ($this->graphAlias == '') { $this->graphAlias = '** UNDEFINED **'; } echo "<font color=\"red\">Error in program :: </font><font color=\"#205E75\">company_name_goes_hereGraph.class.php</font> <font color=\"red\">::</font> on Line <font color=\"red\">:: $functionLine3 ::</font> <br /><br /> \n"; echo "<ul> <ul><font color=\"blue\">Error Number <font color=\"red\">ISM-GRA1</font> :: <br /><br /><ul><ul>Error Message ::<br /><br /><ul><ul><font color=\"red\">:: </font><font color=\"#205E75\">ISMetrics Alias Table Name \$this->graphAlias (<font color=\"red\">$this->graphAlias)</font> is missing or invalid.</font> <font color=\"red\">::</font> </font><br /><br /><br /><br /></ul></ul></ul></ul></ul></ul> \n"; require('include/company_name_goes_hereMetricsErrorClose.php'); exit; break; } break; // Generates: $graph->Stroke($currentMetric); default : if ($this->graphName == '') { $this->graphName = '** UNDEFINED **'; } echo "<font color=\"red\">Error in program :: </font><font color=\"#205E75\">company_name_goes_hereGraph.class.php</font> <font color=\"red\">::</font> on Line <font color=\"red\">:: $functionLine1 ::</font> <br /><br /> \n"; echo "<ul> <ul><font color=\"blue\">Error Number <font color=\"red\">ISM-GRA1</font> :: <br /><br /><ul><ul>Error Message ::<br /><br /><ul><ul><font color=\"red\">:: </font><font color=\"#205E75\">ISMetrics Alias Table Name \$this->graphName (<font color=\"red\">$this->graphName)</font> is missing or invalid.</font> <font color=\"red\">::</font> </font><br /><br /><br /><br /></ul></ul></ul></ul></ul></ul> \n"; require('include/company_name_goes_hereMetricsErrorClose.php'); exit; break; } } // END if ($this->dateType == 'DateSingle') { if ($this->dateType == 'DateRange') { $this->minDate = $this->graphDate[0]; $this->maxDate = $this->graphDate[1]; $this->minDate = $this->dateToTimestamp($this->minDate); $this->maxDate = $this->dateToTimestamp($this->maxDate); $function_line1 = __LINE__ + 2; $graphTable = $this->graphTable; switch($graphTable) { case 'cics_tran_count_by_hour' : $functionLine2 = __LINE__ + 2; switch($this->graphAlias) { case 'tran_count_by_date' : $this->sql = "select * from db_prefix." . $this->graphTable . " where ((EPOCHDATE >= " . $this->minDate . ") AND (EPOCHDATE <= " . $this->maxDate . ")) AND (SYSID='" . $this->graphSysID . "')"; require('include/TCBHRGraph.php'); // Trans Count Per Hour By Date Range break; default : if ($this->graphAlias == '') { $this->graphAlias = '** UNDEFINED **'; } echo "<font color=\"red\">Error in program :: </font><font color=\"#205E75\">company_name_goes_hereGraph.class.php</font> <font color=\"red\">::</font> on Line <font color=\"red\">:: $functionLine2 ::</font> <br /><br /> \n"; echo "<ul> <ul><font color=\"blue\">Error Number <font color=\"red\">ISM-GRA1</font> :: <br /><br /><ul><ul>Error Message ::<br /><br /><ul><ul><font color=\"red\">:: </font><font color=\"#205E75\">ISMetrics Alias Table Name \$this->graphAlias (<font color=\"red\">$this->graphAlias)</font> is missing or invalid.</font> <font color=\"red\">::</font> </font><br /><br /><br /><br /></ul></ul></ul></ul></ul></ul> \n"; require('include/company_name_goes_hereMetricsErrorClose.php'); exit; break; } break; case 'cics_transactions_by_sysid' : $functionLine3 = __LINE__ + 2; switch($this->graphAlias) { case 'transactions_by_count' : $this->sql = "select * from db_prefix." . $this->graphTable . " where ((EPOCHDATE >= " . $this->minDate . ") AND (EPOCHDATE <= " . $this->maxDate . ")) AND (RECORDTYPE='C') AND (SYSID='" . $this->graphSysID . "')"; require('include/TCRGraph.php'); // Transaction Count By Date Range break; case 'transactions_by_responce' : $this->sql = "select * from db_prefix." . $this->graphTable . " where ((EPOCHDATE >= " . $this->minDate . ") AND (EPOCHDATE <= " . $this->maxDate . ")) AND (RECORDTYPE='C') AND (SYSID='" . $this->graphSysID . "')"; require('include/TCRRGraph.php'); // Transaction Count By Date Range break; default : if ($this->graphAlias == '') { $this->graphAlias = '** UNDEFINED **'; } echo "<font color=\"red\">Error in program :: </font><font color=\"#205E75\">company_name_goes_hereGraph.class.php</font> <font color=\"red\">::</font> on Line <font color=\"red\">:: $functionLine3 ::</font> <br /><br /> \n"; echo "<ul> <ul><font color=\"blue\">Error Number <font color=\"red\">ISM-GRA1</font> :: <br /><br /><ul><ul>Error Message ::<br /><br /><ul><ul><font color=\"red\">:: </font><font color=\"#205E75\">ISMetrics Alias Table Name \$this->graphAlias (<font color=\"red\">$this->graphAlias)</font> is missing or invalid.</font> <font color=\"red\">::</font> </font><br /><br /><br /><br /></ul></ul></ul></ul></ul></ul> \n"; require('include/company_name_goes_hereMetricsErrorClose.php'); exit; break; } // Generates: $graph->Stroke($currentMetric); break; default : if ($this->graphName == '') { $this->graphName = '** UNDEFINED **'; } echo "\t<div style=\"background-color:white;\"> \n"; echo "<font color=\"red\">Error in program :: </font><font color=\"#205E75\">company_name_goes_hereGraph.class.php</font> <font color=\"red\">::</font> on Line <font color=\"red\">:: $functionLine1 ::</font> <br /><br /> \n"; echo "<ul> <ul><font color=\"blue\">Error Number <font color=\"red\">ISM-GRA1</font> :: <br /><br /><ul><ul>Error Message ::<br /><br /><ul><ul><font color=\"red\">:: </font><font color=\"#205E75\">ISMetrics Alias Table Name \$this->graphName (<font color=\"red\">$this->graphName)</font> is missing or invalid.</font> <font color=\"red\">::</font> </font><br /><br /><br /><br /></ul></ul></ul></ul></ul></ul> \n"; echo "\t</div> \n"; require('include/company_name_goes_hereMetricsErrorClose.php'); exit; break; } } // END if ($this->dateType == 'DateSingle') { // Add the UPS Logo to the graph, save the image, and Display it... require('include/addLogoTocompany_name_goes_hereGraph.php'); // Grap the tools necessary to build PDF output for the user.... require_once('classes/company_name_goes_hereGenerateGraphPDF.class.php'); // Generate the PDF Page(s) for the current SysID... require('include/buildPDFPageForCurrentSysID.php'); $currentGraphCounter = $_SESSION['currentGraphCounter']; $formName = 'dateSelectReturn' . '00' . $currentGraphCounter; $myimagemap = 'myimagemap' . $currentGraphCounter; if (!$_SESSION['HTMLPageSet']) { // $_SESSION['HTMLPageSet'] = TRUE; $_SESSION['HTMLHead'] = <<<EOH <html> <head> <!-- Prototype Window Class Part --> <script type="text/javascript" src="javascript/prototype.js"> </script> <script type="text/javascript" src="javascript/effects.js"> </script> <script type="text/javascript" src="javascript/window.js"> </script> <script type="text/javascript" src="javascript/window_effects.js"> </script> <script type="text/javascript" src="javascript/debug.js"> </script> <script type="text/javascript" language="JavaScript" src="javascript/overlib.js"></script> \n <link href="css/company_name_goes_hereMetrics.css" rel="stylesheet" type="text/css"/> \n </head> <body> <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div> \n EOH; echo $_SESSION['HTMLHead']; $_SESSION['HTMLPageSet'] = TRUE; } $currentImageMap = $graph->GetHTMLImageMap("$myimagemap"); // Generate the correct SparkLine Image... require_once('include/Sparkline_Line.php'); require_once('include/Sparkline_Bar.php'); $graphTable = $this->graphTable; $functionLine3 = __LINE__ + 2; switch($graphTable) { case 'cics_tran_count_by_hour' : $functionLine4 = __LINE__ + 2; switch($this->graphAlias) { case 'tran_count_by_date' : require('include/sparklineLineGraph.php'); break; default : if ($this->graphAlias == '') { $this->graphAlias = '** UNDEFINED **'; } echo "<font color=\"red\">Error in program :: </font><font color=\"#205E75\">company_name_goes_hereGraph.class.php</font> <font color=\"red\">::</font> on Line <font color=\"red\">:: $functionLine5 ::</font> <br /><br /> \n"; echo "<ul> <ul><font color=\"blue\">Error Number <font color=\"red\">ISM-GRA1</font> :: <br /><br /><ul><ul>Error Message ::<br /><br /><ul><ul><font color=\"red\">:: </font><font color=\"#205E75\">ISMetrics Alias Table Name \$this->graphAlias (<font color=\"red\">$this->graphAlias)</font> is missing or invalid.</font> <font color=\"red\">::</font> </font><br /><br /><br /><br /></ul></ul></ul></ul></ul></ul> \n"; require('include/company_name_goes_hereMetricsErrorClose.php'); exit; break; } break; case 'cics_transactions_by_sysid' : $functionLine5 = __LINE__ + 2; switch($this->graphAlias) { case 'transactions_by_count' : require('include/sparklineBarGraph.php'); break; case 'transactions_by_response' : break; default : if ($this->graphAlias == '') { $this->graphAlias = '** UNDEFINED **'; } echo "<font color=\"red\">Error in program :: </font><font color=\"#205E75\">company_name_goes_hereGraph.class.php</font> <font color=\"red\">::</font> on Line <font color=\"red\">:: $functionLine5 ::</font> <br /><br /> \n"; echo "<ul> <ul><font color=\"blue\">Error Number <font color=\"red\">ISM-GRA1</font> :: <br /><br /><ul><ul>Error Message ::<br /><br /><ul><ul><font color=\"red\">:: </font><font color=\"#205E75\">ISMetrics Alias Table Name \$this->graphAlias (<font color=\"red\">$this->graphAlias)</font> is missing or invalid.</font> <font color=\"red\">::</font> </font><br /><br /><br /><br /></ul></ul></ul></ul></ul></ul> \n"; require('include/company_name_goes_hereMetricsErrorClose.php'); exit; break; } // Generates: $graph->Stroke($currentMetric); break; default : if ($this->graphName == '') { $this->graphName = '** UNDEFINED **'; } echo "<font color=\"red\">Error in program :: </font><font color=\"#205E75\">company_name_goes_hereGraph.class.php</font> <font color=\"red\">::</font> on Line <font color=\"red\">:: $functionLine3 ::</font> <br /><br /> \n"; echo "<ul> <ul><font color=\"blue\">Error Number <font color=\"red\">ISM-GRA1</font> :: <br /><br /><ul><ul>Error Message ::<br /><br /><ul><ul><font color=\"red\">:: </font><font color=\"#205E75\">ISMetrics Alias Table Name \$this->graphName (<font color=\"red\">$this->graphName)</font> is missing or invalid.</font> <font color=\"red\">::</font> </font><br /><br /><br /><br /></ul></ul></ul></ul></ul></ul> \n"; require('include/company_name_goes_hereMetricsErrorClose.php'); exit; break; } /** * * Now that we have generated our graph image, let's wrap it in HTML so the user * can find it. * * $_SESSION['requiredMetric'] = $currentMetric : * * Vis.: company_name_goes_hereData/ISMetrics/MetricGraphs/CICS/OP01/TCBD_FAF1_27-JAN-08_1152_by_864.jpg * */ $_SESSION['requiredMetric'] = $currentMetric; // $XMLFile = $_SESSION['XMLFileName']; $this->touch_it($currentMetric); $this->touch_it($dirAndCurrentMetric); if(file_exists($currentMetric)) { chmod($currentMetric, 0777); } if (file_exists($dirAndCurrentMetric)) { chmod($dirAndCurrentMetric, 0777); } // $HTMLHead = $_SESSION['HTMLHead']; // // // pae Print Array, Then Exit // // require_once('include/debugFunctions.php'); // printArray($HTMLHead, '$HTMLHead'); // exit(); // // // // Since the HTML lives way down deep, // back up links to images, JS, and CSS with ../../ etc. $this->PDFFileName = $_SESSION['PDFFileName'][$this->graphSysID]; $downloadPDFURL = 'download.php?PDFFile=' . $this->PDFFileName; $ExcelWBURL = 'company_name_goes_hereGenerateExcelWB.php?ExcelFile=' . $this->ExcelFileName; $XMLURL = 'company_name_goes_hereDisplayXML.php?XMLFile=' . $this->XMLFileName; // Determine New Window centering parameters... require('determineCallingProgram.php'); $_SESSION['callingProgram'] = $callingProgram; require('setUsersUIBasedOnScreenResolution.php'); // Calls : 'include/setupGraphDisplayUIBasedOnScreenResolution.php' $computedWidth = $_SESSION['computedWidth']; $computedHeight = $_SESSION['computedHeight']; $wleft = $_SESSION['wleft']; $wtop = $_SESSION['wtop']; // $graphFile = $_SESSION['graph'][$metric]; /** * $_SESSION['graph'][$this->graphSysID] is the HTML page which holds * * the users final graph image and close button. * * It is written out as: $graphFile = $_SESSION['graph'][$metric]; * * around line 319 in : 'production/company_name_goes_hereGenerateGraph.php' * */ $usersScreenWidth = $_SESSION['javascriptScreenWidth']; if ($usersScreenWidth == 800) { $graphPageBreaks = "<br /> \n"; } else { $graphPageBreaks = "<br /> <br /> \n"; } $_SESSION['graph'][$this->graphSysID] = <<<EOT <html> \n <head> \n <script type="text/javascript" language="JavaScript" src="../../../../../../javascript/overlib.js"></script> <link href="../../../../../../css/company_name_goes_hereMetrics.css" rel="stylesheet" type="text/css"/> \n <script> \n <!-- \n // From: http://www.boutell.com/newfaq/creating/windowcenter.html function centerWindow() { \n \n // Fudge factors for window decoration space. \n \n w = $computedWidth \n h = $computedHeight \n \n $wleft \n $wtop \n \n window.resizeTo(w, h); \n window.moveTo(wleft, wtop); \n window.focus(); \n } \n // --> \n \n </script> \n </head> \n <body onload="centerWindow(); return false;"> <div id="overDiv" style="position:absolute; visibility:hidden; z-index:1000;"></div> \n <center><img src="../../../../../../$currentMetric" ISMAP USEMAP="#$myimagemap" border=0><br /> \n $currentImageMap $graphPageBreaks <input type='image' name='closeCurrentWindow' title="Click to Close this Graph" src='http://$this->imageAddress/images/graphClose.bmp' onClick="window.close();"></center> EOT; // // echo "<xmp> \n"; // // echo $_SESSION['graph'][$this->graphSysID]; // // echo "</xmp> \n"; // // exit; // unset($_SESSION['sparkLineDisplay'][$this->graphSysID]); require_once('include/graphSelectionHead.php'); // $HTMLWithMap = "company_name_goes_hereDisplayGraph.php?graphName=" . $_SESSION['HTMLFileName']; $HTMLFileName = $this->HTMLFileName; $sparkLine = "<center><input type='image' height=\"30\" width=\"100\" name='" . $HTMLFileName . "' src=\"$sparklineImage\" border=\"0\" bordercolor=\"#FF00FF\" title=\"Click for $this->graphSysID Metric\"></center>"; $reportDate = $_SESSION['reportdate'][ $this->graphSysID]; // Sparkline $userInstructions (UI Buttons) are define around line 620 // in : 'production/company_name_goes_hereGenerateGraph.php' // // Vis. : newDate, newMetric and return // $_SESSION['sparklineDisplay'][$this->graphSysID] = <<<EOL <center> <table border="1"> <tr> <td> <table border="0"> \n <tr> \n <td colspan="3" class="sgUtilityGraph"> \n <center> <font face="verdana" style="color:#205E75;">$this->graphSysID</font></center> </td> \n </tr> <tr> \n <td colspan="3" class="sgUtilityGraph"> \n <center><font face="verdana" style="color:#205E75;"> Metric Date : $reportDate </font></center> </td> \n </tr> \n <tr> \n <td colspan="3" class="sgUtilityGraph"> \n <center> </center> </td> \n </tr> \n <tr> \n <td colspan="3" class="sgUtilityGraph"> \n $sparkLine <td> \n </tr> \n <tr> \n <td colspan="3" class="sgUtilityGraph"> \n <center> </center> </td> \n </tr> \n <tr> \n <td class='sgUtilityGraph'> \n <a href=$downloadPDFURL title=" Click to display $this->graphSysID PDF" /><img border="0" src=images/pdf7.gif></a> </td> \n <td class='sgUtilityGraph'> \n <a href=$ExcelWBURL title="Click to display $this->graphSysID Excel Spreadsheet" /><img border="0" src=images/excelIcon.bmp></a> </td> \n </td> \n <td class='sgUtilityGraph'> \n <a href=$XMLURL title="Click to display $this->graphSysID XML Data" /><img border="0" src=images/XMLIcon.bmp></a> </td> \n </tr> \n <tr> \n <td colspan='3' class='sgUtilityGraph'> \n </td> \n </tr> </table> \n </td> </tr> </table> </center> </html> EOL; } // END Method :: generateGraph() { // Method dateToTimestamp accepts a date as parameter. In SQLformat: yyyy-mm-dd (eg. 2001-03-16) // Edit the delimiter to your convenience. // returns $timestamp; the timestamp associated with the input. function dateToTimestamp ($SQLDate) { $dateToConvert = $SQLDate; $split_date = split ('-', $dateToConvert); $day = $split_date[0]; $month = $split_date[1]; $year = $split_date[2]; $functionLine = __LINE__ + 2; switch ($month) { case 'Jan' : $month = '01'; break; case 'Feb' : $month = '02'; break; case 'Mar' : $month = '03'; break; case 'Apr' : $month = '04'; break; case 'May' : $month = '05'; break; case 'Jun' : $month = '06'; break; case 'Jul' : $month = '07'; break; case 'Aug' : $month = '08'; break; case 'Sep' : $month = '09'; break; case 'Oct' : $month = '10'; break; case 'Nov' : $month = '11'; break; case 'Dec' : $month = '12'; break; default: if ($month == '') { $month = '** UNDEFINED **'; } echo "<font color=\"red\">Error in program :: </font><font color=\"#205E75\">company_name_goes_hereGraph.class.php</font> <font color=\"red\">::</font> on Line <font color=\"red\">:: $functionLine ::</font> <br /><br /> \n"; echo "<ul> <ul><font color=\"blue\">Error Number <font color=\"red\">ISM-GRA3</font> :: <br /><br /><ul><ul>Error Message ::<br /><br /><ul><ul><font color=\"red\">:: </font><font color=\"#205E75\">ISMetrics Genetated Calendar Month \$month (<font color=\"red\">$month)</font> is missing or invalid.</font> <font color=\"red\">::</font> </font><br /><br /><br /><br /></ul></ul></ul></ul></ul></ul> \n"; require('include/company_name_goes_hereMetricsErrorClose.php'); exit; break; } // yyyy-mm-dd (eg. 2001-03-16) $this->timestamp = mktime (0, 0, 0, $month, $day, $year); return $this->timestamp; } function doublemax($mylist) { $maxvalue=max($mylist); while(list($key,$value) = each($mylist)) { if($value==$maxvalue) { $maxindex=$key; } } return array("c" => $maxvalue, "i" => $maxindex); } function doublemin($mylist) { $minvalue=min($mylist); while(list($key,$value) = each($mylist)) { if($value==$minvalue) { $minindex=$key; } } return array("c"=>$minvalue,"i"=>$minindex); } function mergePix($sourcefile,$insertfile, $targetfile, $pos=0,$transition=50, $frameXOffset, $frameYOffset) { //$sourcefile = Filename of the picture into that $insertfile will be inserted. //$insertfile = Filename of the picture that is to be inserted into $sourcefile. //$targetfile = Filename of the modified picture. //$transition = Intensity of the transition (in percent) //$pos = Position where $insertfile will be inserted in $sourcefile // 0 = middle // 1 = top left // 2 = top right // 3 = bottom right // 4 = bottom left // 5 = top middle // 6 = middle right // 7 = bottom middle // 8 = middle left //Get the resource id's of the pictures $sourcefile_id = imageCreateFromPNG($sourcefile); imagejpeg( $sourcefile_id, $sourcefile, 100 ); $sourcefile_id = imageCreateFromJPEG($sourcefile); $insertfile_id = imageCreateFromGIF($insertfile); //Get the sizes of both pix $sourcefile_width=imageSX($sourcefile_id); $sourcefile_height=imageSY($sourcefile_id); $insertfile_width=imageSX($insertfile_id); $insertfile_height=imageSY($insertfile_id); //middle if( $pos == 0 ) { $dest_x = ( $sourcefile_width / 2 ) - ( $insertfile_width / 2 ); $dest_y = ( $sourcefile_height / 2 ) - ( $insertfile_height / 2 ); } //top left if( $pos == 1 ) { $dest_x = 0 + $frameXOffset; $dest_y = 0 + $frameYOffset; } //top right if( $pos == 2 ) { $dest_x = $sourcefile_width - $insertfile_width; $dest_y = 0; } //bottom right if( $pos == 3 ) { $dest_x = $sourcefile_width - $insertfile_width; $dest_y = $sourcefile_height - $insertfile_height; } //bottom left if( $pos == 4 ) { $dest_x = 0; $dest_y = $sourcefile_height - $insertfile_height; } //top middle if( $pos == 5 ) { $dest_x = ( ( $sourcefile_width - $insertfile_width ) / 2 ); $dest_y = 0; } //middle right if( $pos == 6 ) { $dest_x = $sourcefile_width - $insertfile_width; $dest_y = ( $sourcefile_height / 2 ) - ( $insertfile_height / 2 ); } //bottom middle if( $pos == 7 ) { $dest_x = ( ( $sourcefile_width - $insertfile_width ) / 2 ); $dest_y = $sourcefile_height - $insertfile_height; } //middle left if( $pos == 8 ) { $dest_x = 0; $dest_y = ( $sourcefile_height / 2 ) - ( $insertfile_height / 2 ); } //The main thing : merge the two pix $imageCopyMergeResult = imageCopyMerge($sourcefile_id, $insertfile_id,$dest_x,$dest_y,0,0,$insertfile_width,$insertfile_height,$transition); //Create a jpeg out of the modified picture $imagejpegResult = imagejpeg ($sourcefile_id,"$targetfile"); $workFileName = 'images/fotog.jpg'; // if (file_exists($workFileName)) { // unlink($workFileName); // } // $sourcefileSize = getimagesize($sourcefile); $newFileName = 'images/fotog.jpg'; $renameFunctionLine = __LINE__ + 2; // $renameResult = copy($sourcefile,$newFileName); $renameResult = copy($workFileName,$sourcefile); if (!$renameResult) { echo "\t<div style=\"background-color:white;\"> \n"; echo "<font color=\"red\">Error in program :: </font><font color=\"#205E75\">'classes/company_name_goes_hereGraph.class.php' in function mergePix() {</font> <font color=\"red\">::</font> on Line <font color=\"red\">:: $renameFunctionLine ::</font> <br /><br /> \n"; echo "<ul> <ul><font color=\"blue\">Error Number <font color=\"red\">ISM-AddLogo3</font> :: <br /><br /><ul><ul>Error Message ::<br /><br /><ul><ul><font color=\"red\">:: </font><font color=\"#205E75\">Rename Image from generate graph name to 'images/fotog.jpg failed ( <font color=\"red\">This is the file which will have the UPS logo inserted into it. )</font> or is missing or invalid.</font> <font color=\"red\">::</font> </font><br /><br /><br /><br /></ul></ul></ul></ul></ul></ul> \n"; echo "\t</div> \n"; require('include/company_name_goes_hereMetricsErrorClose.php'); exit; } if (file_exists($newFileName)) { // chmod($newFileName, 0777); } if (file_exists($sourcefile)) { // chmod($sourcefile, 0777); } } function touch_it($filename) { exec("touch {$filename}"); } } ?>
  24. Garry, This works: <?php class userinfo { public function __construct($id) { //$mysqli = database::connect(); //$result = $mysqli->query("SELECT * FROM users WHERE id = '$id'"); //$row = $result->fetch_assoc(); $this->username = 'ScotDiddle'; $this->firstname = 'Scot'; $this->lastname = 'Diddle'; } } $userinfo = new userinfo($_SESSION['user_id']); $firstname = $userinfo->firstname; echo $firstname . "<br /><br /> \n"; ?> Which tells me that the problem is with your SQL processing... Try adding some error checking: Vis.: <?php class userinfo { public $username; public $firstname; public $lastname; public $id; public $usersonline; public $registeredmembers; protected $connection; protected $userinfo; public function __construct($id) { $mysqli = database::connect(); // Garry, Where are your User name / PW ??? Is this causing your problem ? if ($mysqli) { // Good Connect $result = $mysqli->query("SELECT * FROM users WHERE id = '$id'"); if ($result) { // Good Query $row = $result->fetch_assoc(); if ($row) { $this->username = $row['username']; // Turn on for debug display. Comment out when satisfied with the returned value. echo '$this->username : ' . $this->username . "<br /> <br /> \n"; $this->firstname = $row['firstname']; // Turn on for debug display. Comment out when satisfied with the returned value. echo '$this->firstname : ' . $this->firstname . "<br /> <br /> \n"; $this->lastname = $row['lastname']; // Turn on for debug display. Comment out when satisfied with the returned value. echo '$this->lastname' . $this->lastname . "<br /> <br /> \n"; } else { echo "Bad Row returned : " . "<br /> <br /> \n"; if (is_array($row)) { foreach($row as $rowReturned) { echo $rowReturned . "<br /> <br /> \n"; } } if (is_string($row)) { echo $row . "<br /> <br /> \n"; } if (!isset($row)) { echo "\$row is not set" . "<br /> <br /> \n"; } if ($row == NULL) { echo "\$row is NULL" . "<br /> <br /> \n"; } } } // END if ($result) { // Good Query else { echo 'Query Failed' . "<br /> <br /> \n"; } } // END if ($mysqli) { // Good Connect else { echo 'Did not connect to the database' . "<br /> <br /> \n"; } } // END public function __construct($id) } // END class userinfo { $userinfo = new userinfo($_SESSION['user_id']); $firstname = $userinfo->firstname; echo $firstname . "<br /> <br /> \n"; ?> Scot
  25. rhodesa, Thanks... I am one step closer to being a Javascript Guru, like you. Scot
×
×
  • 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.