Jump to content


- - - - -

[PHP] - [Terms Of Service] - [Gio]


  • Please log in to reply
8 replies to this topic

#1 _*Gio_*

_*Gio_*
  • Guests

Posted 30 August 2004 - 04:36 PM

Ok this is not the most requested tutorial ever, but it is a neat feature to have and use for a registration script or a download script. Anyways, lets look at the code.

Ok first let's show the php behind the form, then we will see the code for the form.

Accept.php

<?php
if ($choose == "yes")
// If they do accept..
{
include("accepted.html");
}
// Include the page
else
// If they do not accept..
{
print("Sorry, you abide by the terms!");
}
// Print the message
?>

Ok the first part if ($choose == "yes")
What this is doing is if the user chooses to abide by your terms, they will be redirected to accepted.html or what ever you choose to name the file.
Then we have an else statement if they choose no they get a message that sais you must abide by the terms.
Now for the form.

TOS.html

<form action="accept.php" method="post">
<textarea name="terms">Your tos go here.</textarea><br>
Do you accept these terms? 
<input type="radio" name="choose" value="yes">Yes 
<input type="radio" name="choose" value="radiobutton">No<br>
<input type="submit" name="Submit" value="Next"> 
</form>

Ok first we tell the form what file is doing the processing, then what method are we getting the data. Then you put your terms of service after the <textarea name="terms"> then you give the user 2 options yes or no. Then The submit button which will send the data through accept.php and send them to accepted.html or echo the error message.

Well hope you use this, and post any comments you have on this short tutorial. I welcome all comments/criticism.

#2 _*Jaymz_*

_*Jaymz_*
  • Guests

Posted 04 September 2004 - 11:30 PM

Nice tut :D

#3 _*Jay_*

_*Jay_*
  • Guests

Posted 05 September 2004 - 07:09 AM

i prefer the javascript method of not letting them by until they've checked the box :P makes them have to agree to terms

but this would be fun if you wanted a special flash movie or something to appear when they didnt agree :)

#4 _*Gio_*

_*Gio_*
  • Guests

Posted 05 September 2004 - 02:59 PM

Glad to help :P

#5 _*Anarchy_*

_*Anarchy_*
  • Guests

Posted 05 September 2004 - 04:41 PM

i like your tuts, very practical :D

#6 _*Gio_*

_*Gio_*
  • Guests

Posted 05 September 2004 - 09:31 PM

Very small is more like it, I am unloading all my small tutorials, before my new site comes out. Then we get the big ones done :D

#7 _*Unreal_*

_*Unreal_*
  • Guests

Posted 06 September 2004 - 11:57 AM

hehhe this is cool thanks :D

#8 _*Gio_*

_*Gio_*
  • Guests

Posted 08 September 2004 - 02:39 PM

hehhe this is cool thanks :P

No problem.

#9 stingerblue

stingerblue

    Young Padawan

  • Members
  • Pip
  • 16 posts
  • Gender:Male
  • Location:North of the Border, UK

Posted 13 August 2005 - 07:08 PM

I might add this on my web sites

Edited by stingerblue, 13 August 2005 - 07:22 PM.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users