NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Web Design Discussion
Reload this Page Welcoming Page Load Question

Web Design Discussion Discussion of web design techniques, advice, browser issues, software, design firms.

Advanced Search
9 members in live chat ~  
NamePros Design Contests NamePros Design Contests
Forum Sponsorship
Join in on the FUN! You can start an affordable design contest and pick from entries talented members submit or you can enter a design contest for a chance to win CASH PRIZES! What are you waiting for? Get started in the fun TODAY! - Banners, Logos, Mascots, and MORE! (Please READ the design Contest section rules Prior to starting or entering a contest)



Closed Thread
 
LinkBack Thread Tools
Old 08-11-2005, 02:48 PM THREAD STARTER               #1 (permalink)
Account Closed
 
zack's Avatar
Join Date: Apr 2005
Posts: 167
zack is on a distinguished road
 



Welcoming Page Load Question


Okay.
I want a welcoming page that will load with the websites index URL. I only want it to load once so if a person goes back to the site with the same URL later, the welcoming page won't show (unless they delete history/cookies/tempfiles,etc).

Does anyone know how I can accomplish this?
Last edited by zack; 08-11-2005 at 02:51 PM.
zack is offline  
Old 08-11-2005, 02:51 PM   #2 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Well, if they accept cookies and don't delete them, set a cookie with PHP. Then, try and detect the cookie. If it's there, then use the PHP header() function to redirect to the actual content (past the welcome page).

If you DON'T want to use PHP, Javascript MAYBE able to do this, but they'd have to have JS enabled and history not cleared... and that only lasts about 7 days usually anyways. PHP cookies is your best bet, I think.
mholt is offline  
Old 08-11-2005, 02:53 PM THREAD STARTER               #3 (permalink)
Account Closed
 
zack's Avatar
Join Date: Apr 2005
Posts: 167
zack is on a distinguished road
 



That sounds good. Do you have a link showing me how to do this? Or an example of something similar. I'm new to php and cannot right my own code in javascript (only mod hehe). Thanks for your time btw.
zack is offline  
Old 08-11-2005, 03:23 PM   #4 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
No problem.

Put this at the top of your welcome page (this must be the FIRST thing! Before ANYTHING is sent to the browser):

PHP Code:
<?php

if (isset($_COOKIE['visited']))
{
    
header('Location: go_to_this_page.php');
}
else
{
    
$expire 60*60*24*7*52;
    
setcookie('visited''yes'$expire'/''.yoursite.com');
}
?>
That should set a cookie that expires after 1 year. (Those numbers are in seconds).

Now, you need to edit that code a bit:
  • You may change the cookie name if you wish, but be sure that you change it in both spots
  • Edit 'go_to_this_page.php' in the header() statement to the page you want to redirect to. Can also be a URL.
  • Change '.yoursite.com' to your site's domain. Keep that period as the first character so the cookie will be recognized under all subdomains

????: NamePros.com http://www.namepros.com/web-design-discussion/114827-welcoming-page-load-question.html
Hope that helps
mholt is offline  
Old 08-11-2005, 04:03 PM THREAD STARTER               #5 (permalink)
Account Closed
 
zack's Avatar
Join Date: Apr 2005
Posts: 167
zack is on a distinguished road
 



Wow. This looks brilliant! Thanks a bunch for the help. If there's anything I can do for you don't hesitate to ask.
Have a good night.
zack is offline  
Old 08-11-2005, 04:12 PM   #6 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Add to rep, maybe?
mholt is offline  
Old 08-11-2005, 04:15 PM THREAD STARTER               #7 (permalink)
Account Closed
 
zack's Avatar
Join Date: Apr 2005
Posts: 167
zack is on a distinguished road
 



No problemo
zack is offline  
Old 08-11-2005, 04:35 PM   #8 (permalink)
Senior Member
 
Muneeb2Good's Avatar
Join Date: Jun 2005
Location: Planet Mars
Posts: 1,401
Muneeb2Good is a name known to allMuneeb2Good is a name known to allMuneeb2Good is a name known to allMuneeb2Good is a name known to allMuneeb2Good is a name known to allMuneeb2Good is a name known to allMuneeb2Good is a name known to allMuneeb2Good is a name known to all
 




cooool thanks COMPUXP !
Muneeb2Good is offline  
Old 08-11-2005, 04:39 PM THREAD STARTER               #9 (permalink)
Account Closed
 
zack's Avatar
Join Date: Apr 2005
Posts: 167
zack is on a distinguished road
 



Ok I'm missing something.
Check the attatchment for a screenshot of the code.

Do I need a .txt file for the php to read?
Did I put the code where I shouldn't have?

My main page is named "index2.htm" now.
THe welcome page is named "index.htm"

It still continues to goto the welcome page after one visit.
zack is offline  
Old 08-11-2005, 05:58 PM   #10 (permalink)
DNOA Member
Join Date: May 2004
Posts: 5,040
mholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant futuremholt has a brilliant future
 


Autism Marrow Donor Program 9/11/01 :: Never Forget Multiple Sclerosis Adoption Alzheimer's Lou Gehrig's Disease (ALS)
Ah, yes, sorry - forgot that. Rename the file so that it has a .php extention. Then it will work.

EDIT: No it won't. Lol... sorry Put the PHP code FIRST THING on the webpage. Even before the <html> tag.
mholt is offline  
Old 08-11-2005, 07:54 PM THREAD STARTER               #11 (permalink)
Account Closed
 
zack's Avatar
Join Date: Apr 2005
Posts: 167
zack is on a distinguished road
 



Still isn't working...
Any other ideas?
zack is offline  
Old 08-12-2005, 05:57 AM   #12 (permalink)
Pro Coder & Designer
 
aween's Avatar
Join Date: Apr 2005
Location: Netherlands
Posts: 967
aween is just really niceaween is just really niceaween is just really niceaween is just really niceaween is just really niceaween is just really niceaween is just really niceaween is just really nice
 



your testing it on your own server(your own pc ) or with a host ?
__________________
aween web development
aween is offline  
Old 08-12-2005, 12:43 PM THREAD STARTER               #13 (permalink)
Account Closed
 
zack's Avatar
Join Date: Apr 2005
Posts: 167
zack is on a distinguished road
 



What?
zack is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best way to have multiple backgrounds on a page? Nuttmig Web Design Discussion 7 02-17-2005 09:40 PM
Question about Page Rank neocoven Domain Newbies 4 01-02-2005 09:40 AM
How to load a different page each time page refreshes? skuba Web Design Discussion 6 07-30-2003 10:11 AM

 
All times are GMT -7. The time now is 07:13 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger