tick box on form

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
scorpio90
Forum Newbie
Posts: 23
Joined: Wed Mar 10, 2010 10:45 am
Location: Newcastle

tick box on form

Post by scorpio90 »

hi guys hopefully someone can help me ..

i need to insert a tick box on a form so that a client can click it once they have read and accepted the terms and conditions,

it would be a huge help if anyone could give me advice on this as im really confused with it.

thankyou in advance :D
solid
Forum Commoner
Posts: 28
Joined: Wed Aug 12, 2009 11:56 am

Re: tick box on form

Post by solid »

If I'm understanding you correctly, then the quickest and easiest way to accomplish this would be have the form set a SESSION variable like:

Code: Select all

session_start();
$_SESSION['agreed'] = TRUE;
Then have each page check for that SESSION variable, and show the form if they haven't agreed, like this:

Code: Select all

session_start();
if ($_SESSION['agreed'] = TRUE)
{
   // show page
}
else
{
   // show form
}
If you are asking about the 'tick box' itself, just use javascript on the checkbot to have it submit the form onClick.
Post Reply