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 8736657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:21:12+00:00 2026-06-13T10:21:12+00:00

I have a Jquery post script, which for reasons outside of my control has

  • 0

I have a Jquery post script, which for reasons outside of my control has to be placed on a page by use of echo from PHP. Now the issue is that I need to pass information from a form on the page into the data to be posted.

Here is the working script at the moment:

echo '<script type="text/javascript">
$(".discuss_your_report").click( function() {
    $.post(\'/layout/standard/report-action.php\', {
        form: "discuss_your_report", website: "'.$_GET['website'].'", name: "'.$_GET['name'].'", email: "'.$_GET['email'].'", phone: ""},
        function(data){
            $(".message").html(data);
    $(".message").show("slow");
        }
    );
</script>';

In the above script the phone number is empty, this needs to be entered by the user in the page using a standard form input. I have tried many things that have not worked, this being the latest:

echo '<script type="text/javascript">
$(".discuss_your_report").click( function() {
    var phone = $(\'#phone\').val();
    $.post(\'/layout/standard/report-action.php\', {
        form: "discuss_your_report", website: "'.$_GET['website'].'", name: "'.$_GET['name'].'", email: "'.$_GET['email'].'", phone: "phone"},
        function(data){
            $(".message").html(data);
    $(".message").show("slow");
        }
    );
</script>';

For ease of readibility, here it is without the PHP code:

<script type="text/javascript">
$(".discuss_your_report").click( function() {
    var phone = $('#phone').val();
    $.post('/layout/standard/report-action.php', {
        form: "discuss_your_report", website: "www.example.com", name: "my name", email: "info@example.com", phone: "phone"},
    function(data){
    $(".message").html(data);
    $(".message").show("slow");
    }
);
</script>

But this just passes the text ‘phone’. Does anyone know how I can get this to work, any feedback is appreciated. Thanks

  • 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-13T10:21:13+00:00Added an answer on June 13, 2026 at 10:21 am

    have changed var phone to phone_val, have assigned it with phone: phone_val without quote

    echo '<script type="text/javascript">
    $(".discuss_your_report").click( function() {
        var phone_val = $(\'#phone\').val();
        $.post(\'/layout/standard/report-action.php\', {
            form: "discuss_your_report", website: "'.$_GET['website'].'", name: "'.$_GET['name'].'", email: "'.$_GET['email'].'", phone: phone_val},
            function(data){
                $(".message").html(data);
        $(".message").show("slow");
            }
        );
    </script>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have my front end script which has the following jQuery code: $.get(/backend/post.php, {
I have this jQuery script var dataString = class_id=+class_id; $.ajax({ type: POST, url: page.php,
I have written a script that fires a jQuery POST to retrieve data from
I have a PHP script that I'm calling with the .post() function in jQuery.
I have a jQuery text box autocomplete script which uses a PHP script to
I have an AJAX request (using JQuery) that calls a PHP script which does
I have a page which needs to use $.post() but for some reason the
i have a pagination script which working with jquery and php scripts, i am
I have a json_encode in my php script which seems to fail the Jquery
I have a jQuery script: $.ajax({ url: /scripts/secure/development/ajax.asp, type: POST, dataType: text, data: cmd=addresses,

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.