
ldrrp
New Members-
Posts
6 -
Joined
-
Last visited
Never
Everything posted by ldrrp
-
Fatal error: Uncaught exception 'Exception' with message 'Could not get reply: SSL certificate problem, verify that the CA cert is OK. Details: error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed' in Z:\Documents\htdocs\trade\mtgox.php:33 Stack trace: #0 Z:\Documents\htdocs\trade\mtgox.php(40): mtgox_query('0/info.php') #1 {main} thrown in Z:\Documents\htdocs\trade\mtgox.php on line 33
-
i been trying to get this code to work but it just wont <? function mtgox_query($path, array $req = array()) { // API settings $key = ''; $secret = ''; // generate a nonce as microtime, with as-string handling to avoid problems with 32bits systems $mt = explode(' ', microtime()); $req['nonce'] = $mt[1].substr($mt[0], 2, 6); // generate the POST data string $post_data = http_build_query($req, '', '&'); // generate the extra headers $headers = array( 'Rest-Key: '.$key, 'Rest-Sign: '.base64_encode(hash_hmac('sha512', $post_data, base64_decode($secret), true)), ); // our curl handle (initialize if required) static $ch = null; if (is_null($ch)) { $ch = curl_init(); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MtGox PHP client; '.php_uname('s').'; PHP/'.phpversion().')'); } curl_setopt($ch, CURLOPT_URL, 'https://mtgox.com/api/'.$path); curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data); curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // run the query $res = curl_exec($ch); if ($res === false) throw new Exception('Could not get reply: '.curl_error($ch)); $dec = json_decode($res, true); if (!$dec) throw new Exception('Invalid data received, please make sure connection is working and requested API exists'); return $dec; } // example 1: get infos about the account, plus the list of rights we have access to var_dump(mtgox_query('0/info.php')); ?> Fatal error: Call to undefined function curl_init() in Z:\Documents\htdocs\trade\mtgox.php on line 23
-
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 80 I have no clue what to do! this is the config.php file: <?php // +----------------------------------------------------------------------+ // | PHP Version 4 | // +----------------------------------------------------------------------+ // | Copyright (c) 1997-2003 The PHP Group | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the PHP license, | // | that is bundled with this package in the file LICENSE, and is | // | available at through the world-wide-web at | // | http://www.php.net/license/2_02.txt. | // | If you did not receive a copy of the PHP license and are unable to | // | obtain it through the world-wide-web, please send a note to | // | [email protected] so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // | Author: Bertrand Mansion <[email protected]> | // +----------------------------------------------------------------------+ // // $Id: Config.php,v 1.22 2006/12/22 00:35:34 aashley Exp $ require_once('PEAR.php'); require_once('Config/Container.php'); $GLOBALS['CONFIG_TYPES'] = array( 'apache' => array('Config/Container/Apache.php', 'Config_Container_Apache'), 'genericconf' => array('Config/Container/GenericConf.php', 'Config_Container_GenericConf'), 'inifile' => array('Config/Container/IniFile.php', 'Config_Container_IniFile'), 'inicommented' => array('Config/Container/IniCommented.php', 'Config_Container_IniCommented'), 'phparray' => array('Config/Container/PHPArray.php', 'Config_Container_PHPArray'), 'phpconstants' => array('Config/Container/PHPConstants.php', 'Config_Container_PHPConstants'), 'xml' => array('Config/Container/XML.php', 'Config_Container_XML') ); /** * Config * * This class allows for parsing and editing of configuration datasources. * Do not use this class only to read datasources because of the overhead * it creates to keep track of the configuration structure. * * @author Bertrand Mansion <[email protected]> * @package Config */ class Config { /** * Datasource * Can be a file url, a dsn, an object... * @var mixed */ var $datasrc; /** * Type of datasource for config * Ex: IniCommented, Apache... * @var string */ var $configType = ''; /** * Options for parser * @var string */ var $parserOptions = array(); /** * Container object * @var object */ var $container; /** * Constructor * Creates a root container * * @access public */ function Config() { $this->container =& new Config_Container('section', 'root'); } // end constructor /** * Returns true if container is registered * * @param string $configType Type of config * @access public * @return bool */ function isConfigTypeRegistered($configType) { return isset($GLOBALS['CONFIG_TYPES'][strtolower($configType)]); } // end func isConfigTypeRegistered /** * Register a new container * * @param string $configType Type of config * @param array|false $configInfo Array of format: * array('path/to/Name.php', * 'Config_Container_Class_Name'). * * If left false, defaults to: * array('Config/Container/$configType.php', * 'Config_Container_$configType') * @access public * @static * @author Greg Beaver <[email protected]> * @return true|PEAR_Error true on success */ function registerConfigType($configType, $configInfo = false) { if (Config::isConfigTypeRegistered($configType)) { $info = $GLOBALS['CONFIG_TYPES'][strtolower($configType)]; if ($info[0] == $configInfo[0] && $info[1] == $configInfo[1]) { return true; } else { return PEAR::raiseError("Config::registerConfigType registration of existing $configType failed.", null, PEAR_ERROR_RETURN); } } if (!is_array($configInfo)) { // make the normal assumption, that this is a standard config container added in at runtime $configInfo = array('Config/Container/' . $configType . '.php', 'Config_Container_'. $configType); } $file_exists = @include_once($configInfo[0]); if ($file_exists) { if (!class_exists($configInfo[1])) { return PEAR::raiseError("Config::registerConfigType class '$configInfo[1]' not found in $configInfo[0]", null, PEAR_ERROR_RETURN); } } else { return PEAR::raiseError("Config::registerConfigType file $configInfo[0] not found", null, PEAR_ERROR_RETURN); } $GLOBALS['CONFIG_TYPES'][strtolower($configType)] = $configInfo; return true; } // end func registerConfigType /** * Returns the root container for this config object * * @access public * @return object reference to config's root container object */ function &getRoot() { return $this->container; } // end func getRoot /** * Sets the content of the root Config_container object. * * This method will replace the current child of the root * Config_Container object by the given object. * * @param object $rootContainer container to be used as the first child to root * @access public * @return mixed true on success or PEAR_Error */ function setRoot(&$rootContainer) { if (is_object($rootContainer) && strtolower(get_class($rootContainer)) === 'config_container') { if ($rootContainer->getName() === 'root' && $rootContainer->getType() === 'section') { $this->container =& $rootContainer; } else { $this->container =& new Config_Container('section', 'root'); $this->container->addItem($rootContainer); } return true; } else { return PEAR::raiseError("Config::setRoot only accepts object of Config_Container type.", null, PEAR_ERROR_RETURN); } } // end func setRoot /** * Parses the datasource contents * * This method will parse the datasource given and fill the root * Config_Container object with other Config_Container objects. * * @param mixed $datasrc Datasource to parse * @param string $configType Type of configuration * @param array $options Options for the parser * @access public * @return mixed PEAR_Error on error or Config_Container object */ function &parseConfig($datasrc, $configType, $options = array()) { $configType = strtolower($configType); if (!$this->isConfigTypeRegistered($configType)) { return PEAR::raiseError("Configuration type '$configType' is not registered in Config::parseConfig.", null, PEAR_ERROR_RETURN); } $includeFile = $GLOBALS['CONFIG_TYPES'][$configType][0]; $className = $GLOBALS['CONFIG_TYPES'][$configType][1]; include_once($includeFile); $parser = new $className($options); $error = $parser->parseDatasrc($datasrc, $this); if ($error !== true) { return $error; } $this->parserOptions = $parser->options; $this->datasrc = $datasrc; $this->configType = $configType; return $this->container; } // end func &parseConfig /** * Writes the container contents to the datasource. * * @param mixed $datasrc Datasource to write to * @param string $configType Type of configuration * @param array $options Options for config container * @access public * @return mixed PEAR_Error on error or true if ok */ function writeConfig($datasrc = null, $configType = null, $options = array()) { if (empty($datasrc)) { $datasrc = $this->datasrc; } if (empty($configType)) { $configType = $this->configType; } if (empty($options)) { $options = $this->parserOptions; } return $this->container->writeDatasrc($datasrc, $configType, $options); } // end func writeConfig } // end class Config ?>
-
Yes i am, and they are disabled on production, its just this one error thats in a file thats it not one of mine, C:\xampp\php\PEAR\Config.php and its annoying me.
-
Display my php errors somewhere other than where they occur, Its messing up my css. Id like to move them maybe to the bottom of the page or in some kind of box, Theres a few deprecated warnings that are part of system files not my code.
-
i am storing my menu in the database, i want to be able to output it by priority, heres so far what i have. I have no idea were to start. Database dump: -- -- Table structure for table `menu` -- CREATE TABLE IF NOT EXISTS `menu` ( `menu_access_lvl` int(2) NOT NULL, `priority` int(11) NOT NULL, `name` varchar(200) NOT NULL, `comment` text NOT NULL, `location` text NOT NULL, `creator_id` varchar(255) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `menu` -- INSERT INTO `menu` (`menu_access_lvl`, `priority`, `name`, `comment`, `location`, `creator_id`) VALUES (0, 1, 'Home Page', 'Home page', 'index.php', 'admin'), (0, 3, 'Contact', 'Contact', 'index.php?PG=contact', 'admin'), (0, 2, 'Events & Meetings', 'Events & Meetings', 'index.php?PG=events', 'admin'), (0, 4, 'About', 'About', 'index.php?PG=about', 'admin'), (2, 5, 'Admin', 'Admin', 'index.php?PG=admin', 'admin'); And here is the php code displaying it //gets the role of the user if set, otherwise role = 0 if(isset($_SESSION['SESS_MEMBER_ID']))$lvl = $_SESSION['SESS_ROLE']; else $lvl = 0; // this loads the menu buttons that correspond to the users role $menuqry="SELECT * FROM menu WHERE menu_access_lvl<='$lvl'"; $menuresult=mysql_query($menuqry); while($row = mysql_fetch_array($menuresult)){ echo "<li class=\"menuitem\"><a href=\"".$row['location']."\">".$row['name']."</a></li>"; } What this currently displays: Home Contact Events & meetings About I want it to be according to priority in the menu like: Home Events & meetings Contact About