Jump to content

lopolla

New Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by lopolla

  1. I have a frontend page lets call is "front.php" and a backend page lets call it "backend.php". When I make actions I POST/GET data from front.php to backend.php, the script then runs (HTTP_REFERER) back to frontend.php. The problem is that sometimes I want to do quite time consuming actions in backend.php. Normally script has to end and afterwards refers you back to frontend.php. So the effect is that user have to wait for script to finish. Is there some way how I am able to make an actions in backend.php - start som sort of independent sub-proces/thread or similar - and return to front.php without waiting for backend.php to finish. My thought was that backend.php (the subproces/thread) could update database and then frontend.php could follow how the subproces/thread was doing.... Normally the time consuming handling consists of retrieving webpages on WWW and retrieve specific information which then is updated into a local database. Hope someone understands and is able to assist me If it is easy a short example would be extremly appriciated All the best!
  2. I have a recursive function which is calling a recursive funtion. The 2nd recursive function have a weird issue, because when I use return-statement it returns to the function itself (probably because that is where it is originated) - so any suggestions to how I secure coming back to main function? Here is the code I am currently working on........ function display_children($arrIn) { global $arrContentGlobal; # retrieve all children of $parent $sql1 = " SELECT * FROM formulaTree WHERE versionId='$arrIn[versionId]' AND criterionId='$arrIn[criterionId]' AND formulaTreeIdRef='$arrIn[parentId]' "; $res1 = mysql_query("$sql1"); $num1 = mysql_num_rows($res1); while($obj = mysql_fetch_array($res1)) { # Find level -> run other function (THIS IS HERE PROBLEM STARTS.....) $arrInLevel[formulaTreeId] = "$obj[formulaTreeId]"; $arrLevel = displayFathers($arrInLevel); # Go for this function again............ $arrIn[parentId] = "$obj[formulaTreeId]"; display_children($arrIn); } } function displayFathers($arrIn) { if(!$arrIn[level]) { $arrIn[level] = 0; } $sqlChild = "SELECT * FROM formulaTree WHERE formulaTreeId='$arrIn[formulaTreeId]'"; $resChild = mysql_query("$sqlChild"); $objChild = mysql_fetch_array($resChild); $arrConceptsId[] = "$objChild[formulaTreeIdRef]"; if($objChild[formulaTreeIdRef] != "0") { $arrIn[level]++; $arrIn[formulaTreeId] = "$objChild[formulaTreeIdRef]"; displayFathers($arrIn); } $arrOut[level] = $arrIn[level]; return($arrOut); }
×
×
  • 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.