This is a discussion on "agree the terms and condition script" within the PHP Forum section. This forum, and the thread "agree the terms and condition script are both part of the Program Your Website category.
|
|
|
|
|
![]() |
||
agree the terms and condition script
|
||
| Notices |
![]() |
|
|
LinkBack | Thread Tools |
|
|||
|
agree the terms and condition script
hello,
need help, can you give me example php script on how to check and agree the terms and condition in the sign up form. thanks.. csun |
|
|
|
|||
|
Re: agree the terms and condition script
Mmm, you might be better doing this with Javascript. It would be more instantaneous and you wouldn't have to pass any variables back to the page.
|
|
|||
|
Re: agree the terms and condition script
thanks for the response, can you give me a link on this javascript..
|
|
|||
|
Re: agree the terms and condition script
there's a thing about Javascript form validation here: http://www.w3schools.com/js/js_form_validation.asp
|
|
|||
|
Re: agree the terms and condition script
in case you decide to do this with php heres the logic behind it.
1) tick box to aggree to terms and conditions "posts" value "terms" to your php script. 2) vale $_POST['terms'] is set = to $terms 3) php script checks to see if the variable $terms is set to 1. if it is then the rest of the script is processed/ 4) if not set a $_SESSION['terms_error'] and pass it back to the main page using the header() function. 5) once back on the main page chck to see if $_SESSION['terms_error'] isset and if it is you echo out "you must aggree to the terms and conditions" heres some code that should do what you want... it might need some modification as this is off the top of my head... if u have any problems ill try and fix it. ok here is the page containing the form that allows people to register. Note that it also contains some php if else statement.... but we shall come back to those later.
ok, now, heres the php file that processes the registration
notice the headers sending back to the first page if the terms were not aggreed.... any problems let me know Last edited by Accurax; Apr 13th, 2007 at 13:37. |
|
||||
|
Re: agree the terms and condition script
I'd say do it with both PHP and JavaScript.
|
|
|||
|
Re: agree the terms and condition script
thank you for the response i really appreciate it.. It really helps me here..
|
|
|||
|
Re: agree the terms and condition script
Advantage of using JS is that you can keep the fields filled in even afetr the error has been passed .... so mabye a combination is best.
I havnt found a way to refill the fields after moving the user back to the form, but then a signup form should only be a small afair. If anyone knows how to do this without the use of JS id really appreciate the info. |
|
|||
|
Re: agree the terms and condition script
I know
Well this is what I use anyway. Without giving you a load of code, I'll just go through the process I use.
Now, below that, of course, would be the form. You'd only exit the page if the code is valid. If not the form is displayed again and you can use code like:
It's not the most elegant solution I'm sure, but it works rather well. |
|
|||
|
Re: agree the terms and condition script
yeah that would work ..... dont know why i didnt think of it myself... thanks
|
|
|||
|
Re: agree the terms and condition script
To be honest, it's something I struggled with myself for ages, coming up with more and more complex solutions for it that never seamed to work correctly. I suppose the solution is just to go back to basic principals and write down what you want to do and in what order.
|
![]() |
| Tags |
| terms and condition |
| Thread Tools | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Condition on button action | artdog | Flash & Multimedia Forum | 1 | Sep 14th, 2006 19:45 |
| £49 to transfer out!!! Do you agree?? | christopher | Hosting & Domains | 7 | May 20th, 2006 11:59 |
| Tempted to agree... | timmytots | Web Page Design | 16 | Dec 3rd, 2005 19:37 |