簡體   English   中英

使用請求php重定向到另一個頁面

[英]Redirect to another page with request php

我有一個php a.php ,它接受發布到它的所有參數

$_REQUEST

我需要將請求與a.php內收到的$ _REQUESTs一起重定向到b.php。 這怎么可能請幫助

如果您只需要b.php可用的數據, b.php只需include "b.php"

嘗試在您的a.php中重定向到b.php

$array=array($_REQUEST['name1'],$_REQUEST['name2']);//form your array
$array=json_encode($array); 

header('Location:b.php?q='.$array.'');

在b.php中

$data=$_REQUEST['q'];
$data=json_decode($data);//you got array here and get the data from here

使用帶有鍵值的數組,效果會更好

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM