Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8410081
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T00:05:03+00:00 2026-06-10T00:05:03+00:00

I have a link that I would like to get multiple values from to

  • 0

I have a link that I would like to get multiple values from to submit through Ajax. So how would I select the streamitem_creator/target/content and type_id from this link to pass into share.php?

echo"<a title='Share ".$poster_name['fullusersname']."s status' href='include/share.php?streamitem_creator=".$streamitem_data['streamitem_creator']."&streamitem_target=".$_SESSION['id']."&streamitem_content=".$streamitem_data['streamitem_content']."&streamitem_type_id=4'/>Share</a>";

I’ve come up with my soloution user data- within the link

LINK

 echo'<a class="sharelink" title="Share '.$poster_name['fullusersname'].'s status" href="#"
     data-streamitem_creator='.$streamitem_data['streamitem_creator'].'
     data-streamitem_target='.$_SESSION['id'].'
     data-streamitem_content='.$streamitem_data['streamitem_content'].'
     data-streamitem_type_id=4>Share</a>';

AJAX

$(document).ready(function(){
$('.sharelink').click(function(e){

var streamitem_creator = $(this).data('streamitem_creator');
var streamitem_target = $(this).data('streamitem_target');
var streamitem_content = $(this).data('streamitem_content');
var streamitem_type_id = $(this).data('streamitem_type_id');

$.ajax({
type: "GET",
url: "../include/share.php",
data: { streamitem_creator: streamitem_creator, streamitem_target: streamitem_target, streamitem_content: streamitem_content, streamitem_type_id: streamitem_type_id }, 
success: function(msg){
$('#result').html(msg);
e.preventDefault(); 
}
});
});
}); 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T00:05:05+00:00Added an answer on June 10, 2026 at 12:05 am

    To get the <a> elements href attribute you could do:

    var link = $('a[href^="include/share.php?streamitem_creator"]').attr('href');
    

    but using an ID would be more specific and simpler.

    To get an array of the querystring values you could do :

    var qs = link.split('?')[1].split('&');
    

    but it’s hard to tell what the querystring looks like when it’s all in PHP ?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a custom feature, and I'd like to link to that functionality from
I have a link that takes me to an image. How would I go
I have a link that I want to look like a button so I
I have a link that looks like this: <a onclick=myLightbox rel=lightbox href=image.jpg title=> I
I have a few tables that I need to link together to get a
I have a db model for which I would like to edit with multiple
I have a text with multiple links in it. One single link looks like
I have link that calls a function when clicked: <a href=javascript:spawnMenu(this); id=link1>Test1</a> To make
I have a link that I want to center vertically in the .well class
I have a link that opens a Thickbox... <a href=page.php?tag=lists-element&keepThis=true&TB_iframe=true&height=450&width=500> Everything works with this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.