Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



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

Posts: 190
Trades: 0
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
 
 
Register now for full access!
Old 11-13-2005, 12:29 PM
Ultra Talker

Posts: 251
Location: Belgium, Antwerp, Zoersel
Trades: 0
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
Trades: 0
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
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
It's really simply a pretty standard disclaimer kind of script what server side code ?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
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
Trades: 0
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
madkad-hosting.com

Posts: 310
Location: UK
Trades: 0
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
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE

Great Hosting For You
madkad is offline
Reply With Quote
View Public Profile Visit madkad's homepage!
 
Old 11-14-2005, 12:57 PM
Ultra Talker

Posts: 251
Location: Belgium, Antwerp, Zoersel
Trades: 0
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
SearchBliss Web Tools

Latest Blog Post:
Oracle Embraces the Cloud
Posts: 1,724
Name: John
Location: USA
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE


Please login or register to view this content. Registration is FREE
kline11 is offline
Reply With Quote
View Public Profile
 
Old 11-15-2005, 09:25 AM
pipers dragon's Avatar
Extreme Talker

Posts: 190
Trades: 0
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
Ultra Talker

Posts: 251
Location: Belgium, Antwerp, Zoersel
Trades: 0
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 Search this Thread
Search this Thread:

Advanced Search

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 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.30985 seconds with 12 queries