Code Newbie
News     Forums     Search     Members     Sign Up    

My Code Newbie
Username

Password

Articles/Snippets
ASP Classic
ASP.NET
C
C#
C++
HTML / CSS
Java
Javascript
Linux / BSD
Perl
PHP
Python
Ruby
SQL
VB 6
VB.NET

C.N. Friends
  Planet Rome

Link to Us!
Code Newbie
  Code Newbie
    forums
Old 06-21-2005, 08:45 PM   #1 (permalink)
Rocket
Registered User
 
Join Date: Apr 2005
Posts: 13
Rocket is on a distinguished road
JS cookie point to new page

Me again,

I need to point this cookie to another page.
OR (preferably) the same page, but without the name 'text box'.

Sorry for my lameness, I am new to this scripting stuff.



HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/ST/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Phatpat's PC Supplies</title> <script language="JavaScript"> <!--
//var names = window.prompt("Hi, welcome to phatpat's, please enter your name");

var d=new Date()
var weekday=new Array("Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday")
var monthname=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")
document.write(weekday[d.getDay()] + " ")
document.write(d.getDate() + ". ")
document.write(monthname[d.getMonth()] + " ")
document.write(d.getFullYear())


//cookie expiry date
function makeCookie(){
infoOne= document.getElementById('first').value;
var expiryDate=new Date();
expiryDate.setMonth(expiryDate.getMonth()+1);
expiryTime="; expires"+expiryDate.toUTCString();
infoOne = encodeURI(infoOne);
document.cookie=infoOne+expiryTime;
<!-- window.alert(document.cookie)-->
 document.getElementById('welcome').innerText="Welcome "+document.cookie;
 }
-->
</script> <link href="mystyle.css" rel="stylesheet" type="text/css" /> </head> <body> <h1>Phatpat's PC Supplies</h1> <h2 id="welcome">Welcome</h2> <table class="menu" cellspacing="2" id="mytable"> <tr> <td class="cells"><a href="index.html">Home</a></td> <td class="cells"><a href="order.html">Order</a></td> <td class="cells"><a href="aboutus.html">About Us</a></td> <td class="cells"><a href="contact.html">Contact Us</a></td> </tr> </table> <p>Welcome to phatpats pc supplies, we aim to beat any price we possibly can.</p> <p>what is your name?</p> <input type="text" name="fname" id="first"/> <input type="submit" onclick="makeCookie()" value="submit"/> <p> <a href="http://validator.w3.org/check?uri=referer"><img
          src="http://www.w3.org/Icons/valid-xhtml10"
          alt="Valid XHTML 1.0!" height="31" width="88" /></a> </p> </body> </html>
Rocket is offline   Reply With Quote
Old 06-22-2005, 05:47 AM   #2 (permalink)
Rocket
Registered User
 
Join Date: Apr 2005
Posts: 13
Rocket is on a distinguished road
I got it working, so I am sure I will be back in 20 minutes to ask another question...

this site has turned out to be a very valuable resource indeed,

thanx again.
Rocket is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Turning a normal wireless Card into an access point redhead Linux / BSD / OS X 7 05-21-2005 10:10 AM
Checking a flag in Opened ASP.net page Continously ! mechtech MS Technologies ( ASP, VB, C#, .NET ) 1 04-19-2005 01:37 PM
Cookie help with ASP... buchannon MS Technologies ( ASP, VB, C#, .NET ) 3 11-10-2004 10:37 AM
refresh page automaticlly lampoin HTML, XML, Javascript, AJAX 5 06-18-2004 09:13 AM


All times are GMT -8. The time now is 12:48 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0 RC8 ©2007, Crawlability, Inc.





Copyright © 2000-2008, Milano Interactive
Web Hosting provided by Portal 360 Web Hosting