Passing vars in a link ?
From: Pjotr Wedersteers (x33159_at_westerterp.com)
Date: 08/31/04
- Next message: abc: "Calculate future months [Reference Correction]"
- Previous message: Ethan T: "Re: Delete row from mysql only deletes the contents?"
- Next in thread: Ken Robinson: "Re: Passing vars in a link ?"
- Reply: Ken Robinson: "Re: Passing vars in a link ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 31 Aug 2004 18:22:53 +0200
Hello again,
I have now several consecutive forms in my site which nicely pass variables
in POST, so they won't show up in the header.
Now I have a page people reach after submitting all kinds of information,
from where I offer a link users can click on.
Let's say I have collected several strings and I have put these in an array
and serialized that.
$var[0]='John Doe';
$var[1]='2345 Livnigston Ave';
$var[2]='Boston';
$var[3]='Plumber';
$data = serialize ($var);
When the user clicks the (only) link on this page, all this serialized data
needs to be passed along to the new page.
I did this:
(...)
// $data contains the serialized array
echo "<a href='action.php?data=$data'>go here</a>";
First question: using this method the $data is passed via GET. I would
prefer to keep using POST, and not have ugly tell-tale headers. Is that
possible using PHP? How? [I'd rather not use sessions here which would avoid
the entire datapassing issue.]
Second question: when I echo back $data in the action.php script, it seems a
chunk of the string is missing. Is that due to a limit in length ? How long
a string can be passed as a single var ? Different for GET vs POST ? Like it
is unserialize returns FALSE, which makes sense, as the data is incomplete.
Help appreciated. If you need more specifics, I'm happy to elaborate.
Pjotr
- Next message: abc: "Calculate future months [Reference Correction]"
- Previous message: Ethan T: "Re: Delete row from mysql only deletes the contents?"
- Next in thread: Ken Robinson: "Re: Passing vars in a link ?"
- Reply: Ken Robinson: "Re: Passing vars in a link ?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|