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.

PHP Forum


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



Freelance Jobs

Reply
one time message, then gone
Old 04-18-2007, 06:07 PM one time message, then gone
Novice Talker

Posts: 13
Trades: 0
Hello,

Could someone direct me to +howto/tutorial on:

I built a site and I want it to display a page with message saying "Welcome to......I hope you enjoy your stay etc etc etc." and at the bottom of such message a checkbox with "Do not display this message again and go directly to page." Any idea how to do something like that?
kargul is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-18-2007, 06:13 PM Re: one time message, then gone
Novice Talker

Posts: 13
Trades: 0
I forgot to mention - the user should not see the rest of the content before that message. Thanks.
kargul is offline
Reply With Quote
View Public Profile
 
Old 04-18-2007, 07:28 PM Re: one time message, then gone
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
It really depends a lot on how you currently have your site set up but the most simple of answers is to set up a splash page and have it set/check for a cookie with the value of the check box in it. If the cookie is set then you know that they don't want to see the page thus you could redirect them to another page otherwise, if the cookie is not set then don't redirect.
__________________

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
Republikin is offline
Reply With Quote
View Public Profile
 
Old 04-18-2007, 08:43 PM Re: one time message, then gone
Novice Talker

Posts: 13
Trades: 0
Republikin, do you think the method you described is somewhere well documented as I have only little experience with PHP?
kargul is offline
Reply With Quote
View Public Profile
 
Old 04-18-2007, 09:33 PM Re: one time message, then gone
Republikin's Avatar
Defies a Status

Posts: 3,189
Trades: 3
http://www.websitepublisher.net/article/php_cookies/

Read that to learn about cookies, the rest is really just simple if/else statements.

Let me know if you have any more specific questions.
__________________

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
Republikin is offline
Reply With Quote
View Public Profile
 
Old 04-18-2007, 09:43 PM Re: one time message, then gone
mgraphic's Avatar
Truth Seeker

Latest Blog Post:
JAMISONTUNES
Posts: 2,918
Name: Keith Marshall
Location: Connecticut
Trades: 0
Use this as your main index entry page (do not add anything else to, just create the two alternative page: skip_splash_index.html and show_splash_index.html):

index.php
PHP Code:
<?php
  
  
if (isset($_POST['skip_splash'])) {
    
    
setcookie('skip_splash', (bool)$_POST['skip_splash'], time()+60*60*24*1095'/'false0);
    
$_COOKIE['skip_splash'] = (bool)$_POST['skip_splash'];
  }
  
  if (isset(
$_COOKIE['skip_splash']) && (bool)$_COOKIE['skip_splash']) {
    
    require(
'skip_splash_index.html');
    
  } else {
    
    require(
'show_splash_index.html');
  }
  
?>

And add this to your show_splash_index.html page to add the skip form:

show_splash_index.html
HTML Code:
<form name="skip_splash_form" action="index.php" method="post">
  <input type="checkbox" name="skip_splash" id="skip_splash" />
  <label for="skip_splash">
    Skip this splash page on my next visit
  </label>
  <input type="submit" name="submit" value="Submit" />
</form>
__________________

<mgraphic /> - I don't have a solution but I admire the problem.
mgraphic is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to one time message, then gone
 

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