dsebywql016137 2019-04-05 01: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 01: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条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部