I am truly a newbie, but I have figured out a few things in a short amount of time. Some helpful hints to get me jump-started would be most welcome.
The user will access a page 'request.php'. It will check for a cookie named 'agree'. If that cookie is not found, it will send them to a page (agreement.php) with a form that requires a user to select "I Agree" and then submit the form. When the form is submitted, I want to set a cookie (expires in a month) that indicates that they have agreed. I know how to set cookies and read them, but I have 2 questions:
- What/where do I submit the form to (value="")?
- Where do I specify setcookie?
The page with the text below is 'request.php'. If the cookie 'agree' exists, user is sent to the 'logon.php' page. Otherwise, the user is sent to the 'agreement.php' page.
<?php
if(isset($COOKIE['agree'])){
$agree = $COOKIE['agree'];
include ('logon.php');
}
else
{
include ('agreement.php');
}
?>
The 'logon.php' page will also have some code to check for the cookie, in case a user comes through the back door directly to the logon.php page.
The 'agreement.php' page looks something like this:
<form action="POST" value="">
<tr>
<td>
Please read the requirements for use of this system. We can process your request only if it meets one or more of the following criteria:
<ul>
<li><p> the request is for reason X</p>
<li><p> the request is for reason Y</p>
<li><p> the request is for reason Z</p>
</ul>
</td>
</tr>
<tr>
<td
<input name="accept" type="checkbox" value="true"> I agree to the above terms and conditions.
<input id="submit" type="submit" value="Continue">
</td>
</tr>
</form>
Obviously, I mostly need help with knowing how to submit the form. It seems like since there is only 1 field (accept), it would be a matter of reading that variable into a cookie. I am treading water at this point.
Thanks.