Hi there,

As above, I am looking to send values across to another page so they can be picked up by $_POST but I don't want to use a form to do this. So instead of a form button the user will be clicking on a text/img link.

Can anyone suggest a method to do this or whether at all this is possible?

Many thanks!

    A while back I was looking for a non-session way to pass around variables. It seems that this method provides a good alternative to passing data around without clogging your disk up, worrying about session timeouts, etc. Any thoughts on this?

    cheers

      I am looking to send values across to another page so they can be picked up by $_POST but I don't want to use a form to do this

      What exactly are you trying to accomplish? The only way I know to send POST values to a page (other than using a form) is to forge the headers, which is not exactly the best practice to be using.

      If you are just passing (non-user-inputted) data from one page to another you could just put the data in hidden form fields and make the text/img link the 'submit' element. Alternatively, you could use cookies or even sessions.

      If you explain what you're trying to do, someone would most likely be able to give you a more informative explanation.

        willl wrote:

        Hi there,

        As above, I am looking to send values across to another page so they can be picked up by $_POST but I don't want to use a form to do this. So instead of a form button the user will be clicking on a text/img link.

        Can anyone suggest a method to do this or whether at all this is possible?

        Many thanks!

        You can use the text and/or img instead of a submit button. All it takes is onclick='submit()', and you can have your cake and eat it, too... 🙂

          Ok thanks people 😉

          I think i'l be using the onclick="submit()" option.

          It is simply so that I can rule out the risk of the user playing around with the variables in the URL if using $_GET.

          Thanks again.

            willl wrote:

            Ok thanks people 😉

            I think i'l be using the onclick="submit()" option.

            It is simply so that I can rule out the risk of the user playing around with the variables in the URL if using $_GET.

            Thanks again.

            If you are worried about users playing with your variables, then realize that a form is created easily too. You cannot rule out messed-with variables. Just make sure you have a solid variable validation in your scripts, instead of using javascript to go from a->b. It annoys the H*ll out of some people (like me) that basic website navigation stuff stops working if you have javascript disabled.

              Write a Reply...