我试图从名为get_rebate.php的php文件显示$ codeOut的值。打印从另一个.php文件生成的变量
目前我使用:
<?php include ("get_rebate.php"); echo substr($codeOut,7); ?>
,试图从get_rebate.php得到$ codeOut的输出出现在页面上,而是它返回get_rebate.php错误消息产生时,它可以” t验证值。
我可能没有正确调用get_rebate.php($ codeOut)的结果,但正在寻找有关此问题的指导。
get_rebate.php:
<?
$code=$_GET['code'];
$rnum=50000-$_GET['rnum'];
if ($code=="2210" || $code==$rnum) {
makeVerifier($code);
} else { echo "The Rebate Code you have entered (" . $code . ") does not apply to this product.\nPlease consult with your Fitness Expert and request if a Rebate Code\nis available for this product.";
}
function makeVerifier($codeIn) {
$len=strlen($codeIn);
for ($i=0;$i<$len;$i++) {
$codeOut.=ord(substr($codeIn,$i));
if (strlen($codeOut)>7) {break;}
}
echo "Congratulations! Your Manufacturers Rebate Verification Code is M" . substr($codeOut,0,7);
}
?>
页面上的输出是:您输入的折扣代码()不适用于本产品。请咨询您的健身专家,并要求是否有此产品的回馈代码
你需要显示get_rebate.php的内容或解释它的作用 –
你可以发布get_rebate.php的内容吗?如果这是返回错误消息,那么执行可能会暂停,并且永远不会到达您的回声。 – Endophage
哪个错误信息? – KomarSerjio