1

I have user id and I am getting all information using user id on page with slug.

When I pass the user id in slug then I am not getting user information on page.

For example I have www.mysite.com/test slug.

Can I pass user id like YouTube id www.mysite.com/id=WZeVy5DKtNQ in slug and get user information.

I am trying like this www.mysite.com/test?id=123

code:

$id = $_REQUEST['id'];
$camp_link = get_site_url()."/campaign-detail/?id=".$user_id;
echo "<p class='campaign_store_name'><a href='".$camp_link."'>".$camp_title."</a></p>";
$arform_id = Get_ARFORM_ID_using_slug($camp_link );
1

The code seems incomplete. Maybe the problem is simply that you define $id but then try to use $user_id? Also, I think id is a protected variable, so maybe use my_id instead.

Try this:

www.mysite.com/test?my_id=123

$user_id = $_REQUEST['my_id'];
$camp_link = get_site_url()."/campaign-detail/?id=".$user_id;
echo "<p class='campaign_store_name'><a href='".$camp_link."'>".$camp_title."</a></p>";
$arform_id = Get_ARFORM_ID_using_slug($camp_link);
| improve this answer | |
  • i did this.i have pass user id in slug but i not getting user info on page – Sita Ram Mar 3 '16 at 6:50
  • What do you mean by "not getting user info on page"? What kind of user info do you expect to get? – Johano Fierra Mar 3 '16 at 6:52
  • I modified my answer a bit, please give it a try. Make sure you got $user_id in both places, and that you use my_id behind the slug and in the first line. – Johano Fierra Mar 3 '16 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.