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

  • Home
  • SEARCH
  • 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 6390811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:35:39+00:00 2026-05-25T03:35:39+00:00

edit3: i am using this script inside a facebook app, and not sure how

  • 0

edit3: i am using this script inside a facebook app, and not sure how to do it

i am passing a var to a php file using a post:

<div id="talentnum" class="cont_talentnum"><?php echo $number; ?></div>
<a class="mine_click" href="#"></a>

js here

 var strtalentnum;
$('.mine_click').live('click', function() {
    strtalentnum = $(this).closest("li").find(".cont_talentnum").text();
    $('#mine').trigger('click');

});

$("#mine").click(function(){
 if(strtalentnum){
  $.ajax({  
  type: "POST",  
  url: "fb_test.php",  
  data: strtalentnum,  
  success: function() { 
    var talentnum = strtalentnum; //this is 6203222
  alert(strtalentnum);
  }  
  });  
 }
});

and the php file is :

<?php
function fb_test()
{ echo 'xxx';
echo $_GET['strtalentnum'];
}
?>

then i call the function in the same html page:

<?php  function fb_test(); ?>

If i run this i get only the xxx. I also get the success alert in my case '6203222' so i know that the POST is happening

if i look in Chrome Network Headers i can see that :

Request Method:POST
Status Code:200 OK
Form Data
6203222:

Why i cant get it using $_GET['strtalentnum']; ?

any ideas?

thanks

edit: $_POST['strtalentnum']; wont do the job either

edit2 added html

  • 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-05-25T03:35:39+00:00Added an answer on May 25, 2026 at 3:35 am

    You need a variable name for that:

    var strtalentnum = $('#strtalentnum').val();
    $("#mine").click(function(){
     if(strtalentnum){
      $.ajax({  
      type: "POST",  
      url: "fb_test.php",  
      data: "strtalentnum=" + strtalentnum,
      dataType: 'html',  
      success: function() { 
        var talentnum = strtalentnum; //this is 6203222
      alert(strtalentnum);
      }  
      });  
     }
    });
    

    Form:

    <form method="post">
    <input id="strtalentnum" type="text" name="strtalentnum" value="526558" />
    <input id="mine" type="submit" name="submit" />
    </form>
    

    Test it now:

    <?php
    function fb_test()
    { echo 'xxx';
    echo $_POST['strtalentnum'];
    }
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

[edit] I am NOT using jquery in this app. Looking for a way to
Using PHP, and MySql, I am trying to implement this rather snazzy in-place editor
I'm trying to incorporate jqueryUI's datepicker inside a partialview like this: <% using (Ajax.BeginForm(/EditData,
EDIT: See this in action here: http://jsbin.com/emobi/5 -- and that's using mouseenter/mouseleave. I have
I'm using markdown to edit this question right now. In some wikis I used
[NOTE: I'm using ASP.NET MVC2 RC2.] I have URLs like this: /customers/123/orders/456/items/index /customers/123/orders/456/items/789/edit My
This is a weird problem. I am using a dataform, and when I edit
I have a text file that I want to edit using Java. It has
I'm making a script which has one ajax call inside an each function. The
I've got a script that inserts some content into an element using innerHTML .

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.