dsebywql016137 2019-04-05 09:00
浏览 92
已采纳

如何检测URL中的GET参数,并根据该值放置值?

I am working on a project in PHP and JavaScript, where i have to create a value from my end, and pass the same in URL query string on redirect from my URL, Below is Description: I have a URL, https://abc.amindfad.com/c.php?id={abdid}

on above URL I want redirection, and pass value from my end by detecting where is {abdid}

The above URL will be redirecting from (my URL) :- https://console.adcashod.net/click.php

i have not done anything yet, Because i am little confused in Code which should be used here.

in Results I want that, when I click on (my URL) :- https://console.adcashod.net/click.php

it get redirects to :- https://abc.amindfad.com/c.php?id={abdid} but,

replace {abdid} with a value which is defined by me. for it.

Waiting for suggestions.

  • 写回答

2条回答 默认 最新

  • doubinei1457 2019-04-05 09:54
    关注

    Take a look at this https://www.php.net/manual/en/function.str-replace.php

    $value = 'value_defined_by_me';
    $url = 'https://abc.amindfad.com/c.php?id={abdid}';
    $url = str_replace('{abdid}', $value, $url); //output: https://abc.amindfad.com/c.php?id=value_defined_by_me
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度
  • ¥30 关于#r语言#的问题:如何对R语言中mfgarch包中构建的garch-midas模型进行样本内长期波动率预测和样本外长期波动率预测