Jump to content

[SOLVED] $_POST


bruno67

Recommended Posts

Hi, I need my php pages to set some variables on a server level (in a virtual remote hosting) in order to have those variables seen from any other page of my website. I have 2 questions on the matter please:

1) I guess this can be done by using the $_POST array.  is this the best way to set variables at server level?

2) if the use of $_POST is the proper way to set variables/array at server level, how do I assign a $_POST variable? is it compulsory to make a post form or the assignment can be done in an easier way, something like:

$_POST[myvar] = 10;

 

Thank you very much for your help,

Bruno

Link to comment
https://forums.phpfreaks.com/topic/75194-solved-_post/
Share on other sites

Thank you MadTechie for your reply. The problem is that those php pages are not user pages but are pages activated by cron jobs. those scripts works in the background. I need those php scripts to communicate among them by using server level variables. How can a php script set a variable which can be seen by another script (activated by another cron job) in the same website?

Link to comment
https://forums.phpfreaks.com/topic/75194-solved-_post/#findComment-380280
Share on other sites

How can a php script set a variable which can be seen by another script (activated by another cron job) in the same website?

 

The only real solution to this would be to write the variable key / values to a file or a database. Sessions are not maintained upon execution of different scripts called via the command line and post data is simply non-existent.

Link to comment
https://forums.phpfreaks.com/topic/75194-solved-_post/#findComment-380286
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.