最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

functions - Get arguments from URL

programmeradmin1浏览0评论

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

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论