Two days ago I posted with:
The second page of my site is a html form where users pick a size small medium or large
radion buttons
<input type="radio" name="verse_size" value="small">
<input type="radio" name="verse_size" value="medium">
Then they come onto another form to input information, and then that information is mailed to me on the action page, but I also want the action page to display a different Paypal button decided by the size they picked on the first form.
At first I thought sending $verse_size through with the second form as a hidden value owuld work and it did,
But my action page also sends users back to the second form if required fields are left blank, when I tested it, after I was sent back to the form, when I filled in all the fields my action page displayed no Paypal button, obviously because the hidden input $verse_size had no value.
How can I have my value for $verse_size stored. Someone suggested sessions. And directed me to PHP.net the session handling page.
I've been jumping from those pages back to my code, uploading my pages everytim I tried a different way but nothing works, I'm going crazy.
Can someone please tell me how to use sessions for my purpose.
The best i have managed is managing to get it to remember the value when I am sent back to the form, but only ever small,
I put
<? session_start() ?> atop my first html form
And on the second I put $_session['size'] = $verse_size
Then I put what i would have as a hidden input as a text input so I could see if it was working:
<? if ($session['size'] = "small") { ?>
<input type="text" name="verse_size" value="small">
<? } elseif ($session['size'] = "medium") { ?>
<input type="text" name="verse_size" value="medium">
and so on, I have even tried echoing $_session['size']
inside the value quotation marks.
For the first few hours I was using $_session['verse_size']
and then I read somewhere that only alphanumeric characters work so I started using['size'] instead.
Anyone who can point me in the right direction here will be able to feel my appreciation through their computer.