Zen Follower
- Join Date:
- Oct 2007
- Posts:
- 105
- Plugin Contributions:
- 0
Google Checkout module for ZC 1.3.x (beta)
limelites:
previously declared in /home/xxxxx/public_html/googlecheckout/gcheckout.php:39) in /home/xxxxx/public_html/googlecheckout/gcheckout.php on line 38
What does it say on line 38?
Lines 38 thru 45:
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
function strleft($s1, $s2) {
return substr($s1, 0, strpos($s1, $s2));
I can make that error go away by changing:
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
to
if (!function_exists('selfURL')) {
function selfURL() {
$s = empty($_SERVER["HTTPS"]) ? '' : ($_SERVER["HTTPS"] == "on") ? "s" : "";
$protocol = strleft(strtolower($_SERVER["SERVER_PROTOCOL"]), "/").$s;
$port = ($_SERVER["SERVER_PORT"] == "80") ? "" : (":".$_SERVER["SERVER_PORT"]);
return $protocol."://".$_SERVER['SERVER_NAME'].$port.$_SERVER['REQUEST_URI'];
}
}
and that's when I get this error:
Fatal error: Cannot redeclare strleft() (previously declared in /home/XXXXX/public_html/googlecheckout/gcheckout.php:46) in /home/XXXXX/public_html/googlecheckout/gcheckout.php on line 46
I promise that I have really tried (and tried) to fix this!!
Thanks
Nancy