-4

I would like to get a suggestion. How can i create a page, in PHP with plans, eg. Plan 1 mounth, plan 3 mounths and plan 6 mounths, where client can choose one of then and after go to checkout page? Thanks a lot :)

Michel
  • 15
  • 8

1 Answers1

0

Tadaa,

now you just need a type of script which handles the input and does whatever you want to do. For example PHP.

This is a form which takes some user input/choice and sends it to the server.

<form method="POST" action="?">
  <label>
    <input name="plan" type="radio" value="1" checked="checked"/> Plan 1 mounth
  </label>
  <br/>
  <label>
    <input name="plan" type="radio" value="3"/> plan 3 mounths
  </label>
  <br/>
  <label>
    <input name="plan" type="radio" value="6"/> plan 6 mounths
  </label>
  <br/><br/>
  <input type="submit" value="go to checkout ">
</form>

Edit: Added values for inputs

SirPilan
  • 4,649
  • 2
  • 13
  • 26
  • your doing it wrong: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/radio –  Jun 26 '18 at 22:06
  • Hey guys. Thanks for answered. Ok. just another doubt. If a user click/choose a membership plan for example, i'll have to create a variable to take the user's chosen plan to the checkout page? – Michel Jun 27 '18 at 23:34
  • @smith im just doing the [shorthand](https://stackoverflow.com/questions/774054/should-i-put-input-tags-inside-a-label-tag) without `for` and `id` - implicit association – SirPilan Jun 28 '18 at 07:36
  • i mean this https://codepen.io/anon/pen/LrXoae none of those values are going to be posted as the html is wrong, all you will getr is plan:on, no way to know which plan was selected –  Jun 28 '18 at 21:09
  • @smith no, thats because there are no values in the inputs - is just an example - added values for you <3 :D – SirPilan Jun 28 '18 at 22:05
  • Thanks for the help guys. I solved this problem applying Pilan example. Thanks so much for all :) – Michel Jul 07 '18 at 21:05