
10-20-2005, 05:43 AM
|
|
Newbie
|
|
Join Date: Oct 2005
Posts: 8
|
|
Hi there,
I have created a "terms and conditions" form using a script for my website. I have named this form register1.php. Once users agree to terms, the get redirected to register2.php where they need to fill out their name, details,etc.
The problem that I'm having is that if users just type mywebsitename/register2.php, they get send directly to the registration page totally bypassing the "terms and conditions" (register1.php) form and I don't want that.
What can I add or what can I do to deny people access to register2.php if they haven't agreed to register1.php?(terms and conditions) maybe add a message saying that they need to agree to register1.php befoe gainning access to register2.php?
Thanks
|

10-20-2005, 05:47 AM
|
|
Retired Moderator
|
|
Join Date: Sep 2004
Location: Flint, Michigan
Posts: 5,768
|
|
This would probably fit better in the programming area, but in any event I would do it with a simple form.
ie.
Form on register1.php posts to register2.php with a checkbox for agreeing to the terms and conditions.
On register2.php do something like
PHP Code:
<?php
if(!$_POST['agree'] == 'true') {
header('location:register1.php');
} else { ?>
Page stuff here
<?php } ?>
|

10-20-2005, 06:09 AM
|
|
Newbie
|
|
Join Date: Oct 2005
Posts: 8
|
|
hello,
thanks for that. Not sure in what part of the page to add the code, I keep getting error messages
|

10-20-2005, 06:15 AM
|
|
Retired Moderator
|
|
Join Date: Sep 2004
Location: Flint, Michigan
Posts: 5,768
|
|
Should be at the very top. Which error message is it throwing you? Headers already started?
|

10-20-2005, 06:21 AM
|
|
iNET Senior Community Advisor
|
|
Join Date: Jun 2001
Location: Kalamazoo
Posts: 31,238
|
|
Moved to 'Programming Discussion.'
__________________
Do you have a WHT question or concern? Please open a helpdesk ticket.
|

10-20-2005, 06:25 AM
|
|
Newbie
|
|
Join Date: Oct 2005
Posts: 8
|
|
Yes, you right. headers already started.
Warning: Cannot modify header information - headers already sent by (output started at c:\wamp\www\alcohol\register2.php:2) in c:\wamp\www\alcohol\register2.php on line 4
I can post the full code of the page if that will help
|

10-20-2005, 06:31 AM
|
|
Retired Moderator
|
|
Join Date: Sep 2004
Location: Flint, Michigan
Posts: 5,768
|
|
Sure wouldn't hurt
Just make sure that code is at the very top without any whitespace before it and it should work.
|

10-20-2005, 07:37 AM
|
|
Newbie
|
|
Join Date: Oct 2005
Posts: 8
|
|
Hi,
I moved the code to the top of the page like you said. Not getting error messages anymore but what happens is that once someone click the 'accept box' and hit continue, the page instead of going to register2.php to continue the registration, goes back to register1.php
|

10-20-2005, 07:43 AM
|
|
Retired Moderator
|
|
Join Date: Sep 2004
Location: Flint, Michigan
Posts: 5,768
|
|
Well you have to set the form up properly.
Code:
<form name="tosagree" method="post" action="register2.php">
<input name="agree" type="checkbox" id="agree" value="true">
<input type="submit" name="Submit" value="Submit">
</form>
|

10-20-2005, 08:24 AM
|
|
Newbie
|
|
Join Date: Oct 2005
Posts: 8
|
|
I made a couple of changes to the script I already had and combine with the one you gave me, seems like is working fine. Thanks for that!
Do you know anything about billing? (like billing users for services)
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
| Postbit Selector |
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|
|
| Login: |
|
|
| Advertisement: |
|
|
| Web Hosting News: |
|
|
|