Jump to content

onegative

Members
  • Posts

    14
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

onegative's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. So I finally figured out my problem...seems that our http proxy.pac contains a timeout variable which was causing my Browser Timeout...whenever it did not receive a response within 180 seconds... Unbelievable... Thanks everyone for the suggestions though... Danny
  2. Sorry wasn't trying to be a smart @ss... And no .htaccess in play here. The MySQL query continues to run and I can confirm that by using PHPADMIN to watch the MySQL process that is performing the query. The funny thing is that I still don't understand what timeout is actually happening. If my query is shorter than 180 seconds everything is fine and dandy but if it takes 181+ seconds I get the Browser Network Error message about the web server being too busy or unavailable. The php query that performs the SELECT starts and of course the web page sits there as the query occurs and then the magic 180 second passes and the page times out...where in the world could this time out exist??? Is it possible that the web browser itself is the issue??? I have even modified/added some registry entries that is suppose to increase the Browser's time out but it does not help... Does anyone have this problem??? Thanks for your help, Danny
  3. Of course, I have restarted the web server so many times I can do it with my eyes closed...just can't figure out where this timeout exist.
  4. Yes I have it set to 1200. I have tried changing virtually every configuration setting I can think of but still "No Joy". The funny thing is that it is a consistent 180 second timeout but I can't figure where it is set. The php page is a PHP_SELF so I start out placing the text I intend on using in my SQL query which if it returns the search before the 180 seconds everything is fine. But if the SQL query exceeds 180 seconds I get the following message... Network Error (tcp_error) A communication error occurred: "" The Web Server may be down, too busy, or experiencing other problems preventing it from responding to requests. You may wish to try again at a later time. I just can't figure out where this timeout is set. Danny
  5. I already have set_time_limit(900); but the browser still times out at 180 seconds.... Danny
  6. Good day everyone, I am trying to overcome a problem with a PHP script that performs a MySQL query using RegEx to locate records which can take as long as 3 or 4 minutes to return the results. Well that isn't the real problem because the query is doing the best it can due to what information it is trying to be extract from the records. The real problem is that exactly 180 seconds after I start the query my Browser times out with the standard Network Error (tcp_error) which then prevents the results from being returned to the browser. I have attempted to do all type of things in the httpd.conf, php.ini and even the IE registry to prevent this from occurring. Can anyone help me understand what I can do to get around this problem? In the php script once it issues the mysql query the script halts until the results are returned so I am not sure if there is some way to keep the browser active prior to the mysql query so that it does not timeout...I still can't figure where the 180 seconds timeout is actually set else I would even try to extend it to 300 seconds... Any and all suggestions would be greatly appreciated... Thanks, Danny
  7. Good day folks, I am having trouble with libphp5.so not being updated after re-compiling php5. I upgraded mysql from 4.1.16 to 5.0.27 and added the appropriate switches to define the new mysql parameters but the library file still contains references to the old mysql instance and I can't seem to get over the issue. Does anyone have any idea how I can force the removal of the old mysql references in the php5 library file because it is causing issues with restarting Apache. If I remove libphp5.so and try to make install it fails and complains about it not being present. Can anyone help me understand the proper steps required to update libphp5.so and get these old mysql 4 references out of the library file? Thanks, Danny
  8. OK, I figured it out. You can use the putenv() function to add environmental variables if you are not running php in safe mode. It allows you to do something as follows: [code] putenv('HOME=/opt/app/p1momw1'); [/code] This allows the php script to use this environmental each time the script is called. I would assume you could also use an include file if it was needed in multiple pages... Anyway, I am glad... DannyG
  9. G'day All, I am trying to understand how to define specific environmental variables needed to run a system command from php? I am using the system() to call the command but even though the user account has the environmental variable set, it does not appear to be used when issuing the command from within my php code. Not sure what I am missing and all the searches I have done with regard to defining environmental variables within php code seem vague if not non-existant. Any help would be appreciated and thanks in advance... DannyG
  10. Hey Ken, I just saw it.... [code] $info=$_POST['info']; [/code] That builds my array into the current namespace so I can access it.... Whoooo Hoooooo! Many thanks and have a great day, Danny
  11. Hey Ken, I have learned a lot of stuff today. Your suggestions have been taken to heart. I really see the benefit of using an array in the form's field name especially when the form contain as much as a 1000 fields. That was a killer idea... Also thanks for pointing out the finer points of using the proper syntax on some of the smaller items. I took your advice and used the tmp array to manage the table rows and then impolde them to the page, again an outstanding use of an array, I will definately use this technique going forward as I learn more about php. There were small changes required as I had to use the actual row names from the table as well as a couple small syntax related changes but it is working like a champ. And you were correct about using the: [code] echo '<pre>' . print_r($_POST,true) . '</pre>'; [/code] As I can now see the array data... Array ( [info] => Array ( [1] => Array ( [StarTrac] => 77701 [Recipient] => dg4305 [RepeatPage] => 1 [RepeatTime] => 1800 [BlkOutPeriod] => 00:00-07:00 ) [2] => Array ( [StarTrac] => 76601 [Recipient] => wh3275 [RepeatPage] => 1 [RepeatTime] => 1800 [BlkOutPeriod] => 00:00-07:00 ) and so on... As a final request that I believe will help me understand the complete aspect of using an array being passed through the $_POST is "How do I actually get to array data?" I attempted to use the snipet of code you provided but I am unsure how to grab the array from the $_POST query string...nothing jumps out to me as obvious...my quess is I have to parse the $_POST somehow before using this snipet of code???? [code] foreach($info as $id => $fields) {      echo 'ID: ' . $id . "\n";      foreach ($fields as $k => $v) {           echo '>>>>>' . $k . ' = ' . $v . "\n";      } } [/code] Again many thanks for the lesson, it has been great...and I would completely understand if you can not help me further, regardless you have been very kind and I do appreciate the help. Danny
  12. By the way, thank you bvery, very much for your help. I truly appreciate you giving time to this. Well most of this made sense, I see the logic in using an array for the form name, but I am a little confused about how it would be extracted from the $_POST query string. I had made modifications as you suggested to the script, as far as the submit and form tag they were outside the <?php ?> tags so I didn't include them but I have included the entire file at the bottom.. The thing that has me confused is if I do indeed use the follow code and set the field name to an array as such: [code] <td bgcolor=\"$row_color\"><input type=\"text\" name=\"info[$agid][StarTrac]\" value=\"$startrac\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"info[$agid][Recipient]\" value=\"$recipient\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"info[$agid][RepeatPage]\ " value=\"$repeatpage\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"info[$agid][RepeatTime]\ " value=\"$repeattime\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"info[$agid][BlkOutPeriod ]\" value=\"$blkoutperiod\"></td> [/code] Why does the my $_POST loop only return the following? Is the info = Array indicating there is an array there? Welcome Danny Gibson! info = Array hostname = tspform01 update = Update information The $_POST loop I am using is: [code]         foreach ($_POST as $key=>$value):                 echo $key . " " . "=" . " " . $value;                 echo "<BR/>";         endforeach; [/code] I have included the entire php file in hopes you will see where I have gone astray: [code] <html> <head> <title>Update Notifications</title> </head> <body> <?php // Includes Required include 'db.php'; include 'sessionChk.php'; // Session starter and session verifier session_start(); session_checker(); ?> <form method="post" action="<?php echo $PHP_SELF?>"> <?php // Welcome message displaying registered session info echo "Welcome ". $_SESSION['first_name'] ." ". $_SESSION['last_name'] ."!<br /><br />"; // If the call to this form is from notifications.php use this path if (isset($_POST['Arraybox'])){         // Message indicating which host is being queried         $hostname =  $_POST['Arraybox'];         echo "<H3>$hostname</H3><BR />";         // Initial SELECT against host selected         $sql = mysql_query("SELECT * FROM patHost,patAlertGroup,patAlert WHERE HostName='$hostname' AND patHost.HOST_ID=patAlertGroup.HOST_ID AND patAlertGroup.ALERTGROUP_ID=patAlert.ALERTGROUP_ID");         // Building table headers                 echo "<table>         <tr>                 <td><b>AlertGroup</b></td>                 <td><b>StarTrac</b></td>                 <td><b>Recipient</b></td>                 <td><b>RepeatPage</b></td>                 <td><b>RepeatTime</b></td>                 <td><b>BlkOutPeriod</b></td>         </tr>";                 // Alternate colors for table rows                 $color1 = "#CCFFCC";                 $color2 = "#BFD8BC";                 // Row color starter for modulus                 $row_count = 0;                 //  Looping through sql results and building php array                 while ($row = mysql_fetch_assoc($sql)){                 $alertgroup[] = $row[AlertGroup].":".$row[StarTrac].":".$row[Recipient].":".$row[RepeatPage].":".$row[RepeatTime].":".$row[BlkOutPeriod].":".$row[ALERTGROUP_ID];                 }         foreach($alertgroup as $key=>$value):                 list($ag, $startrac, $recipient, $repeatpage, $repeattime, $blkoutperiod,$agid) = split(":", $value, 7);                 $row_color = ($row_count % 2) ? $color1 : $color2;                 echo "<tr>             <td bgcolor=\"$row_color\">$ag</td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"info[$agid][StarTrac]\"value=\"$startrac\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"info[$agid][Recipient]\" value=\"$recipient\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"info[$agid][RepeatPage]\" value=\"$repeatpage\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"info[$agid][RepeatTime]\" value=\"$repeattime\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"info[$agid][BlkOutPeriod]\" value=\"$blkoutperiod\"></td>             </tr>";             $row_count++;         endforeach;                 echo "</table>"; } // If the call to this form is from PHP SELF use this path else{         foreach ($_POST as $key=>$value):                 echo $key . " " . "=" . " " . $value;                 echo "<BR/>";         endforeach; } echo "<input type=\"Hidden\" name=\"hostname\" value=$hostname>"; echo "<BR/>"; ?> <center> <input type="Submit" name="update" value="Update information"> </center> </form> </body> </html> [/code]
  13. OK, I have a form that is created and populated with data from a SQL query. The reason for the form data was to create a way to update multiple fields. So once I build the form, then I want to be able to modify fields of that form. Then I perform a test to see if it is an update, if an update I then process the $_POST query string but I need to use it to perform an UPDATE to the database. I did not want to perform an UPDATE on each row, but rather create an array and then loop the array to update the rows. Here is the code thus far, again this is my first php I have ever written so its formatting and/or shortcuts my not be of a caliber that a php guru would approve. But I thank you very much for your help and/or suggestions in learning how to understand its proper usage... DannyG [code] <?php // Includes Required include 'db.php'; include 'sessionChk.php'; // Session starter and session verifier session_start(); session_checker(); ?> <form method="post" action="<?php echo $PHP_SELF?>"> <?php // Welcome message displaying registered session info echo "Welcome ". $_SESSION['first_name'] ." ". $_SESSION['last_name'] ."!<br /><br />"; // If the call to this form is from notifications.php use this path if($_POST[Arraybox]){         // Message indicating which host is being queried         $hostname =  $_POST[Arraybox];         echo "<H3>$hostname</H3><BR />";         // Initial SELECT against host selected         $sql = mysql_query("SELECT * FROM patHost,patAlertGroup,patAlert WHERE HostName='$hostname' AND patHost.HOST_ID=patAlertGroup.HOST_ID AND patAlertGroup.ALERTGROUP_ID=patAlert.ALERTGROUP_ID");         // Building table headers                 echo "<table>         <tr>                 <td><b>AlertGroup</b></td>                 <td><b>StarTrac</b></td>                 <td><b>Recipient</b></td>                 <td><b>RepeatPage</b></td>                 <td><b>RepeatTime</b></td>                 <td><b>BlkOutPeriod</b></td>         </tr>";                 // Alternate colors for table rows                 $color1 = "#CCFFCC";                 $color2 = "#BFD8BC";                 // Row color starter for modulus                 $row_count = 0;                 //  Looping through sql results and building php array                 while ($row = mysql_fetch_array($sql)){                 $alertgroup[] = $row[AlertGroup].":".$row[StarTrac].":".$row[Recipient].":".$row[RepeatPage].":".$row[RepeatTime].":".$row[BlkOutPeriod].":".$row[ALERTGROUP_ID];                 }         foreach($alertgroup as $key=>$value):                 list($ag, $startrac, $recipient, $repeatpage, $repeattime, $blkoutperiod,$a gid) = split(":", $value, 7);                 $row_color = ($row_count % 2) ? $color1 : $color2;                 echo "<tr>             <td bgcolor=\"$row_color\">$ag</td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"$agid~StarTrac\" value=\"$startrac\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"$agid~Recipient\" value=\"$recipient\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"$agid~RepeatPage\" value=\"$repeatpage\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"$agid~RepeatTime\" value=\"$repeattime\"></td>             <td bgcolor=\"$row_color\"><input type=\"text\" name=\"$agid~BlkOutPeriod\" value=\"$blkoutperiod\"></td>             </tr>";             $row_count++;         endforeach;                 echo "</table>"; } // If the call to this form is from PHP SELF use this path else{         foreach ($_POST as $key=>$value):                 //echo $key . " " . "=" . " " . $value;                 //echo "<BR/>";                 $parts = explode("~", $key);                 $base = array($parts[0]=>array($parts[1], $value));                 print "<pre>";                 print_r($base);                 print "</pre>";         endforeach; } ?> [/code]
  14. How am in need of help trying to understand the proper way to take my $_POST variables and build an array. Not that I do not understand the array concept, but how to do so with the following variables. My overall goal is to rebuild my UPDATE query from my form...this is my very first php application thus please overlook my ignorance. Here is a sample of the $_POST key => value pairs: 266~StarTrac = 77701 266~Recipient = dg4305 266~RepeatPage = 1 266~RepeatTime = 1800 266~BlkOutPeriod = 00:00-07:00 267~StarTrac = 76001 267~Recipient = wh3275 267~RepeatPage = 1 267~RepeatTime = 1800 267~BlkOutPeriod = 00:00-07:00 268~StarTrac = 74001 268~Recipient = th5299 268~RepeatPage = 1 268~RepeatTime = 1800 268~BlkOutPeriod = 00:00-07:00 The problem is that the starting numeric value is my ID for the table record, I attached it to the INPUT form name so I could carry the ID with each field from the form. I am UPDATING many fields simultanously from a single form...and I am unsure how to do this properly. What I am looking to get is the data into the following array format from the $_POST key => value pairs. 266 77701 dg4305 1 1800 00:00-07:00 267 76001 wh3275 1 1800 00:00-07:00 268 74001 th5299 1 1800 00:00-07:00 and so on... The direction I am leaning is to use the following code to process the $_POST query string: [code] foreach ($_POST as $key=>$value):      $parts = explode("~", $key);      $base = array($parts[0],$parts[1] = $value);      print "<pre>";      print_r($base);      print "</pre>"; endforeach; [/code] Which results in the following array data: Array ( [0] => 266 [1] => 77701 ) Array ( [0] => 266 [1] => dg4305 ) Array ( [0] => 266 [1] => 1 ) Array ( [0] => 266 [1] => 1800 ) Array ( [0] => 266 [1] => 00:00-07:00 ) Array ( [0] => 267 [1] => 76001 ) Array ( [0] => 267 [1] => wh3275 ) Array ( [0] => 267 [1] => 1 ) Array ( [0] => 267 [1] => 1800 ) Array ( [0] => 267 [1] => 00:00-07:00 ) Array ( [0] => 268 [1] => 74001 ) Array ( [0] => 268 [1] => th5299 ) Array ( [0] => 268 [1] => 1 ) Array ( [0] => 268 [1] => 1800 ) Array ( [0] => 268 [1] => 00:00-07:00 ) But now that I have the array I am not sure how to reference it to extract the data. This is where I am stuck... Any and all suggestions would be greatly appreciated. Thanks, Danny
×
×
  • 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.