通过base64加密的php链接斗篷——需要帮助

发布于 2024-10-08 02:07:25 字数 459 浏览 1 评论 0原文

我曾经有一个脚本,基本上对链接进行 base64 编码,然后重定向 PHP 页面对其进行解码并将您发送到该页面。

我不知道我做错了什么,PHP 不是我最好的技能,只是寻求一些帮助。

页面链接:

<a href="http://www.XXXXXX.com/find.php?shop=<?php echo urlencode(base64_encode("long ass link goes here"));  ?>">Test</a> 

find.php:

< ?php

    $request_id = $_GET ['shop'];
    $site = base64_decode($request_id);

    header( 'Location: $site' ) ;

?>

I used to have a script that basically base64 encoded the link and then the redirect PHP page would decode it and send you off to the page.

I don't know what I am doing wrong and PHP is not my best skill, just looking for some help.

Link on page:

<a href="http://www.XXXXXX.com/find.php?shop=<?php echo urlencode(base64_encode("long ass link goes here"));  ?>">Test</a> 

find.php:

< ?php

    $request_id = $_GET ['shop'];
    $site = base64_decode($request_id);

    header( 'Location: $site' ) ;

?>

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

梦亿 2024-10-15 02:07:25

如果要在字符串中使用 $variables,请使用双引号:

header("Location: $site");

或连接字符串:

header('Location: '.$site);

更多信息 这里

+++ 但最好将该值存储到 $_SESSION 中,因为用户可以更改它,并且会引发错误。

If you want to use $variables in strings, use double quotes:

header("Location: $site");

Or concatenate the strings:

header('Location: '.$site);

More info here

+++ But better store that value into $_SESSION, because users can change it and it will bring up errors.

深爱不及久伴 2024-10-15 02:07:25

如果您复制并粘贴了第二个代码,请尝试删除 <? 之间的空格。它应该是

If you copied and pasted that second code, try removing the space between < and ?. It should be <?php.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文