hosted by liquidweb


Go Back   Web Hosting Talk : Web Hosting Main Forums : Programming Discussion : Question on Forms
Reply

Programming Discussion Discussions related to web programming languages and other related issues. Topics may include configuration, optimization, practical usage and database connectivity.
Forum Jump

Question on Forms

Reply Post New Thread In Programming Discussion Subscription
 
Send news tip View All Posts Thread Tools Search this Thread Display Modes
  #1  
Old 10-20-2005, 05:43 AM
enrique007 enrique007 is offline
Newbie
 
Join Date: Oct 2005
Posts: 8

Question on Forms


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

Reply With Quote


Sponsored Links
  #2  
Old 10-20-2005, 05:47 AM
dollar dollar is offline
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 ?>

__________________
Mike from Zoodia.com
Professional web design and development services.
In need of a fresh hosting design? See what premade designs we have in stock!
Web design tips, tricks, and more at MichaelPruitt.com

Reply With Quote
  #3  
Old 10-20-2005, 06:09 AM
enrique007 enrique007 is offline
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

Reply With Quote
Sponsored Links
  #4  
Old 10-20-2005, 06:15 AM
dollar dollar is offline
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?

__________________
Mike from Zoodia.com
Professional web design and development services.
In need of a fresh hosting design? See what premade designs we have in stock!
Web design tips, tricks, and more at MichaelPruitt.com

Reply With Quote
  #5  
Old 10-20-2005, 06:21 AM
SoftWareRevue SoftWareRevue is offline
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.

Reply With Quote
  #6  
Old 10-20-2005, 06:25 AM
enrique007 enrique007 is offline
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

Reply With Quote
  #7  
Old 10-20-2005, 06:31 AM
dollar dollar is offline
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.

__________________
Mike from Zoodia.com
Professional web design and development services.
In need of a fresh hosting design? See what premade designs we have in stock!
Web design tips, tricks, and more at MichaelPruitt.com

Reply With Quote
  #8  
Old 10-20-2005, 07:37 AM
enrique007 enrique007 is offline
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

Reply With Quote
  #9  
Old 10-20-2005, 07:43 AM
dollar dollar is offline
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>

__________________
Mike from Zoodia.com
Professional web design and development services.
In need of a fresh hosting design? See what premade designs we have in stock!
Web design tips, tricks, and more at MichaelPruitt.com

Reply With Quote
  #10  
Old 10-20-2005, 08:24 AM
enrique007 enrique007 is offline
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)

Reply With Quote
Reply

Related posts from TheWhir.com
Title Type Date Posted
Lead Generation Part 4 – Go it Alone Blog 2013-03-25 09:16:50
Lead Generation Part 1 – Form Fills Blog 2012-11-16 09:03:48
Rackspace Blog Looks at Easy Outsourcing for App Development Blog 2012-03-05 19:07:48
Go Daddy Works with US Secret Service in JotForm Website Takedown Web Hosting News 2012-02-17 13:48:28
Cloud Security Firm nCircle Joins Cloud Security Alliance Web Hosting News 2012-01-12 15:35:20


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes
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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump
Login:
Log in with your username and password
Username:
Password:



Forgot Password?
Advertisement:
Web Hosting News:



 

X

Welcome to WebHostingTalk.com

Create your username to jump into the discussion!

WebHostingTalk.com is the largest, most influentual web hosting community on the Internet. Join us by filling in the form below.


(4 digit year)

Already a member?