|
Posted by Simon Rigby on 07/24/06 12:06
Thanks Erwin,
Im not really explaining myself properly. I do understand sessions and
use them regularly and I have no real aversion to using them in this
case, I suppose I just got interested in whether what I proposed was
possible. In short can I declare a post variable that is passed with a
form submission manually instead of it being the result of a form
variable. I did go on to think that I could set the value of a hidden
form <INPUT> based on the value passed from the link.
And as I replied to Jerry, Javascript is available in this instance.
Many thannks for your help, and please dont think Im trying to be
difficult, just wondering if this is possible as opposed to do best
practice etc.
Simon
Erwin Moller wrote:
> Simon Rigby wrote:
>
> > Hello folks,
> >
> > Ive seen lots of recommendations to not try to do what Im trying to do
> > but let me put it this way and hopefully someone can tell if this is a
> > good idea or not (or an alternative).
> >
> > What Im trying to do is this. I have a series of links that when
> > clicked will navigate to a common page passing in a value encoded in
> > the link. For reasons not worth going into I cant use a querystring.
> >
> > I was hoping to call a javascript function from the onclick event of
> > the link, then assign a new $_POST variable and then submit the form
> > (hence enabling me to read the $_POST value from the receiving page.
> >
> > Im aware that I could do the same thing with a $_SESSION but as this is
> > the last stage of this app and I havent had to use sessions yet I was
> > hoping to avoid it (for no real reason admittedly - I just got
> > interested in the solution above as an idea).
> >
> > I hope this is clear.
> >
> > Regards
> > Simon Rigby
>
> Hi Simon,
>
> I don't think your solution works always.
> Look at your demands:
> 1) No GET encoded information.
> 2) No Session
>
> So only POST (and COOKIE) remains to pass info around.
>
> Both COOKIE and POST must be populated using Javascript (from a client
> browsers viewpoint), and like Jerry said: that can be disabled.
>
> I don't think you can solve this without using GET encoded info, or
> demanding the visitor has JS enabled.
>
> A more optimistic note: Learn SESSIONs, you will use them in almost any
> mature webapp. So it is time well invested.
>
> Best of luck,
>
> Erwin Moller
Navigation:
[Reply to this message]
|