edhkirk Posted August 31, 2009 Share Posted August 31, 2009 I am trying to execute the following command in a php file: require("/home/content/*myserver/kithomegreen/wp-content/plugins/wp-o-matic/cron.php?code=f988040a"); But I get the error: "failed to open stream: No such file or directory" When I remove the question mark, it executes fine but does not pass the variable code. Do I need to change the syntax for the question mark, or is there another way to pass the code to the next file? Quote Link to comment Share on other sites More sharing options...
fooDigi Posted August 31, 2009 Share Posted August 31, 2009 since your php file is including cron.php... just set a variable before you include it, and it will be accessible... $code="f988040a"; require("/home/content/*myserver/kithomegreen/wp-content/plugins/wp-o-matic/cron.php"); and you will be able to reference "$code" from within cron.php Quote Link to comment Share on other sites More sharing options...
edhkirk Posted September 1, 2009 Author Share Posted September 1, 2009 I tried this and it did not seem to work. Is it possible that the cron.php code went to look for the variable "code" in the query again, and failed to find it? Thus it overwrote the value or set it to null. Quote Link to comment Share on other sites More sharing options...
edhkirk Posted September 1, 2009 Author Share Posted September 1, 2009 Here is the code for the cron.php: <?php require_once(dirname(__FILE__) . '/../../../wp-config.php'); nocache_headers(); // if uninstalled, let's not do anything if(! get_option('wpo_version')) return false; // check password if(isset($_REQUEST['code']) && $_REQUEST['code'] == get_option('wpo_croncode')) { require_once( dirname(__FILE__) . '/wpomatic.php' ); $wpomatic->runCron(); } else $wpomatic->log('Warning! cron.php was called with the wrong password or without one!'); Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.