Reply
Old 11-13-2005, 11:18 AM Script
pipers dragon's Avatar
Extreme Talker

Posts: 190
Is there a script that makes a person not able to view a page until they have read a different page? I dont want people to see one page until they have read the rules.. Like maybe an error page instead, saying to read the rules.
pipers dragon is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 11-13-2005, 12:29 PM
Extreme Talker

Posts: 249
Location: Belgium, Antwerp, Zoersel
Well, you could check the referer, but that doesn't mean they actually read it.
Orodreth is offline
Reply With Quote
View Public Profile Visit Orodreth's homepage!
 
Old 11-13-2005, 07:25 PM
pipers dragon's Avatar
Extreme Talker

Posts: 190
what do you mean? It is for a normal website, not a forum, and its for a contest... I was thinking about making a page that when you click the link to the contest page, it takes you to a page that says did you read this rules? and it has a text box that they have to type a password, and that takes them to the page, but i dont want it to be like an .htacces login page, i just want it to be like a forum login feild, and then there would be a password hidden in the rules somewhere. But that would require some sort of script as well, in which case I need to ask again, does anybody know of one like it?
pipers dragon is offline
Reply With Quote
View Public Profile
 
Old 11-14-2005, 07:11 AM
chrishirst's Avatar
Super Moderator

Posts: 16,452
Location: Blackpool. UK
It's really simply a pretty standard disclaimer kind of script what server side code ?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System | Bits & Bobs
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-14-2005, 10:41 AM
pipers dragon's Avatar
Extreme Talker

Posts: 190
umm any will work... I can do php, java, javascript, or anything, I mean, I dontk now how to write a lot of server side scripts, but i can understand and edit them fine, so installing should be no problem, i just need the script lol!
pipers dragon is offline
Reply With Quote
View Public Profile
 
Old 11-14-2005, 11:05 AM
madkad's Avatar
Ultra Talker

Posts: 308
Location: UK
like one of the others say you would be able to do it with a check box so atht the person would have to check that box before clicking a link to another page the only thing is it doesnt mee that the person has read that page

but if that is ok then you could do it in php using athe form post methord
__________________
Earn $25 A Referral | Mad Kad Computers | Webmaster Forum | Graphics Forums

SEO Forum | Internet Marketing Get found within the search engines and earn money
madkad is offline
Reply With Quote
View Public Profile Visit madkad's homepage!
 
Old 11-14-2005, 12:57 PM
Extreme Talker

Posts: 249
Location: Belgium, Antwerp, Zoersel
The referer is the page the user came from. Most browsers send this information to the server. Here's an example of how to check it using php:

contest page
PHP Code:
<?php
if($_SERVER['HTTP_REFERER']=="http://yoursite.com/rules-page.htm")
  include 
"page-content.php";  //they come from the right page, so we include the page content
else
  
header("Location: rules-page.htm");  //They don't come from the right page, so we send them back
?>
using a checkbox, it would be something like this:

rules page
HTML Code:
<form name="rules" action="contest-page.php" method="post">
  <input type="checkbox" name="read" value="yes"/>
  <input type="submit" name="Submit"/>
</form>
contest-page
PHP Code:
<?php
if($_POST['read']=='yes')
  include 
"page-content.php";
else
  
header("Location: rules-page.htm");
?>
You could also remove the checkbox:

rules page
HTML Code:
<form name="rules" action="contest-page.php" method="post">
  <input type="submit" name="read" value="I read the rules"/>
</form>
contest-page
PHP Code:
<?php
if($_POST['read']=='I read the rules')
  include 
"page-content.php";
else
  
header("Location: rules-page.htm");
?>
Then, of course, you could combinate the referer method, and the form method.
Orodreth is offline
Reply With Quote
View Public Profile Visit Orodreth's homepage!
 
Old 11-14-2005, 07:45 PM
kline11's Avatar
King Spam Talker

Posts: 1,319
Name: John
Location: USA
You can't make anyone read anything. How often have you agreed to terms and conditions before continuing to the next step. We all do. It's hard reading lawyer jargon most of us cannot understand anyway. I would do a basic "agree to the terms" check box to move on like suggested above, but unless it is "understandable", who will read it. And if it is, is it legally binding? Probably not. Unfortunately, it's just the way things are.
kline11 is offline
Reply With Quote
View Public Profile Visit kline11's homepage!
 
Old 11-15-2005, 09:25 AM
pipers dragon's Avatar
Extreme Talker

Posts: 190
no i mean, I trust that people would read them as they explain what the contest is, and how to enter and stuff.. For that form php script above, I could easily change it to an iput box, and have them type a required word couldnt I? Ill try that.


EDIT:

I changed the php around a little so it worked out fine.

PHP Code:
<?php 
if($_POST['read']=='yes'
  include 
"contests.php"
else 
  include 
"rules.php"
?>
becasue the header part was causing an error that I dont have time to fix, but it worked out well. Thanks!

Last edited by pipers dragon : 11-15-2005 at 09:39 AM.
pipers dragon is offline
Reply With Quote
View Public Profile
 
Old 11-15-2005, 10:55 AM
Extreme Talker

Posts: 249
Location: Belgium, Antwerp, Zoersel
Yeah, your code should work perfectly. To use the header stuff, however, you need to make sure nothing is sent to the browser yet. Normally, you put the header code on top of your page.

EDIT: maybe it has to be an absolute url too, but I doubt that.
Orodreth is offline
Reply With Quote
View Public Profile Visit Orodreth's homepage!
 
Reply     « Reply to Script
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.16143 seconds with 12 queries