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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:24:22+00:00 2026-05-26T22:24:22+00:00

So, heres a super simple jQuery / AJAX comment system step one. Step two

  • 0

So, heres a super simple jQuery / AJAX comment system step one. Step two is the PHP to insert the data into the DB. I need the $_GET[‘variable’] for the page / a $_SERVER[‘variable’] to store into the DB. How can I get these in the jquery. I can’t just say $spot = $_GET['spot'] or $url = $_SERVER['FILE_SCRIPTNAME'] in the PHP. It won’t pick it up. I has to be sent through the jQuery / AJAX. How can I do this?

$(document).ready(function() {
        $('#submit_comment').click(function() {
            var comment = $('#place_comment').val();
            // Somewhere here set the $_GET['variable'];
            $.ajax({
                type: 'POST',
                url: 'http://localhost/app/comment/comment.func.php',
                data: 'comment='+comment,
                success: function(data) {
                    $('#replies').html(data);
                    }
                });
            });
        });
  • 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-26T22:24:23+00:00Added an answer on May 26, 2026 at 10:24 pm

    If I understand what you are trying to do correctly, you can try something like this to use server-side PHP variables in your client-side javascript.

    var comment = $('#place_comment').val();
    var myVariable = '<?php echo $_GET['variable'] ?>';
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm looking for a super simple jQuery extension. Basically I need to use some
Heres a simple php script that generates some XML: <?php // create doctype $dom
A simple answer to this super simple question would be great! Here is the
Super weird problem here. I'm having trouble getting jQuery to bind any selectors except
Heres my simple html source <html> <head> <title> Dec2Bin </title> <script type=text/javascript> function app()
This should be super simple, but I'm not sure why the compiler is complaining
This might be a super simple bug, but my eyes are practically bleeding from
I have a web service that returns a super simple list of objects MyObject[]
I have made a super simple test case of a problem I'm having with
Hey so I installed IR_Black.terminal using the tutorial here: http://blog.toddwerth.com/entries/13 And it's super simple.

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.