On Feb 20, 2011, at 10:51 AM, Yogesh wrote:
I don't entirely understand this; Dan Brown gave you solution to use
curl to pass the array to the second "form" (do you mean script
here?). That would certainly work, but I'm wondering if it wouldn't
be more secure to spool out the array to a file from the first
script after it has processed it, and then read it in to the second
script when it starts. This assumes the two scripts are running on
the same server, of course. The second script could be called after
the first script finishes by using a header redirect. I'm curious
about people's thought on the security and efficacy of different
ways of sharing data between scripts when you're not using sessions.
I am quite new to PHP. (I am having trouble to understand how HTML,
PHP and Javascript work together). Right now I just wanted to get
the job done. But if you can suggest me a more efficient way to do
it, I will definitely look into it.
Are you also new to programming in general? If so, I suggest spending
some time studying up on programming concepts and design patterns. I
do understand the idea of "just get the job done", but without basic
knowledge, the result is not going to be very good, and likely lead to
maintenance nightmares down the road.
As I don't really understand what it is you're trying to do, it's hard
to make concrete suggestions. From your very brief description, it
sounds like you have one script that takes the form submission and
populates an array, which you want to share with another script.
Typically, data sharing between scripts is accomplished in a few
different ways:
1) use of session variables (which requires the script to invoke
session management)
B) storing the information in a persistent data base (e.g. MySQL)
iii) storing the information in a transient data store (e.g. a
temporary file). There are different ways to format the data in the
file, including as php script (so you can include the file), JSON,
YAML, etc.
d) passing the information to the second script via a query string or
a post data buffer
Any of these things require understanding of the mechanisms and
implementation idioms involved. Choosing a particular implementation
depends on several variables in your overall design and implementation
environment. A mailing list is a poor way to transmit this
information, which is why most of it is documented elsewhere.