doxrxwn2252 2013-03-14 11:04
浏览 31

在处理表单后将变量传递给URL

I'm currently working on a returns system design that is being added on to our current e-commerce system - and i'm stuck at the part where the order number variable is being passed to the thankyou page.

At the moment, the customer goes on to an order page, clicks on the return link (which sends them to a form), which is a set url with the order number dynamically added to the url. This order number is then sent from the form to a form processor, which emails us with the details of the order.

All works fine until the redirect to the thankyou page.

on the form, I have:

if(isset($_POST['submitted']))
 {
  if($formproc->ProcessForm())
 {
  $formproc->RedirectToURL();
 }
}

and in the form processor, I have :

function RedirectToURL()
{
$orderurl = $_POST['orderno'];

    $url = 'thank-you.php?returnreq=' . $orderurl;
    header("Location: $url");
    exit;
}

However, this returns no order number in the thank-you.php page url, despite the order number being passed correctly to the processor (as it sends an email with the correct order number inside)

Thanks for looking!

  • 写回答

2条回答 默认 最新

  • douyun3887 2013-03-14 11:11
    关注

    Try to send the order number as a function param

    function RedirectToURL($orderurl)
    {
    $url = 'thank-you.php?returnreq=' . $orderurl;
    header("Location: $url");
    exit;
    }
    

    change also from the fn call, like

    ....
    $formproc->RedirectToURL($_POST["orderno"]);
    
    ....
    
    评论

报告相同问题?

悬赏问题

  • ¥15 stm32开发clion时遇到的编译问题
  • ¥15 lna设计 源简并电感型共源放大器
  • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
  • ¥15 Vue3地图和异步函数使用
  • ¥15 C++ yoloV5改写遇到的问题
  • ¥20 win11修改中文用户名路径
  • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
  • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
  • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
  • ¥15 帮我写一个c++工程