codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  Cookies and new pages  madaxe at 00:44 on Friday, March 25, 2005
 

Ok i want to check when somebody uses a url that does not point to my index page that the cookie i set is present if not i want to send them to the log on page. This is what i ahve so far

oh yes my cookie is called

peterpan.net


so i want to see if this exists first

if it does i want to print "WELCOME TO OUR NEW WEB SITE!!!!" on a blank page if it is not found then i want to goto www.peterpan.net

where am i going wrong???


<HTML>
<Head>
<Script Language=JavaScript>



if (document.cookie.length > 0)
{


window.location.replace("http://www.peterpan.net")
}

</Script>
</Head>
<Body>

<h2><font color="red"><b><u><center>WELCOME TO OUR NEW WEB SITE!!!!</center></u></b>

</body>
</html>













CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Targeting Multiple iframes
•  Use of VB .NET
•  Cookies and new pages
•  need help with e-mail validation
•  Problems with DHTML dropdown menus
•  Re: Passing values from a select box to a text box
•  lowerCase to UpperCase
•  Re: Javascript validation that will stop a ` (apostrophe) being entered
•  Re: pop-up Javascript calendar


Recent Articles
Communicating with the Database (Using ADO)
MagicGrid
Simple Thumbnail Browsing Solution
Type Anywhere
A Better Moustrap: FmtDate to replace FormatDateTime
ASP.NET Forum Source Code
Internal Search Engine
Javascript Growing Window
Simple date validation
Search engine friendly URLs using ASP.NET (C#.NET)


Site Survey
Help us serve you better. Take a five minute survey. Click here!

© Copyright codetoad.com 2001-2005