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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T20:34:52+00:00 2026-05-30T20:34:52+00:00

IS there a way to post a $var to $PHP_SELF so that I can

  • 0

IS there a way to post a $var to $PHP_SELF so that I can use it further down the script?

After 2 hours reading dozens of questions which helpfully appear in the sidebar to the right,
it became apparent that they pretty much all assume an HTML Form has been / will be
activated.

But psuedo~code of what I need looks more like this:

 <  php
 $someVariable=y;
 $otherVar=X;

 // and the usual setup for accessing the `$_POST` of php:
 $HokeyDino=`$_POST`["SendOFF"];
 $SendOFF=101;

// etc. and then come to a point where I need the script to just automatically post a value

[  the lack of knowledge ]

// which if I had tha codez!
// would permit the use of that $var,  $HokeyDino ...

 if($HokeyDino==100){
 // do stuff
    }

I don’t like looking foolish, but gotta ask away, because I figure I have missed learning some elementary aspect of programming, being self-taught so far, but not knowing what might be lacking makes it hard to go look productively.

Thanks very much!

EDIT // Clarification.

Wow, this is amazing. half an hour, 24 people reading the question. Blows my mind.

Right. What I have gotten done so far to give more background:

A php script which uses fopen to create on the fly another php / html page, and all the
code on the Authouring originating script, to write (a+) to the newly created temp page, the whole thing.

From a loop on the authouring page, I have code for retrieving POSTS I send TO that temp page, and that code gets written to a very temp page… then I cause the first part of the page to be written, to get placed on the Temp page, by put_contents etc.,

Next, from another loop on the Authouring page, I write code which item by item matches the things which were included in the < head > of the Temp page.

Anyhow, without graphics, it’s a bit tough to explain. What I have at the point I have gotten to so far, is the newly created/assemble Temporary page, can be accessed as a WebPage,, and a button click on it, will successfully POST a value back to the originating/Authouring script.

Here’s the tricky part: There isn’t any way I was able to devise, to dynamically create code ON THE AUTHOURING page, to recieve POSTS from the Temp Page.

But I realized that if, in the Loops on the Authoring Page, I was able to $PHP SELF post a
string which would be the code for creating a * $Var = $ POST; to catch the values from button clicks on the TEMP page, it would work.

Critical, is that the Authoring Page, doesn’t know how many buttons will be made over on the Temp Page ~ that depends on the number of items in the database, which the loops are reading and translating into code which builds the Temp Page.

So, there is no way to hard~code, on the Authouring Page, all possible code for recieving posts, but I could use one Universal $Var= $ POST[ X ] if I could generate it on the fly in the loop, on the Authoring Page.

Hence the need to write code which will $SELF POST, and have it triggered just by normal programme flow, and not the click of a button in a form.

Hmm…. clear as mud yet? 🙂 the question still is pretty straight foreward.

Cheers!

       ////  Loop
        Create  CViewerTemp
           read DB and manipulate data
             Loop B
           create, and write to VeryTempHead page
                    code which creates the top of CViewer, HEAD items
           create, and write to VeryTempBody page
                    code which will work there, items one by one matching head items
              end Loop B
        Write code which is 1ne time only stuff, to begin CViewer.
           then transfer the stuff from VeryTempHead page, into CViewer, kill
           VeryTempHead
           then transfer the stuff from VeryTempBody to CViewer, kill Very Temp Body.
        Open CTempViwer, click on a Button, a value gets posted to Authouring Page.

         Authouring Page doesn't recieve anything, no code to do so exists  [YET! :)]
  • 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-30T20:34:53+00:00Added an answer on May 30, 2026 at 8:34 pm

    If you want to create data on the fly, but not from $_POST, you can just populate $_POST from any other source like this:

    <?php
    // some calculations
    $_POST['my_var'] = $some_calculated_stuff;
    
    // later in your code
    
    if(isset($_POST['my_var'])) {
     // works as if it had been posted
    }
    
    ?>
    

    Is this what you’re looking to do?

    It’s a bit hard to follow, so I’ll suggest another potential:

    Have you taken a look at cURL?

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

Sidebar

Related Questions

Is there any way instead of a JS hack where I can post from
Is there any way to accept POST type requests without using Nerve lib in
is there a way to create custom post variables when a user presses submit,
Is there a way to obtain the post data itself? I know spring handles
Is there any way (in Java Servlet) to determine whether a HTTP POST or
Is there any way to do some kind of while() for each post variable
Is there a way to hide date and user info from a page post
Is there a way for me to get a pseudo-ID of a post from
i want to code something in my post template. So, is there any way
Is there a quick way to submit (pre-defined) POST data from a hyperlink in

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.