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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T02:40:34+00:00 2026-06-12T02:40:34+00:00

Greetings Stackoverflow How do I set the php $_GET[] array from Jquery? I have

  • 0

Greetings Stackoverflow

How do I set the php $_GET[] array from Jquery? I have a string looking simmilar to this: $sample_string = "Hi there, this text contains space and the character: &";. I also have a variable containing the name of the destination: $saveAs = "SomeVariable";. In PHP it would look following: $_GET["$SomeVariable"] = $sample_string;.

How do I do this in Jquery?

Thanks in advance, Rasmus

  • 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-12T02:40:35+00:00Added an answer on June 12, 2026 at 2:40 am

    If you’re using jQuery, you’ll have to set up an AJAX request on the client side that sends a GET request to the server. You can then pull the data you supplied in the request from the $_GET[] array on the server side.

    $(function() {
        var data =  { 
            sample_string: "hi",
            saveAs: "something"
        };
        $.get('/path/to/script.php', data, function(response) {
            alert(response); // should alert "some response"
        });
    });
    

    And in script.php:

    <?php
    $sample = $_GET['sample_string']; // == "hi"
    $saveAs = $_GET['saveAs']; // == "something"
    // do work
    echo "some response";
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Greetings! I'm trying to have a UIWebView controlled from generated events. Is there a
Greetings to all! This is my first question here on stackoverflow. I have a
Greetings all, Is there any issue in the following logic for allocating 2D array:
Greetings I may have imagined this but does anyone know if Last.fm previously used
<?php if(isset($_GET['img']) && is_numeric($_GET['img'])){ $img = $_GET['img']; $imgarray = array ( '1' => 'http://www.path/to/image1.png',
Greetings stackoverflow. I have been tinkering about with a SOAP client using PHP5's native
Greetings StackOverflow. I have a scenario, in which I have a UITableView with a
Greetings StackOverflow community! For this new project I'm required to write a trigger which
Greetings fellow stackoverflowers, I'm working on a jQuery class where I have a function
Greetings all, I have posted this on the MSDN managed news groups as well

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.