[Pmwiki-users] passing variables between php programs
Crisses
crisses
Sat May 15 19:58:23 CDT 2004
> In php you have access to the super global variable $_GET and $_POST
> that contain all the get and post variables available in the scope the
> script is running.
Yes, but they're in the scope that the script is running. I can access
those. But how do I pass them to pmwiki.php when I'm ready to call it?
GET implies via URL...how do you supply a URL and POST to send with
it?
> The website www.php.net is invaluable for command
> reference in PHP there is so many billions of commands available and
> even programmers who have been working for many years programming php
> can't remember everything.
Well, that's true, and I've been pouring over the documentation there,
and unfortunately that doesn't mean it's a good tutorial: it's a
reference. it's like *reading* an O'reilly Reference guide [a great
thing to have on hand but I wouldn't want to start there!] and
attempting to learn from it (Yipes!). --Even with a search feature it
doesn't mean that the functions and code reference equate to a real
example of what you're trying to do. So instead of spending more than
the several hours I've already done trying to figure this out (between
that and failed attempts to Google the issue), I figured I'd ask. None
of the examples on any of the pages I went through applied -- no user
comments were helpful -- the documentation was unhelpful. If someone
pointed out which functions/methods/whatever would be the right ones
(or some of the right ones to choose from) in this case, I could look
them up and see if I could figure it out. Otherwise, I'm stuck pouring
through extensive function lists wondering if there's a module I need
to load, if it's in the basic documentation, or if I'm simply clueless
and overlooking something.
> This type of application isn't a very hard project, you will have a
> small form that the user types in whatever they want into a text field
> then they hit submit, this calls a php script that parses that form
> data
> forms a new url to the Pmwiki (would need modified to accept GET
> variables to propagate the edit page form), and then just redirects the
> user to the new url with get variables. I highly suggest encoding any
> user inputted text with base64 before you pass it via a GET variable.
I can't tell if what you said is helpful to me where I stand. I have a
working program. It spits output to a browser in the form of a single
(imploded array->)string at the end (because it gives me the fun of not
having to write a loop, and auto-inserts <br /> breaks between lines).
I want to know how to pass that array to PmWiki. I don't think it
should be via GET; it's possibly going to get too big. I need to know
how to send a POST to another url without using a hidden field on a
form with a button that necessitates user interaction. I also want to
incur the lowest amount of PmWiki being rewritten. I'm not sure I need
more theory: I actually need someone to point out the command set I
should study, to hand me a simple line of code (like: "Oh, that's easy,
it's blah, I could have told you that; you shouldn't have been banging
your head against that silly document for 3 hours!"), or to explain to
me that what I am trying to do isn't possible. And why, so I can
reformulate my theories and future plans for this project.
I don't think base64 is going to help (I assume that's for purposes of
data compression?). Are you implying the only way to pass variables
from PHP->PHP is via GET? Or is it just the easiest way? You never
actually said POST is not possible. What if the text field is so large
it's too large for GET even after being encoded in base64? And what
library do I find that command (to encode a string in base64) in?
> You will proably have to use a piece of compiled software on the
> machine, here is a link to some solutions for unix to convert a word
> document into plain text:
I already have one: Antiword. I appreciate it though.
> The php script can call the conversion program and convert the file as
> text then read in the text file in then do whatever you want with it.
> I'm not sure if Pmwiki will accept page content via a GET variable,
> proably not. So you proably will need to code a mod for Pmwiki to take
> a
> variable.
Again: are you saying it's not possible? Or is it so hard it's not
worthwhile?
> I suggest encoding the text version of the word document with base64
> and
> pass it via a GET variable to Pmwiki which after you modify it will
> propagate the edit page form with the content.
My parsing program would play with the converted word document first,
but yes, that's the *general* idea. I was wondering how to send via
POST, however. If it's possible.
> To send GET variables you would form your url containing the variables
That part I know.
> and use the php command:
>
> header("Location: ".$url);
Thank you; that part I didn't know. I can write php but it doesn't
make me a rocket scientist. This is the first time (ever) that I'm
writing a program and want it to interact with another one via the web
-- although in this case it will reside on the same server (in case
that changes anything).
Crisses
More information about the pmwiki-users
mailing list