functions - Get arguments from URL

I have example link http:mysitelogin?user_id=6?reg=truehow get user_id and reg values form $_GET? if i write:echo ($_

I have example link

http://mysite/login?user_id=6?reg=true

how get user_id and reg values form $_GET?

if i write:

echo ($_GET['user_id']);

Then get this:

6?reg=true

And i try :

echo get_query_var( 'user_id');  

But not work. What i do wrong?

I have example link

http://mysite/login?user_id=6?reg=true

how get user_id and reg values form $_GET?

if i write:

echo ($_GET['user_id']);

Then get this:

6?reg=true

And i try :

echo get_query_var( 'user_id');  

But not work. What i do wrong?

Share Improve this question edited Jul 21, 2019 at 23:41 Jaron asked Mar 24, 2019 at 19:10 JaronJaron 458 bronze badges 2
  • URL is not correctly generated. Share the code that resulted in this malformed URL. – Qaisar Feroz Commented Mar 24, 2019 at 19:22
  • mrben522 answer correctly. I must change '?' to '&'. – Jaron Commented Mar 24, 2019 at 19:23
Add a comment  | 

1 Answer 1

Reset to default 2

Your URL querystring is malformed. ? good before the first variable. & goes before any others. Your url should be http://mysite/login?user_id=6&category=3

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745306736a4621754.html

相关推荐

  • functions - Get arguments from URL

    I have example link http:mysitelogin?user_id=6?reg=truehow get user_id and reg values form $_GET? if i write:echo ($_

    6小时前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信