我試着開關語句,但還是一樣...現在我選擇了所有選項會$cimb
...誰能幫我讓他們重定向到正確的URL?PHP - 如果別人都不盡如人意
繼波紋管是我的編碼:
$detectpay = mysql_query("select paymethod from themetransaction");
$showdpay = mysql_fetch_array($detectpay);
$credit = "Credit Card";
$cimb = "CIMB Clicks";
$may = "Maybank2U";
$paypal = "Paypal";
$public = "Public eBank";
$rhb = "RHB Now";
switch($showdpay['paymethod'])
{
case $credit:
$echo = "<meta http-equiv='refresh' content='5;url=http://www.facebook.com/' />";
break;
case $cimb:
$echo = "<meta http-equiv='refresh' content='5;url=https://www.cimbclicks.com.my/ibk/' />";
break;
case $may:
$echo = "<meta http-equiv='refresh' content='5;url=https://www.maybank2u.com.my/mbb/m2u/common/M2ULogin.do?action=Login' />";
break;
case $paypal:
$echo = "<meta http-equiv='refresh' content='5;url=https://www.paypal.com/my/cgi-bin/webscr?cmd=_login-submit' />";
break;
case $public:
$echo = "<meta http-equiv='refresh' content='5;url=https://www2.pbebank.com/myIBK/apppbb/servlet/BxxxServlet?RDOName=BxxxAuth&MethodName=login' />";
break;
case $rhb:
$echo = "<meta http-equiv='refresh' content='5;url=https://logon.rhb.com.my/ />";
break;
default:
$echo = "none of the above worked...";
}
echo $echo;
你需要使用一個開關statemente有... –
單'='是賦值運算符,雙''==是比較鬆散和三''===是有嚴格的比較。你至少需要比較寬鬆('==')。除此之外,您應該使用switch語句。主要的好處是你只需要寫一次變量名,而不是你的例子中的6次。 –
@馬蒂亞斯如何做switch語句?即時通訊非常新的PHP – user3652484