Opencart注册帐户错误

时间:2015-07-08 18:58:13

标签: php e-commerce opencart user-accounts

我目前正在使用Opencart建立网站。在网站上注册帐户时,我获得以下内容:

  

警告:为foreach()提供的参数无效   /homepages/2/d493065440/htdocs/sofas/system/library/mail.php在线   22警告:无法修改标头信息 - 已经发送的标头   (输出从/homepages/2/d493065440/htdocs/sofas/index.php:98开始)   在/homepages/2/d493065440/htdocs/sofas/system/library/response.php上   第12行

有谁知道如何避免这条消息?奇怪的是帐户仍在创建?我附上了response.php文件。任何帮助将不胜感激!



<?php
class Response {
	private $headers = array();
	private $level = 0;
	private $output;

	public function addHeader($header) {
		$this->headers[] = $header;
	}

	public function redirect($url, $status = 302) {
		header('Location: ' . str_replace(array('&amp;', "\n", "\r"), array('&', '', ''), $url), true, $status);
		exit();
	}

	public function setCompression($level) {
		$this->level = $level;
	}

	public function setOutput($output) {
		$this->output = $output;
	}

	public function getOutput() {
		return $this->output;
	}

	private function compress($data, $level = 0) {
		if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') !== false)) {
			$encoding = 'gzip';
		}

		if (isset($_SERVER['HTTP_ACCEPT_ENCODING']) && (strpos($_SERVER['HTTP_ACCEPT_ENCODING'], 'x-gzip') !== false)) {
			$encoding = 'x-gzip';
		}

		if (!isset($encoding) || ($level < -1 || $level > 9)) {
			return $data;
		}

		if (!extension_loaded('zlib') || ini_get('zlib.output_compression')) {
			return $data;
		}

		if (headers_sent()) {
			return $data;
		}

		if (connection_status()) {
			return $data;
		}

		$this->addHeader('Content-Encoding: ' . $encoding);

		return gzencode($data, (int)$level);
	}

	public function output() {
		if ($this->output) {
			if ($this->level) {
				$output = $this->compress($this->output, $this->level);
			} else {
				$output = $this->output;
			}

			if (!headers_sent()) {
				foreach ($this->headers as $header) {
					header($header, true);
				}
			}

			echo $output;
		}
	}
}
&#13;
&#13;
&#13;

0 个答案:

没有答案