[PHP] checking for utilities/applications in the PATH
hi, i am trying to do a simple check for archiving utilities (zip, unzip, ...), to make sure they exist within the PATH, and are executable by PHP. i could not find a better way to do this through php, so i went ahead and did an exec('which ' . $utility, $output, $return_value); then, i check the $return_value for a non-zero value, which would indicate that the utility was not found. using GNU/Linux this seems to work fine, but i wouldn't mind keeping my work cross-platform. so, my question is, is there a better way to do this? and, if not, what i have done, for now is the following: $result = exec('which ' . $utility, $output, $return_val); return( $result && !$return_val ); from one quick test i ran, i determined that exec() simply returns NULL or nothing if the given utility/command doesn't exist (`which`, in this case). so, i expect the above code to simply return true, or skip the test for my $utility rather, if the `which` utility is not present on the system. will this work as expected in all cases/systems? thanks a lot. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] triggering php scripts...
hello, i am wondering if there is a good way to trigger a php script from a web page *without* sending the user to a new page or opening a new browser windows. for instance, suppose you wanted to make a button/link on a web page that, when clicked, would cause a database entry to be decremented. however, you do not want to refresh the page or open a popup window or any stinky little tricks like that. or, if this is not possible, does anyone know how to trigger a php script when someone accesses a particular file from an apache server? or if a file from a particular directory is downloaded... thanks a lot! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] triggering scripts through apache configuration
hello, wondering how you might go about triggering PHP scripts from an apache configuration file, for certain events... for instance, how might i trigger a script whenever a file was accessed within a given directory. and, would it be possible to know which file was accessed? if the above is possible, could you also trigger different scripts for when a "file download begins" and when a "file download finishes"? thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Apache Config: php_value "auto_prepend_file" & "auto_append_file"
hi, i'm running a server with Fedora Core 1. this is using Apache 2.0.48 and PHP 4.3.4. i have my http server root at /var/www/html/. i have some virtual hosts setup. i've just installed phpMyAdmin 2.5.6. my problem lies within the auto_prepend_file and auto_append_file directives provided by PHP. i have no default prepended or appended files, but have these directives set up for each virtual host. so, the section of my httpd.conf file that takes care of this, looks like so: php_value auto_prepend_file /var/www/html/virtual_host1/header.php php_value auto_append_file /var/www/html/virtual_host1/footer.php php_value auto_prepend_file /var/www/html/virtual_host2/header.php php_value auto_append_file /var/www/html/virtual_host2/footer.php now, i have no header or footer defined for phpMyAdmin, which lies under /var/www/html/phpMyAdmin/. but what happens, is that the header and footer from my 1st virtual host are randomly included, making phpMyAdmin look hideous, and often making it not work because it needs to place information in the HTML Header. whether or not these files are included seems to be quite random, tho, as it does not happen all the time. i could log into phpMyAdmin just fine, browse through a few tables, and then it will begin including the header and footer. another thing i've noticed though, is that these files never get included in the Fedora Core Apache Test Page, which lies under /var/www/html/. i think this looks like a bug in either PHP or Apache... any ideas? thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] determining number of rows in a mysql table
this should be easy... how would one go about determining the number of rows in a mysql table, without actually wasting the time of querying for *. is this the best way? $result = mysql_query('SELECT * FROM tablename'); $num_rows = mysql_num_rows($result); does this actually take up time searching? thanks. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP Sessions
hello, i recently started using PHP's sessions. i am finding that the sessions seem to "expire" after 20 or 30 minutes -- or, at least the variables which i set, within $_SESSION, are getting cleared after this relatively short amount of time. before calling session_start(), i do a few initializations: ini_set('session.use_cookies', 1); ini_set('session.use_trans_sid', 0); ini_set('session.save_handler', 'files'); ini_set('session.serialize_handler', 'php'); ini_set('session.name', 'session-id'); i am not setting the 'session.cache_expire' INI variable, and even did a check to make sure it was not being modified, and i found that it contains the default value of 180 (minutes). furthermore, the *cookie* is not expiring. i've also checked 'session.cookie_lifetime', and it is 0 (zero, for "until browser is closed"). i've also checked the browser's cookie list, and the cookie is still around at the time that i lose my session variables. does anyone have any ideas as to why i may be losing my session variables so early? thank you! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php