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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T14:42:11+00:00 2026-05-23T14:42:11+00:00

I haven’t touched PHP in years and have been asked to create an wordpress

  • 0

I haven’t touched PHP in years and have been asked to create an wordpress plugin. I’m trying to figure out the “correct” way to do the following:

page1.php
---------
some_plugin(array(
    'option1' => 'some_data',
    'option2' => 'http://do_not_expose_to_client/'
});

generates
---------
<script language="text/javascript">
$.get('/page2.php', { data_set : 1 });
</script>

page2.php
---------
var options = get_options_from_page_1( $_GET['data_set'] );

Make sense I hope? Basically I want to pass a PHP array from page1 –> page2 and am looking for a clean mechanism to do so. I know I can drop data in a session var, but that just seems hacky and if I have multiple instances of this plugin on the page, I need to start tracking instance IDs, etc.

  • 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-23T14:42:12+00:00Added an answer on May 23, 2026 at 2:42 pm

    This is basically a PHP “problem”. Each script is executed in it’s own process in your example and these do not share data.

    An easy way to do so would be infact using $_SESSION, and you’re right you must manage the data on your own. But you must so with any other method (e.g. via the database). I think session is pretty handy then.

    Another method would be to encrypt the data, pass it with the request and then decrypt it again.

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

Sidebar

Related Questions

I haven't worked with SQL Reporting much, however I have been trying to get
I haven't touched sharepoint in years. If I want to setup a development environment
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
Haven't been programming in JS for a while. Now, I have following thing: <html>
Haven't seen anything, but I have seen that you can create albums in the
Haven't done as much of Javascript as I should have done. I am trying
I haven't used the implements keyword before, and I've been trying to use it
I haven't done C++ in a while and can't figure out why following doesn't
I'm trying to create an if statement in PHP that prevents a single post
Haven't seen many Geneva related questions yet, I have posted this question in the

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.