php页面重定向取决于if语句 [英] php page redirection depending on if statement

查看:59
本文介绍了php页面重定向取决于if语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<?php include('aes.php')?> 

<?php
require(includes / conn1.php);


error_reporting(0);
$ workingKey ='asdf4asdf5asdf4asdf5asdf4a';
$ encResponse = $ _ POST [encResponse];


$ rcvdString = decrypt($ encResponse,$ workingKey);


$ decryptValues = explode('&',$ rcvdString);
$ dataSize = sizeof($ decryptValues);

/ * echo< center>;
echo< table cellspacing = 4 cellpadding = 4>;
* / for($ i = 0; $ i< $ dataSize; $ i ++)
{
$ information = explode('=',$ decryptValues [$ i]);
/ * echo'< tr>< td>'。$ information [0]。'< / td>< td>'。$ information [1]。'< / td>< / TR>';
* /
$ ar [] = $ information [1];

}


for($ i = 0; $ i< $ dataSize; $ i ++)
{
if($ ar [$ i] ==''){$ ar [$ i] =null; }

}



$ sql = pg_query(在此处插入声明);


if($ ar [3] =='N')

print< script language =Javascript> document.location.href ='http://abc.in/index.php';< / script>;

else

print< script language =Javascript> document.location.href ='http://abc.in/index2.php';< ; /脚本>中;


退出;

?>







来自上面我们需要的代码重定向页面取决于$ ar [3] =='N'然后abc.in如果不是xyz.in



我们无法重定向,直到插入声明它插入后工作正常它根本不重定向有时我们得到解析错误语法错误意外t_string



请帮助重定向代码在此先感谢

解决方案

workingKey ='asdf4asdf5asdf4asdf5asdf4a';


encResponse =


_POST [encResponse ];

<?php include('aes.php')?>

<?php
require("includes/conn1.php");


error_reporting(0);
$workingKey='asdf4asdf5asdf4asdf5asdf4a';		
$encResponse=$_POST["encResponse"];			


$rcvdString=decrypt($encResponse,$workingKey);		


$decryptValues=explode('&', $rcvdString);
$dataSize=sizeof($decryptValues);

/*echo "<center>";
echo "<table cellspacing=4 cellpadding=4>"; 
*/for($i = 0; $i < $dataSize; $i++) 
{
	$information=explode('=',$decryptValues[$i]);
/*    	echo '<tr><td>'.$information[0].'</td><td>'.$information[1].'</td></tr>';
*/		
		$ar[]=$information[1];
		
}
 
 
for($i = 0; $i < $dataSize; $i++) 
{
if($ar[$i]=='') { $ar[$i]="null"; }

}



$sql=pg_query("insert Statement here");


if($ar[3] == 'N')
 
   print "<script language="Javascript">document.location.href='http://abc.in/index.php' ;</script>";
 
else
 
  print "<script language="Javascript">document.location.href='http://abc.in/index2.php' ;</script>";
 

exit;

?>




here from the above code we need to redirect page depending on " $ar[3] == 'N' " then abc.in if not xyz.in

we are not able to redirect, till insert statement it is working fine after inserting it is not redirecting at all sometimes we get " parse error syntax error unexpected t_string "

please help with redirection code Thanks in advance

解决方案

workingKey='asdf4asdf5asdf4asdf5asdf4a';


encResponse=


_POST["encResponse"];


这篇关于php页面重定向取决于if语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆